[PATCH] ARM: Add support for semihosting

Sascha Hauer s.hauer at pengutronix.de
Wed Oct 21 00:26:43 PDT 2015


On Tue, Oct 20, 2015 at 06:14:19PM -0700, Andrey Smirnov wrote:
> >> +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.

What a pitty.

> 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.

Would be nice to have, but not worth the hassle of creating custom
extensions to the spec.

> 
> 
> >
> >> +
> >> +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.

Ok, then we should be able to reuse it as error code.

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