5 INTRODUCTION TO OPERATING SYSTEMS MAT 324:-COMPUTER SYSTEM ORGANIZATION & PROGRAMMING Edward M Kioko Phone:+254-725-695-782 Email:Kioko@cuea.edu Objectives of the Chapter Define the term Operating system Explain the functions of an operating system in a computer system Describe the common types operating systems Understand the process and routines involved in computer booting. Explain the different modes of data processing MAT 324 -IntroductionOperating Systems|MUIC Definition of Operating System A set of programs that manage the resources of the computer as well as acting as an interface between the user and the computer hardware. A set of integration programs (routine) that are used to manage as well as control the operation of the hardware components of a computer system. Examples?? MAT 324 -IntroductionOperating Systems|MUIC Functions of operating system Input output management Maintains a controlled input processing and output processing. Some memory is usually allocated for input data only i.e. some locations hold data received from particular input devices. Other memory areas are allocated for output buffering. These locations hold data temporary before its final transmission to specific output devices. MAT 324 -IntroductionOperating Systems|MUIC Functions of operating system Input output management Processor management • OS usually allocates processor time to the task executing in the main memory. MAT 324 -IntroductionOperating Systems|MUIC Functions of operating system Input output management Processor management Memory management • The OS controls the usage of the memory space to ensure that it is optimized. • The OS will always take some memory space. • The remain is usually taken up by the operating application • In a multiprogramming environment, the OS usually maintain a dynamic table that stores data about allocated and free main memory space. • We call this table memory map. MAT 324 -IntroductionOperating Systems|MUIC Functions of operating system Input output management Processor management Memory management Backing storage management • The OS uses device drivers to control the operation of storage devices. • Each device should have a device installed • When a device is required to perform a function, the OS is responsible for calling the appropriate device driver that will take control and coordinate the function of the device MAT 324 -IntroductionOperating Systems|MUIC Functions of operating system Input output management Processor management Memory management Backing storage management Interrupt handling • An event that alters the normal sequence of how the processor executes its instruction’s that instead of fetching the next instruction • When an interrupt, OS will save the state of the interrupt process then transfer control to the most appropriate program. MAT 324 -Introduction Operating Systems|MUIC 2022 Functions of operating system Input output management Processor management Memory management Backing storage management Interrupt handling Error correction • The O.S should be able to handle errors that occur as part of normal operating activity and not programming errors. • Example data lost during transfer because of an interrupt to a routine should be available to recover the data by setting up the read process again MAT 324 -IntroductionOperating Systems|MUIC 2022 Functions of operating system Input output management Processor management Memory management Backing storage management Interrupt handling Error correction Device allocation • Several jobs may request the same output media. • If more than one output devices are available for that media, then some programs will be allocated one device and other programs the other device. MAT 324 -IntroductionOperating Systems|MUIC 2022 Functions of operating system Input output management Processor management Memory management Backing storage management Interrupt handling Error correction Device allocation •Preventing File security and management •Keeping track of files descriptions illegal access or amendments to system files and locations. MAT 324 -IntroductionOperating Systems|MUIC 2022 Functions of operating system Input output management Some transfers mainly handled between the main storage direct access storage Processor management include • Loading system software into main Memory management memory as required e.g. compiler • Swapping applications programs or part Backing storage management of the program between the main store and main memory • Bringing into main store and linking Interrupt handling together the applications or system subroutines to be used in conjunction Error correction with particular job e.g. #include<iostream>; Device allocation File security and management Loading programs and subroutines MAT 324 -IntroductionOperating Systems|MUIC 2022 Functions of operating system Input output management Processor management Memory management Backing storage management Interrupt handling Error correction Device allocation File security and management Log off events and operator communication Loading programs and subroutines Job scheduling MAT 324 -IntroductionOperating Systems|MUIC 2022 Job Priority Creation Time MAT 324 -IntroductionOperating Systems|MUIC Process It is an instance of a program under execution while a program is whole batch of instructions. A program may be subdivided into a number of processes for execution. New:-Process is being created outside the processor queue Ready:-The process is waiting to be assigned the processor. Running:-States whether instructions are being executed Waiting:-The process waiting for some event to occur Terminated:-The process finishes execution MAT 324 -IntroductionOperating Systems|MUIC 2022 Processes states MAT 324 -IntroductionOperating Systems|MUIC 2022 Modes of processing Batch processing Multiprocessing Multiprogramming and multitasking Multhreading real time processing MAT 324 -IntroductionOperating Systems|MUIC Batch Processing (1) MAT 324 -IntroductionOperating Systems|MUIC 2022 Multiprocessing (2) MAT 324 -IntroductionOperating Systems|MUIC 2022 Multiprogramming (3) MAT 324 -IntroductionOperating Systems|MUIC 2022 Multithreading (4) MAT 324 -IntroductionOperating Systems|MUIC 2022 Real time (5) MAT 324 -IntroductionOperating Systems|MUIC 2022 Distributed Data Processing (DDP) (5) MAT 324 -IntroductionOperating Systems|MUIC Steps of booting CPU initialization. BIOS attempts to access the first sector of the HDD(MBR) which is a 512-byte sector is located in the first sector on the disk. The BIOS confirms there are a bootstrap loader/ boot loader in the boot sector then loads it into memory (RAM). BIOs hands over its work to the boot loader, which in turn begins loading the operating system into memory. MAT 324 -IntroductionOperating Systems|MUIC Steps of booting (cont’d) Boot loader turns control of the PC over to the operating system. Then, the OS is ready for user interaction. OS loads device drivers This is the final stage in the boot process, after which the user can access the system’s applications to perform tasks. MAT 324 -IntroductionOperating Systems|MUIC