Docsity

Lecture Notes on Operating Systems, Lecture notes of Operating Systems

Partial preview of the text

Download Lecture Notes on Operating Systems and more Lecture notes Operating Systems in PDF only on Docsity!

Lecture Notes on Operating Systems

Lecture 1 : Introduction to Operating Systems

  • An operating system is a program that acts as an

intermediary between a user of a computer and the

computer hardware.

  • The purpose of an operating system is to provide an

environment in which a user can execute programs.

The primary goal of an operating system is thus to

make the computer system convenient to use.

  • A secondary goal is to use the computer hardware in

an efficient manner.

Objectives of Operating Systems

  • To hide details of hardware by creating abstraction.
  • To allocate resources to processes (Manage

resources).

  • Provide a pleasant and effective user interface.
  • The 1960 's - Third Generation The systems of the 1960 's were also batch processing systems, but they were able to take better advantage of the computer's resources by running several jobs at once.
  • Fourth Generation With the development of LSI (Large Scale Integration) circuits, chips, operating system entered in the personal computer and the workstation age. Microprocessor technology evolved to the point that it becomes possible to build desktop computers as powerful as the mainframes of the 1970 s.

History of Operating Systems

Lecture 2 : Operating Systems Structure

  • System Components
  • Operating Systems Services
  • System Calls and System Programs

System Components

  • Main-Memory Management Main-Memory is a large array of words or bytes. Each word or byte has its own address. Main memory is a repository of quickly accessible data shared by the CPU and I/O devices. The major activities of an operating system in regard to memory-management are:
  • Keep track of which part of memory are currently being used and by whom.
  • Decide which processes are loaded into memory when memory space becomes available.
  • Allocate and deallocate memory space as needed.

System Components

  • File Management

A file is a collected of related information defined by its

creator. Computer can store files on the disk (secondary

storage), which provide long term storage.

  • The creation and deletion of files.
  • The creation and deletion of directions.
  • The support of primitives for manipulating files and directions.
  • The mapping of files onto secondary storage.
  • The backup of files on stable storage media.

System Components

  • Networking A distributed system is a collection of processors that do not share memory, peripheral devices, or a clock. The processors communicate with one another through communication lines called network.
  • Protection System Protection refers to mechanism for controlling the access of programs, processes, or users to the resources defined by a computer system.
  • Command Interpreter System A command interpreter is an interface of the operating system with the user. The user gives commands with are executed by operating system (usually by turning them into system calls).

Operating Systems Services

  • Program Execution The system must be able to load a program into memory and to run it. The program must be able to end its execution, either normally or abnormally (indicating error).
  • I/O Operations A running program may require I/O. This I/O may involve a file or an I/O device.
  • File System Manipulation The output of a program may need to be written into new files or input taken from some files. The operating system provides this service.
  • Error Detection An error is one part of the system may cause malfunctioning of the complete system. To avoid such a situation the operating system constantly monitors the system for detecting the errors.

Lecture 3 : Process Management

  • The operating system is responsible for the following activities in connection with process management: the creation and deletion of both user and system processes; the scheduling of processes; and the provision of mechanisms for synchronization, communication, and deadlock handling for processes. Process, on the other hand, includes:
  • Current value of Program Counter (PC)
  • Contents of the processors registers
  • Value of the variables
  • The processes stack (SP) which typically contains temporary data such as subroutine parameter, return address, and temporary variables.
  • A data section that contains global variables.
  • โ€ข ProcessProcess StateState

As a process executes, it changes state. The state of a

process is defined in part by the current activity of that

process. Each process may be in one of the following states:

  • New State: The process being created.
  • Running State: A process is said to be running if it has the CPU, that is, process actually using the CPU at that particular instant.
  • Blocked (or waiting) State: A process is said to be blocked if it is waiting for some event to happen such that as an I/O completion before it can proceed. Note that a process is unable to run until some external event happens.
  • Ready State: A process is said to be ready if it is waiting to be assigned to a processor.
  • Terminated state: The process has finished execution.
  • Process Control Block
  • Each process is represented in the operating system by a

process control block PCS)โ€”also called a task control block.

Process state process number program counter Registers memory limits list of open files . . Figure : Process control block.

Lecture 4 : CPU Scheduling

  • CPU scheduling is the basis of multiprogrammed operating

systems. By switching the CPU among processes, the operating

system can make the computer more productive.

  • Basic Concepts

The idea of multiprogramming is relatively simple. A

process is executed until it must wait, typically for the

completion of some I/O request. In a simple computer system,

the CPU would then just sit idle.

Scheduling is a fundamental operating-system function.

Almost all computer resources are scheduled before use.