op

Subdecks (2)

Cards (120)

  • Computer system
    Can be divided into four components: hardware, operating system, application programs, users
  • Hardware
    • Provides basic computing resources: CPU, memory, I/O devices
  • Operating system
    Controls and coordinates use of hardware among various applications and users
  • Application programs
    • Define the ways in which the system resources are used to solve the computing problems of the users: word processors, compilers, web browsers, database systems, video games
  • Users
    People, machines, other computers
  • Operating system is a resource allocator and control program making efficient use of hardware and managing execution of user programs
  • Operating system
    A resource allocator: manages all resources, decides between conflicting requests for efficient and fair resource use
  • Operating system
    A control program: controls execution of programs to prevent errors and improper use of the computer
  • There is no universally accepted definition of an operating system
  • Kernel
    The one program running at all times on the computer, part of the operating system
  • System programs
    Programs that ship with the operating system, but are not part of the kernel
  • Application programs

    All programs not associated with the operating system
  • Middleware
    A set of software frameworks that provide additional services to application developers such as databases, multimedia, graphics
  • Computer-system operation
    1. One or more CPUs, device controllers connect through common bus providing access to shared memory
    2. Concurrent execution of CPUs and devices competing for memory cycles
  • I/O device operation
    1. I/O devices and the CPU can execute concurrently
    2. Each device controller is in charge of a particular device type
    3. Each device controller has a local buffer
    4. Each device controller type has an operating system device driver to manage it
    5. CPU moves data from/to main memory to/from local buffers
    6. I/O is from the device to local buffer of controller
    7. Device controller informs CPU that it has finished its operation by causing an interrupt
  • Interrupt
    Transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines
  • Trap or exception
    A software-generated interrupt caused either by an error or a user request
  • An operating system is interrupt driven
  • Interrupt handling
    1. The operating system preserves the state of the CPU by storing registers and the program counter
    2. Determines which type of interrupt has occurred: polling or vectored interrupt system
    3. Separate segments of code determine what action should be taken for each type of interrupt
  • I/O structure
    1. After I/O starts, control returns to user program only upon I/O completion
    2. Wait instruction idles the CPU until the next interrupt
    3. Wait loop (contention for memory access)
    4. At most one I/O request is outstanding at a time, no simultaneous I/O processing
    5. After I/O starts, control returns to user program without waiting for I/O completion
    6. System call – request to the OS to allow user to wait for I/O completion
    7. Device-status table contains entry for each I/O device indicating its type, address, and state
    8. OS indexes into I/O device table to determine device status and to modify table entry to include interrupt
  • Main memory
    Only large storage media that the CPU can access directly, typically volatile, typically random-access memory in the form of Dynamic Random-access Memory (DRAM)
  • Secondary storage
    Extension of main memory that provides large nonvolatile storage capacity, such as hard disk drives and non-volatile memory devices
  • Storage hierarchy
    Storage systems organized in hierarchy based on speed, cost, and volatility, with caching used to copy information into faster storage systems
  • Device driver
    Provides uniform interface between device controller and kernel
  • Most computer systems use a single general-purpose processor, but also have special-purpose processors
  • Multiprocessor systems
    • Increased throughput, economy of scale, increased reliability – graceful degradation or fault tolerance
  • Asymmetric multiprocessing
    Each processor is assigned a specific task
  • Symmetric multiprocessing
    Each processor performs all tasks
  • Clustered systems
    Multiple systems working together, usually sharing storage via a storage-area network (SAN), providing high-availability service which survives failures
  • Operating-system operations
    1. Bootstrap program initializes the system and loads the kernel
    2. Kernel starts system daemons and is interrupt driven (hardware and software interrupts)
  • Multiprogramming
    Organizes jobs (code and data) so CPU always has one to execute, with a subset of total jobs kept in memory and one job selected and run via job scheduling
  • Timesharing (multitasking)
    Logical extension of multiprogramming where CPU switches jobs frequently so users can interact with each job while it is running
  • Dual-mode operation
    Allows OS to protect itself and other system components by distinguishing when system is running user code or kernel code
  • Transition from user to kernel mode

    Timer is set to interrupt the computer after some time period to prevent infinite loop / process hogging resources
  • Process
    A program in execution, a unit of work within the system
  • Single-threaded process

    • Has one program counter specifying location of next instruction to execute, executes instructions sequentially, one at a time, until completion
  • Multi-threaded process

    • Has multiple program counters, allowing multiple threads of execution
  • Transition from User to Kernel Mode
    1. Timer to prevent infinite loop / process hogging resources
    2. Timer is set to interrupt the computer after some time period
    3. Keep a counter that is decremented by the physical clock
    4. Operating system set the counter (privileged instruction)
    5. When counter zero generate an interrupt
    6. Set up before scheduling process to regain control or terminate program that exceeds allotted time
  • Process
    A program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
  • Process
    • Needs resources to accomplish its task (CPU, memory, I/O, files)
    • Initialization data
    • Termination requires reclaim of any reusable resources