Chapter2.md 3.35 KB
Newer Older
Sadman Kazi's avatar
Sadman Kazi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
SE 350
======

Chapter 2
---------
Operating system defintion:
A program that controls the execution of application programs and acts as a standardized interface between applications and hardware
- responsible for managing resources
- relinquishes control of the processor

Kernel (also called nucleus):
Portion of the OS that is in main memory
- Contains frequently used functions

OS evolution:
- Serial processing (40-50s)
  - No OS
  - Machines run from a console with display lights, toggle switches, input device and printer
  - Forced interruptions
  - Long setup times for programs
- Simple batch system (goal: improve utilization)
  - Monitor: a software that controls the sequence of events, batch jobs together
  - Memory protection: protect area containing the monitor
  - Timer to prevent any single job from monopolizing the system
  - Certain machine level instructions only executed by the monitor, such as I/O operations and interrupts

Modes of operation:
- Reason: protect users and kernel from users
- User mode: certain instructions may not be executed
- Kernel mode (monitor): priviliged instructions and access to protected memory areas

Process:
- A running instance of a program
- Consists of three components:
  1. An executable program
  2. Associated data
  3. Execution context (information need by the OS for management)

Common problems (multiple programs, threads, interrupts, I/O, shared resources):
- Improper synchronization
- Failed mutual exclusion (state corruption on shared memory)
- Nondeterminate program operation (interference among programs due to memory allocation, IO access)
- Deadlocks (resource access)
- Race condition (output dependent on the timing of other events)

Memory management:
- Isolate processes
- Allocation and management abstracted from the user
- Modular programming support
- Protection and access control for shared memory
- Virtual memory allows programmers to address memory from a logical point of view independent of how much memory is available:
  - Virtual address is page number plus offset in the page
  - Paging allows process to be comprised of a number of fixed size blocks called pages, which can be anywhere in memory
  - Processor --> Virtual address --> Memory management unit --> Real address --> Main memory
                                                             +-> Disk address --> Secondary memory

Infomation security:
- Availability: system protection against interruptions
- Confidentiality: no unauthorized access
- Integrity: no unauthorized modification
- Authenticity: verification of the identity of users

- Scheduling and resource management: goal is to maximize throughput, minimize response time and accomodate as many uses as possible
- View the system structure as a series of levels
  - Each level performs a related subset of functions
  - Each relies on the next lower level to perform more primitive functions
  - Decomposes a problem into more manageable subproblems
  - Electronic circuits -> Instruction set -> procedures -> interrupts -> primitive processes -> ... etc.

Modern OS:
- Microkernel Arch:
  - Kernel functions address spaces, interprocess comm, basic scheduling
  - Everything else in user space
- Thread: a dispatchable unit of work executing sequentially and is interruptable
- Process is a collection of one or more threads
- Symmetric Multiprocessing (SMP): processors share same main memory and I/O