Hello,
Can anyone tellme a link about the system calls? I know system calls are an interrup number X that calls a funtion. But I want to know how to do libs with functions that call the sys-call. And i want to know the most common systems calls.
Thanks for all
System calls
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:System calls
i think you can learn alot from the linux sources (syscall.h, or something). Building libraries atop of system calls implies that
The usual system calls depend on what your system is able of, but imho, you should at least have
btw, i dunno how windows NT handles it ... If someone has additionnal knowledge to share (Tim?)...
- [-] you should be able to access the library from any program (did you meant "shared libraries" or statically linked ones ?)
[-] you must know what the library will offer. Usually, whatever a library do, the user program could do it without the library. Get a look at f<operation> interface of stdio.h, for instance: all it does is adding buffering and data formatting on top of the classic read/write system calls. usually, the library has additionnal internal state that makes the use of the system call less frequent and thus make the program run more efficiently.
The usual system calls depend on what your system is able of, but imho, you should at least have
- [-] process control: start new programs, terminate program, etc.
[-] user interaction : get input, parameters, and show results (may depend on whether you have TUI or GUI)
[-] process communication : find another software component and talk to it.
btw, i dunno how windows NT handles it ... If someone has additionnal knowledge to share (Tim?)...
Re:System calls
These two system calls df just described are the only two system calls in a *Microkernel*. In a monolothic kernel, you have different system calls, also depending on the system you want to implement. For example in UNIX, you will need the essential system calls FORK, EXEC, READ, WRITE, OPEN and CLOSE.
Re:System calls
well.. what is an interrupt other than a send message?
smsg(EXEC, "/blah/my.exe");
exec()
maybe should explain the differenfce between an API and a SysCall?
i wrote a tiny asm kernel, there was no send message or interrupts, just a vector table your app called directly at a fixed address.. it was all 'soft'.
you could also setup task gates instead of intterupt gates...
task gates / call gates worth looking into..
smsg(EXEC, "/blah/my.exe");
exec()
maybe should explain the differenfce between an API and a SysCall?
i wrote a tiny asm kernel, there was no send message or interrupts, just a vector table your app called directly at a fixed address.. it was all 'soft'.
you could also setup task gates instead of intterupt gates...
task gates / call gates worth looking into..
-- Stu --