Lecture1 OS
Lecture1 OS
programs.
● Application Programs
● Solve computing problems of users (compilers, database
5
Need of OS
● Let’s suppose you want to add two numbers: c=a+b;
No OS With OS
If you are working on MC6800 hardware then Use any High Level Language like C.
the instructions will be:
• LDAA $80 – Loading the number at memory Write c=a+b;
location 80
• LDAB $81 – Loading the number at memory The underlying hardware does not matter
location 81 because OS takes care of conversion.
• ADDB – Adding these two numbers
• STAA $55 – Storing the sum to memory Infact this is what we always do. Have we ever
location 55 bothered what hardware are we using.
But the moment you hardware changes, for Our focus is just writing the code correctly in C,
example, say to 8086 or 8088, all the above C++, Python etc. 6
instructions will change, a problem!
Need of OS
7
Why should I study Operating Systems?
9
Operating System Views
● Resource allocator
● to allocate resources (software and
hardware) of the computer system
and manage them efficiently.
● Control program
● Controls execution of user
programs and operation of I/O
devices.
● Kernel
● The program that executes forever
(everything else is an application
12
with respect to the kernel).
The OS Shell
● Kernel Components
● File Manager
● Device Drivers
● Memory Manager
● Scheduler
● Dispatcher
The OS Kernel vs Shell
● Kernel is program that represent the central core of a computer
operating system. It controls everything that occurs in the system.
Kernel interacts with the hardware on demand from applications.
● A kernel can be contrasted with a shell (such as bash, csh or ksh in
Unix-like operating systems), which is the outermost part of an
operating system and a program that interacts with user commands. The
kernel itself does not interact directly with the user, but rather interacts
with the shell and other programs as well as with the hardware devices
on the system, including the processor (also called the central processing
unit or CPU), memory and disk drives.
● Because of its critical nature, the kernel code is usually loaded into
a protected area of memory, which prevents it from being overwritten by
other, less frequently used parts of the operating system or by
application programs.
The OS Kernel vs Shell
Shell:
● A shell is a program that provides the traditional,
text-only user interface for Linux and other
Unix-like operating system. The term shell
derives its name from the fact that it is an outer
layer of an operating system.
● Maintains information about the files that are available on the system
● Where files are located in mass storage, their size and type and their
protections, what part of mass storage is available
● This unit is responsible for coordinating the use of the machine’s main
memory.
● Ensures that processes that are ready to run are actually executed
● Time is divided into small (50 ms) segments called a time slice.
● When the time slice is over, the dispatcher allows scheduler to update
process state for each process, then selects the next process to run
OS Summary
24
Hardware Complexity Increases
25
OS needs to keep pace with hardware
improvements
26
Operating System Spectrum: Evolution of OS
Next Week…..
27