Good Slides To Understand System Call
Good Slides To Understand System Call
Good Slides To Understand System Call
IMPLEMENTATION
CS124 – Operating Systems
Fall 2018-2019, Lecture 14
2
...
nobadsys:
# Dispatch to the function in the system-call
# table corresponding to the specified ID
# (On IA32, pointers are 4 bytes, so use
# ID*4 as the address within the table)
call *sys_call_table(, %eax, 4)
• Caller specifies:
• The file-descriptor to read
• A pointer to the buffer to store the data in
• A number of bytes to read
15
Kernel Space
that come from user-mode programs: Kernel stack
User Space
(e.g. 0xc0000000 in Linux/Pintos)
brk
Run-time heap
(via malloc)
Uninitialized data (.bss)
Initialized data (.data)
Program text (.text)
0x08048000
Forbidden
0
17
Kernel Space
boundary could still be invalid… Kernel stack
User Space
• Many OSes don’t allocate virtual memory
pages until they are actually accessed brk
Run-time heap
• Private copy-on-write pages are marked (via malloc)
read-only; first write attempt causes the Uninitialized data (.bss)
page to be copied for the writing process Initialized data (.data)
Program text (.text)
0x08048000
Forbidden
0
18
Next Topics!
• Next three lectures cover two fun topics!