Using sysarch specific syscalls in assembly?

alexander arundel at h3c.de
Tue Aug 9 20:27:25 GMT 2005


On Tue Aug  9 05, ari edelkind wrote:
> 
> You need to push a _pointer_ to a structure as your second argument to
> sysarch(2).  This means something more along the lines of:
> 
> ioperm_args   dd  378h
>               dd  3
>               dd  1
> 
> argp          dd  ioperm_args
> 
> [...]
>       push dword argp
>       push dword I386_SET_IOPERM
> [...]
> 
> 
> Get this wrong, and you'll have unpredictable results.
> 
> ari

Nope. That doesn't work. The carry flag is being set and eax is 16h, which is:

     [EINVAL]           An invalid range was specified by the start or length
                        arguments.

(quoted from i386_set_ioperm(2)).

Here is some data that might be usefull (c&p from ddd):

%esp = 0xbfbfea58

mem(%esp) = 0x00000004	0x0804a214

mem(0x0804a214) = 0x0804a1fc

mem(0x0804a1fc) = 0x00000378	0x00000004	0x00000003


More information about the freebsd-hackers mailing list