All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Implementing the uBoot SYSCALL interface for MIPS
Date: Tue, 23 Dec 2014 15:29:40 +0100	[thread overview]
Message-ID: <54997C54.5000407@gmail.com> (raw)
In-Reply-To: <6D39441BF12EF246A7ABCE6654B0235320F88D47@LEMAIL01.le.imgtec.org>

Hi Matthew,

On 17.12.2014 01:07, Matthew Fortune wrote:
> Hi Daniel,
> 
> I'm looking for a bit of feedback on my query below.  Unless there is a
> major problem I'll start to organise an implementation for review.
> 
> Thanks,
> Matthew
> 
>> -----Original Message-----
>> From: Matthew Fortune
>> Sent: 08 December 2014 12:43
>> To: 'u-boot at lists.denx.de'
>> Subject: Implementing the uBoot SYSCALL interface for MIPS
>>
>> Hi all,
>>
>> I've been recently working on and promoting a common bare-metal semi-
>> hosting interface for the MIPS architecture. The main goal of this is to
>> allow a bare-metal MIPS application to run on the maximum number of
>> simulation and hardware platforms without (much/any) modification. The
>> interface uses the MIPS SYSCALL interface and a custom ABI to request
>> operations from an OS or monitor.

do you have publicly available documents somewhere? I guess the syscalls
will be routed through a handler for the MIPS debug exception?

>>
>> As far as I can see uBoot's new(ish) API as not yet been mapped onto the
>> MIPS architecture. I would like to find out if it will be acceptable to
>> access some map some of the operations from the semi-hosting interface
>> onto the uBoot API.

Of course it is acceptable as long as the code is configurable and
optional. Also I can see that ARM already implementes a minimal
semihosting mapping.

>>
>> In particular I'd like to get: open, read, write, close, fstat
>> implemented such that FD 0/1 behave as if attached to a serial port.
>> Open/close and fstat wouldn't do anything special as they would just say
>> that FD 0/1 exist.
>> Read and write would map to getc and putc for FD 0 and FD 1
>> respectively.

as noted above ARM already has all such syscalls (except fstat)
implemented in arch/arm/lib/semihosting.c which can serve as an example

>>
>> The interface is being implemented directly in qemu, and as part of
>> libgloss on the consumer side (not upstream yet). I will be promoting
>> its use in any other open source simulators and hosting libraries too as
>> I find them. I'm also boldly trying to abstract away from any ABI issues
>> (O32/N32/N64) to potentially allow the consumer and producer side of the
>> interface to have different ABIs to some extent. I am also trying to
>> create a well-defined entry-point interface to reduce the variance in
>> how arguments are passed from bootloader to application, at least one
>> person has shown interest in this from the kernel list.
>>
>> If it sounds like it will be acceptable then I'll send more details of
>> the interface as a follow up but I would really like to include uBoot in
>> the list of supported environments. There is of course scope to add any
>> number of extra operations to the interface to cover more of the uBoot
>> API but I generally agree with the principle that exploiting too much of
>> uBoot is bad form if an application is non-GPL.
>>
>> Thanks,
>> Matthew

-- 
- Daniel

  reply	other threads:[~2014-12-23 14:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-17  0:07 [U-Boot] Implementing the uBoot SYSCALL interface for MIPS Matthew Fortune
2014-12-23 14:29 ` Daniel Schwierzeck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-12-08 12:42 Matthew Fortune

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54997C54.5000407@gmail.com \
    --to=daniel.schwierzeck@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.