Question

I mean, how the kernel expose its function to user land application.

Was it helpful?

Solution

Kernel functions are called using syscalls, which usually take form of filling some registers (type of syscall, parameters, ...) and doing a software interrupt (int 0x80) or sysenter instruction (if your architecture supports it).

If you're doing this on Linux, you might want to see some Linux syscall documentation, like one here: http://bluemaster.iu.hio.no/edu/dark/lin-asm/syscalls.html

There surely exists some similar documentation for other kernels (windows').

OTHER TIPS

Assuming you are talking about Linux, you put your arguments in registers and call interrupt 0x80. The name for this is "system call" See these links:

Windows is probably similar, this looks like a good article:

http://www.codeguru.com/cpp/w-p/system/devicedriverdevelopment/article.php/c8035

etc... google

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top