visopsys.org

Visopsys Forums
It is currently Thu Jan 18, 2018 2:45 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: syscall
PostPosted: Sat Aug 11, 2012 2:24 am 
Offline

Joined: Sat Aug 11, 2012 1:42 am
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: syscall
PostPosted: Mon Aug 13, 2012 3:00 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 7:20 pm
Posts: 460
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group