System Calls: Abhijit A. M
System Calls: Abhijit A. M
System Calls: Abhijit A. M
Abhijit A. M.
abhijit.comp@coep.ac.in
(C) Abhijit A.M.
Available under Creative Commons Attribution-ShareAlike License V3.0+
https://linuxhint.com/list_of_linux_syscalls/
int main() {
int a = 2;
}
printf("hi\n"); Code schematic
-----
C Library -------user-kernel-mode-
----- boundary----
int printf("void *a, ...) {
//OS code
...
write(1, a, ...); int sys_write(int fd, char *, int
} len) {
int write(int fd, char *, int len) {
figure out location on disk
int ret;
... where to do the write and
mov $5, %eax, carry out the operation,
mov ... %ebx,
mov ..., %ecx
etc.
int $0x80 }
__asm__("movl %eax, -4(%ebp)"); # -
4ebp is ret
return ret;
}
Two important system calls
Related to processes