aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorPaul Fertser2013-04-15 21:42:46 +0400
committerGareth McMullin2013-05-18 15:33:58 +1200
commitdf32aad757935c8953c844ffaa455fa940b4b405 (patch)
treeb1e201e8a2b979c98c127f2a51f87932dc817c35 /README
parent5020d1f05db920cd0633982016c0b1978a310d20 (diff)
semihosting: improve handling of console I/O
This implements special handling for SYS_OPEN to catch requests for ":tt" which is reserved by ARM for console input/output. They're mapped to the appropriate GDB file descriptors automatically. An additional file handle offset is introduced because ARM doesn't consider zero handle to be valid. Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Diffstat (limited to 'README')
-rw-r--r--README18
1 files changed, 11 insertions, 7 deletions
diff --git a/README b/README
index b47e22b..9c10013 100644
--- a/README
+++ b/README
@@ -47,15 +47,19 @@ RAM.
Semihosting support
===================
-Basic armv6m/armv7m semihosting is supported, i.e. you can build your
-application in a special way to use host's stdin and stdout right
-inside gdb simply by calling printf(), scanf() and other input-output
-functions. To make use of it, add --specs=rdimon.specs and -lrdimon to
+Standard ARMv6-M/ARMv7-M semihosting is supported, i.e. you can build
+your application in a special way to have calls to certain functions
+(open(), close(), read(), write(), lseek(), rename(), unlink(),
+stat(), isatty(), system()) executed on the debugging host itself. To
+make use of these facilities, add --specs=rdimon.specs and -lrdimon to
the linker flags for your firmware.
-All writes are treated as writes to the stdout, all reads are done
-from stdin; SYS_ISTTY always returns true, SYS_ERRNO -- EINTR;
-SYS_OPEN and SYS_FLEN return dummy non-zero values.
+If you're going to use stdin, stdout or stderr (e.g. via
+printf()/scanf()) and you're not using newlib's crt0 (by specifying
+-nostartfiles), you need to add this to your initialisation:
+
+void initialise_monitor_handles(void);
+initialise_monitor_handles();
Project layout
==============