






















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!























How you could add your own system-calls to Linux without editing and recompiling the kernel
application program
user-mode (restricted privileges) (^) (unrestricted privileges)kernel-mode
standard runtime libraries
call ret
Linux kernel
int 0x iret
installable module
call ret
.section .data
sys_call_table:
.long sys_restart_syscall .long sys_exit .long sys_fork .long sys_read .long sys_write // …etc (from ‘arch/i386/kernel/entry.S’)
sys_restart_syscall sys_exit sys_fork sys_read sys_write sys_open sys_close
…etc…
sys_call_table 0 .section .text
1 2 3 4 5 6 7
Section-Header Table (optional)
ELF Header
Section 2 Data Section 3 Data … Section n Data
Segment 1 Data Segment 2 Data Segment 3 Data … Segment n Data
Linkable File Executable File
Section-Header Table
Program-Header Table (optional)
Program-Header Table
ELF Header
Section 1 Data
// declare global variable unsigned long *sys_call_table; EXPORT_SYMBOL(sys_call_table); int init_module( void) { sys_call_table = (unsigned long *)0xC0251500; return 0; }