1 / 4

System Calls: From User to Kernel Interaction

Learn the detailed process of system calls from user space back to the kernel in assembly language. Discover the mapping from syscall number to C functions, handling user space data transfers, and funky kernel programming techniques. Explore global variables, static allocation, and avoiding magic numbers. Is kmalloc the solution?

icroce
Download Presentation

System Calls: From User to Kernel Interaction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. System calls • What’s the exact process from user back to user? 451shell% physusage • In shell: ... syscall(__NR_physusage, ...) ...

  2. System calls, cont’d • In assembly: int $0x01 • Says: switch to kernel and tell it to call system call 01 • Kernel needs mapping from syscall number to backing C function

  3. System calls, cont’d • C function executes • May copy to/from user space • Return

  4. Funky kernel programming • Global variables • primary.c int array[2] = {1, 2}; • secondary.c extern int array[]; • Static allocation • No magic numbers, please • Hmm, kmalloc?

More Related