Page 1 of 1

System Calls

Posted: Wed May 04, 2005 11:00 pm
by aymanmadkour
Hi...

I don't seem to understand the mechanism of system calls. Does any one have any links?

Ayman

Re: System Calls

Posted: Wed May 04, 2005 11:00 pm
by Hery
i try to explain you it now

so, when program (for example) want to show on screen text: "Hello World!", it can't put it into video memory (it should be protected), system call should do it! how to call it? in linux program ut into registers (ax, bx, etc) arguments and call interrupt 80h. Then system call write text on the screen.

Re: System Calls

Posted: Wed May 04, 2005 11:00 pm
by aymanmadkour
But what if I do not want to use interrupts? Is that possible?

Re: System Calls

Posted: Wed May 04, 2005 11:00 pm
by DennisCGc
aymanmadkour wrote:But what if I do not want to use interrupts? Is that possible?
Not sure what you mean, but you can use the SYSENTER/SYSCALL. (one is AMD, another one is INTEL.)

To be honest, I don't have any idea to use them. Anyway, I think you can google for them.

Gl & Hth,

DennisCGc.

Re: System Calls

Posted: Fri May 06, 2005 11:00 pm
by Hery
aymanmadkour wrote:But what if I do not want to use interrupts? Is that possible?
yes, if you know address where system call is (for example: write: 3000h:1F2Ah ) you can jump to system call

Re: System Calls

Posted: Fri May 06, 2005 11:00 pm
by gaf
If your OS is supposed to offers any protection at all, an user-programm mustn't be able to jump simply jump to a system call. It's only possible if your apps run as ring0 code and are thus allowed to do whethever they please..

btw: What's the problem with interrupts ?

regards,
gaf

Re: System Calls

Posted: Fri May 06, 2005 11:00 pm
by Legend
aymanmadkour wrote:But what if I do not want to use interrupts? Is that possible?
You could use callgates - but that would basically boil down to the same thing.

Re: System Calls

Posted: Fri May 06, 2005 11:00 pm
by aymanmadkour
Excuse me for the silly question... What's a "callgate"?

Ayman

Re: System Calls

Posted: Fri May 06, 2005 11:00 pm
by Legend
A callgate is so concept of the intel i386er from intel, however, it is especially close to an interrupt, that you woudld not notice it being a call gate and note an interrupt gate unless you a) either see that it lives in GDT/LDT and in the IDT and/or b) use jmp as the instruction that is used to call it,

Conceptually, it does not change much, if anything at all.