os again hw

os again hw - ECE/CS153A Practice Problems Topic: Operating...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 ECE/CS153A Practice Problems Topic: Operating Systems and Realtime Systems ******************* ******************* OS/Device Drivers ******************* ******************* 1) What are the 5 primary responsibilities of the OS? memory management (allocation/virtual memory) process management isolation of processes scheduling of the CPU device driver support (device control) file systems networking 2) What is a Linux Module? a software mechanism that allows encapsulation of kernel code (eg device drivers) that can be loaded and unloaded from the OS dynamically. 3) How is a system call implemented? Via a trap instruction that has an ID encoded in it. The ID is used as an index into the interrupt/trap table at known location in memory, at the index is an address of the OS routine that implements the code that changes the mode of the system from user to system, invokes the right system call (device driver), then switches the mode back and returns to the user. 4) If kernel code wants to allocate memory dynamically, does it just use malloc? Why/Why not? No - there is no user space code accessible to the kernel since it executes only in superuser/kernel mode. Therefore all C libraries are not available (which is where malloc is). The kernel needs its own version of malloc (kmalloc). 5) What's the difference between mechanism and policy? Which does a device driver implement? mechanism = functionality policy = rules that decide what processes can use what functionality, when and how. A device driver can implement both but should keep the code of each separate. The device driver need not implement both -- one module could be for policy then another for mechansim.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sheet1 Page 2 6) Describe what character and block devices are in Linux. character devices are entities that are accessed via a stream of bytes. block devices are the same however they can used to mount a file system and have a buffer associate with them. devices can be virtual or real. 7) How do the module command insmod, rmmod, lsmod, and modprobe work (how do they affect the device driver within the module)? insmod - loads the module into the kernel's address space
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/01/2009 for the course CS 153A taught by Professor Krintz during the Fall '09 term at UCSB.

Page1 / 6

os again hw - ECE/CS153A Practice Problems Topic: Operating...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online