System Calls

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
aymanmadkour
Posts: 11
Joined: Sat Feb 05, 2005 12:00 am

System Calls

Post by aymanmadkour »

Hi...

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

Ayman
Hery
Member
Member
Posts: 65
Joined: Sat Dec 04, 2004 12:00 am

Re: System Calls

Post 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.
aymanmadkour
Posts: 11
Joined: Sat Feb 05, 2005 12:00 am

Re: System Calls

Post by aymanmadkour »

But what if I do not want to use interrupts? Is that possible?
DennisCGc
Posts: 11
Joined: Fri Apr 22, 2005 11:00 pm

Re: System Calls

Post 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.
Hery
Member
Member
Posts: 65
Joined: Sat Dec 04, 2004 12:00 am

Re: System Calls

Post 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
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Re: System Calls

Post 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
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: System Calls

Post 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.
*post*
aymanmadkour
Posts: 11
Joined: Sat Feb 05, 2005 12:00 am

Re: System Calls

Post by aymanmadkour »

Excuse me for the silly question... What's a "callgate"?

Ayman
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: System Calls

Post 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.
*post*
Post Reply