My Kernel v0.1.0
Collaboration diagram for Syscalls - x86:

Macros

#define SYSCALL_INTERRUPT_NR   0x80
 The interrupt number used to trigger a syscall.
 

Enumerations

enum  syscall_nr {
  SYS_EXIT = 1 , SYS_FORK = 2 , SYS_READ = 3 , SYS_WRITE = 4 ,
  SYS_OPEN = 5 , SYS_CLOSE = 6 , SYS_LSEEK = 19 , SYS_GETPID = 20 ,
  SYS_KILL = 37 , SYS_BRK = 45 , SYS_STAT = 106 , SYS_LSTAT = 107 ,
  SYS_FSTAT = 108 , SYS_SBRK = 463 , SYSCALL_COUNT
}
 The list of available syscall vectors. More...
 

Detailed Description

x86 ABI

For convenience, our kernel's ABI is the same as Linux's:

Arguments

The arguments are passed in the following order:

‍eax, ebx, ecx, edx, esi, edi, ebp

The first argument (eax) is always the number of the syscall to call.

Return value

The return value is always stored inside the eax register.

Enumeration Type Documentation

◆ syscall_nr

enum syscall_nr

To make porting already existing programs easier, our syscall numbers are copied 1:1 from Linux.

Note
Syscall numbers may differ depending on the architecture.
Enumerator
SYS_EXIT 

exit()

SYS_FORK 

fork()

SYS_READ 

read()

SYS_WRITE 

write()

SYS_OPEN 

open()

SYS_CLOSE 

close()

SYS_LSEEK 

lseek()

SYS_GETPID 

getpid()

SYS_KILL 

kill()

SYS_BRK 

brk()

SYS_STAT 

stat()

SYS_LSTAT 

lstat()

SYS_FSTAT 

fstat()

SYS_SBRK 

lstat()