[U-Boot-Users] Re: The i386 patch

Daniel Engström daniel at omicron.se
Wed Nov 20 15:18:39 CET 2002

On 2002.11.20 15:06 Wolfgang Denk wrote:
> In message <200211201114.gAKBEss01326 at dagobert.svc.sysgo.de> you wrote:

> You may remember that we used a jump table  attached  to  the  global
> data in early versions of PPCBoot. I didn't like this. The nice thing
> about  the  syscall  trap  on  PPC is that you can easily put a "jump
> table" at a well-known location, so that a standalone application can
> access certain services (those explicitely exported by  U-Boot  using
> the  syscall  interface)  without  depending  on  a  special software
> version.
> I have to admit that I did not think about other architectures at the
> time we implemented this.

The i386 can do indirect calls on the ebp register. So we could let the
application know the location of the syscall table by providing it in a
register on entry. The applications initialization code can then store
it in a suitable location (called syscall_table below).

The syscall would than be done like this:

movl    $SYSCALL_NR, %eax
movl    syscall_table, %ebp
shll    $2, %eax
addl    %eax, %ebp
call    *%ebp


More information about the U-Boot mailing list