Search code examples
glibclibcmasm32

How to call kernel code in libc ? (windows or linux)


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


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').