This is a design question. The system API can be called upon in my system by using a software interrupt and passing a function identifier in eax. I was thinking of abstracting this behind a dynamic library API for user mode software.
For example, instead of a program having to set up registers and call the system interrupt directly, it can just use the C API library and do something like sysopen() which will set everything up.
The method seems to be very clean but I want to get some feedback on the idea. The problem that I see is that most of the routines will just be one liners like this:
Code: Select all
//NtSystemRequest puts the parameters in the registers and calls the system software interrupt that will call the correct kernel mode function
int
NtBrk (DWORD EndDataSegment) {
return NtSystemRequest (SYSTEM_CALL_BRK, EndDataSegment, 0, 0);
}
//100 some other routines might be like this... o_o