[PATCH] ARM: Add support for semihosting

Andrey Smirnov andrew.smirnov at gmail.com
Tue Oct 20 18:14:19 PDT 2015


>> +Not all of the I/O primitives neccessary to implement a full
>> +filesystem are exposed in ARM semihosting API and because of that some
>> +aspects of filesystem funcionality are missing. Implementation does
>> +not have support for listing directories. This means a
>> +:ref:`command_ls` to a SMHFS-mounted path will show an empty
>> +directory. Nevertheless, the files are there.
>
> Is adding ls support a matter of implementing it? Does the semihosting
> protocol support ls?

Unfortunately the protocol doesn't support any directory related
operations. It is possible to implement custom semihosting "syscalls"
and it wouldn't be that hard to add support of those to OpenOCD, but
that would leave out other debugging tools.


>
>> +
>> +Example::
>> +
>> +  mount -t smhfs /dev/null /mnt/smhfs
>
> Are actions on the host required to do that? Maybe some example for
> using this with openocd would be useful.

I completely forgot to add that to the documentation. Will fix that in
the next version of the patch.

>> +
>> +     if (semihosting_remove(pathname) != 0)
>> +             return semihosting_errno();
>
> Are the errnos semihosting returns compatible with the barebox errnos?

I can't speak for any implementation other that OpenOCD's, but what
that tool does is it returns the value of host's 'errno' after
executing a corresponding syscall.


>
> Sascha
>
> --
> Pengutronix e.K.                           |                             |
> Industrial Linux Solutions                 | http://www.pengutronix.de/  |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list