- Operating System acts an intermidiary between the user of a computer and the computer hardware.
- Operating System is to provide an environment in which a user can execute programs in a convenient and effcient manner.
- Operating System is software that manages the computer hardware.
- Operating System is large and complex. piece by piece approach is needed and each pieces should be well-delineated portion of the system with carefully defined inputs, outputs, and functions.
- Describe the general organization of a computer system and the role of interrupts.
- Describe the components in a modern multiprocessor computer system.
- Illustrate the transition from user mode to kernel mode.
- Discuss how operating systems are used in various computing environments.
1.1 What Operating Systems Do
- A computer system can be devided roughly into four components : the hardware, the operating system, the application programs, and a user.
1.1.1 User View
- To a user, the operating system provide ease of use. A user don't need to pay attention to resource utilization - how various hardware and software resources are shared.
1.1.2 System View
- To the computer, the operating system is the program most intimately involved with the hardware. The operating system is kinda resource allocator. - CPU time, memory space, storage space, I/O devices, etc. these resources should be controlled.
- To the computer, the operating system is kinda control program. A control program manages the execution of user programs to prevent erros and improper use of the computer. It is especially concerned with the operation and control of I/O device.
1.1.3 Defining Operating Systems
- In general, we have no completely adequate definition of an operating system. Operating systems exist becuase they offer a reasonable way to solve the problem of creating a usable computing system. Since bare hardware alone is not particularly easy to use, application program are developed. These programs require certain common operations, such as those controlling the I/O devices. The common functions of controlling and allocating resources are then brought together into on piece of software: the operating system.
- The operating system is the one program running at all times on the computer. called the kernel.
1.2 Computer-System Organization
- In computer system, There are common bus connects device controllers. bus provides access between components and shared memoery. Each device controller is in charge of a specific type of device. eg, a disk drive, audio device, or graphics display.
- Operating systems have a devie driver for each device controller. This device driver understands the device controller and provides the rest of the operating system with a uniform interface to the device.
- The CPU and the device controllers can execute in parallel, competing for memory cycles. To ensure orderly access to the shared memory, a memory controller synchronizes access to the memory.
-Hardware trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus.
-Interrupts are use for many other purposes as well and are a key part of how operating systems and hardware interact.
-When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location. fixed location usually contains the starting address where the service routine for the interrupt is located.
-The interrupt service routine executes; on completion, the CPU resumes the interrupted computation. The interrupt architecture must also save the state information of whatever was interrupted, so that it can restore this information after servicing the interrupt.
- Interrupt vector is array of addresses indexed by a unique number, given with the interrupt request, to provide the adrress of the interrupt service routine for the interrupting device.
-The CPU hardware has a wire called the interrupt-request line that the CPU senses after executing every instruction. When the CPU detects signal on the interrupt-request line, it reads the interrupt number and jumps to the interrupt-handler routine (=interrupt-service routine) by using that interrupt number as an index into the interrupt vector.