Week 6: System Calls + Kernel Flashcards
What are some of the services system calls provide?
File manipulation. Process control. Device management. Information maintenance. Communications.
What are the file manipulation modes?
Read: 4
Write: 2
Execute: 1
Read + Execute = 5
What are the four groups found in permission?
OUGO O: Special flag U: User G: User group O: Other users
What are the two system calls for opening and closing files?
int open(char * path, int flags, mode u mode): Opens/creates file int close(fd):
What type of OS is Linux?
Monolithic, meaning entire OS (drivers, file system and application IPC) is working in kernel space.
And modular.
What are the two main modes for kernel code?
Process Context: Working for user programs by executing a system call.
Interrupt Context: Handling an interrupt, preempted by higher priority interrupt.
What are the main functions of the Linux kernel?
Device drivers. File systems. Scheduling and process management. Memory management. Networking. Architecture specific, low level code (e.g. assembly). Include-files.
What is the proc file system?
A virtual file system that provides a way to interact with kernel space from user space.
What are the advantages of kernel modules?
Save memory. Error in module does not affect kernel. Faster to maintain and debug. Easier to maintain multiple machines on a single code base.
What are the disadvantages of kernel modules?
Size: Consumes unpagable memory.
Security.
What are the types of module in the kernel?
In-Source Tree: Present in source code.
Out-of-Tree: Not present in source code.
What two functions are needed for every module?
Initialize: Module loaded into kernel. Cleanup: Just before module is removed.