Assembly Syscall Question

Marco van de Voort marcov at stack.nl
Thu Jul 31 15:41:18 PDT 2003


> When making a system call to the kernel why is it necessary to push the 
> syscall value onto the stack when you don't call another function? 

You have to push anything the size of an address. Because the call return
pushes the return adress on the stack. The 1st and 3rd both push 4 bytes,
so they work.

_why_ this is needed is probably because the routine that does the int 80h
can also check and process the int 80h returnvalue and errorcode, and people
wanted to avoid duplication of that code, at least that is my guess :-)



More information about the freebsd-hackers mailing list