Preliminaries and OS Structures Flashcards
What is the role of an OS?
- Provide access to resources (processors, peripherals, memory)
- Gets out of the way of applications
What is contained in the code of an OS?
- Access to resources
- Protects application from itself
- Protections applications from other applications
What are characteristics of a DOS-like OS system?
- No protection between kernel and user
- Single user system
- One program ran at a time
- Extensible since everything runs in the same protection domain
What are characteristics of a monolithic OS system?
- Has protection between user and kernel
- Not easily extensible due to consolidation. Need to recompile to customize
- Performs well since all system services are in same address space
What is contained in a PCB?
Process control block
- Volatile state: register values of the processors for this process
- Computational state for each thread
What is the difference between threads and processes?
- OS doesn’t see threads, just processes
- Thread library is part of application at runtime
- Switching threads is cheap (taken care of by application)
What can multithreads do with multicores/multiprocessors?
- Not a lot. Multithreads cannot run on multiple processors since processes run on processors, not threads
- If a process makes an I/O call, entire application will be blocked on the processor
What are characteristics of user level threads?
- Switching among threads is voluntary
- Pre-emption is not voluntary
- All blocking calls go through the thread library
What are characteristics of kernel level threads?
- It is expensive to context switch
- Thread libraries are non portable
- Threads in application are now visible to OS through libraries
- OS provides the thread library
What services are offered by the OS?
- Process/thread management
- Memory management
- Inter-process communication
- Network access
- Access to mass storage and other peripherals
How do components/structures affect the OS?
- Affects performance
- Border crossings are expensive
Why are border crossings expensive?
- Change in locality (address space)
- Copying between kernel buffer and user buffers are expensive
- Different applications require different sources
What are the goals of an OS?
- Protection
- Performance
- Flexibility
- Scalability
- Agility
- Responsiveness
What is the process involved in a page fault?
- Find a free page frame (Page replacement algorithm)
- Update page table
- Resume process
Can be customizable
What are the three classic examples of OSes?
- DOS-like (great performance, no protection)
- Monolithic (flexible, bad performance, good protection)
- Microkernel (Flexible)