_syscall()

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2023 Sep 20 6:42
Editor
Edited
Edited
2024 Jun 13 9:34
Refs
Refs

MACRO fucntion

Linux defines 7 macros for _syscall0_syscall6
Encapsulate the low-level details of a system call invocation and parameter passing. making it easier to maintain and write portable code for different architecture (portability because it is architecture dependent)
 
 
0~6 means the number of parameters used by the system call
 

write()

int means interrupt with
Interrupt Vector
128
notion image
system call table has write index (4 is write)
system call table has write index (4 is write)
syscall3 parameter count is 6 includes
  • return type
  • system call type
  • return value
 
 

Parameter passing

The system call number is by
Parameters via CPU registers and memory for complex struct
 
 

Parameter checking

  • input address checking (check not more than 3GB) and dynamic check because full address check is heavy
 
 
 
 
 
 

Recommendations