visopsys.org
https://visopsys.org/forums/

syscall
https://visopsys.org/forums/viewtopic.php?f=3&t=180
Page 1 of 1

Author:  tangruidon [ Sat Aug 11, 2012 2:24 am ]
Post subject:  syscall

in linux ,it is
int 0x80
in visopsys it may be
lcall $0x003B,$0x00000000 and it will go to $0x003B,$0x00000000
and what is it in $0x003B,$0x00000000

Author:  andymc [ Mon Aug 13, 2012 3:00 am ]
Post subject:  Re: syscall

Hi tangruidon,

For Visopsys syscalls, we use something called a call gate. In kernelDescriptor.c, you can see that a call gate descriptor is set up to point to the function kernelApi() (in kernelApi.c). When a far call - lcall - is done to the call gate descriptor (in this case 0x3B, offset 0), it causes a privilege level switch into kernel mode code and jumps to the kernelApi() function. The kernel call proceeds from there, and then a far return gets you back to user mode.

0x3B in this case is a selector for the call gate descriptor, not a memory address, in case that wasn't clear.

Andy

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/