Semihosting 3.0

I've just taken a look at semihosting 3.0. 

The spec includes a mechanism for reporting features. After opening the special filename ":semihosting-features" one can read a header and one byte. This one byte is a bitmask that indicates whether optional semihosting features have been implemented. Implementation of this special filename requires changes to SYS_OPEN, SYS_SEEK, SYS_READ, SYS_CLOSE, SYS_FLEN, and SYS_ISTTY. Modifying six system calls seems excessive, and a way to introduce bugs.

A suggestion for an alternative: a SYS_OPEN of the special filename ":semihosting-features"  returns not a file descriptor, but a 32-bit word. This word is a bitmask; if a bit is set this indicates an optional semihosting extension has been implemented.

This would provide the same functionality, and can be implemented in one or two lines.

More questions in this forum