0% found this document useful (0 votes)
34 views

Introduction To OS by ANANDHAN.K

The document discusses the history and evolution of operating systems from early vacuum tube-based mainframes that used plugboards and batch processing (generations 1-2), to the introduction of timesharing on transistor-based mainframes allowing multiprogramming (generation 3). It then covers the rise of personal computers (generation 4) and how operating systems now support multicore processors and distributed systems (generations 5-7). The key functions of an operating system are to provide an abstraction of the underlying hardware and manage sharing of resources like memory and processors.

Uploaded by

Itech Anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Introduction To OS by ANANDHAN.K

The document discusses the history and evolution of operating systems from early vacuum tube-based mainframes that used plugboards and batch processing (generations 1-2), to the introduction of timesharing on transistor-based mainframes allowing multiprogramming (generation 3). It then covers the rise of personal computers (generation 4) and how operating systems now support multicore processors and distributed systems (generations 5-7). The key functions of an operating system are to provide an abstraction of the underlying hardware and manage sharing of resources like memory and processors.

Uploaded by

Itech Anand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 49

OPERATING SYSTEMS

Unit-1

OPERATING SYSTEMS
OVERVIEW
The Modern Computer System

Figure 1.1 A computer system consists of hardware,


system programs, and application programs.
What Is an Operating System?
Two basic functions of the OS:
• Extended machine or virtual machine
– Easier to program than the underlying
hardware
• Resource manager
Shares resources in time and space
User interface to OS is what we see,
But really it is just another program….
Operating System Generations
(Tannenbaum – H/W)
• Generation 1 (1945 – 55)
Vacuum tubes and plugboards
• Generation 2 (1955 – 65)
Transistors and batch systems
• Generation 3 (1965 – 80)
ICs and multiprogramming
• Generation 4 (1980 – Present)
Personal computers
• (My gen 5 – multicore systems +
pervasive computing)
Remmington Rand 409 (Univac)

Program is in plugboard!!!
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
IBM 650

card sorter (L) reader/punch (C), computer (R)


Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
IBM 650

front panel (L) drum (B), tubes (TL)


Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Vacuum Tube (IBM 650)

IBM 650 announced1953, sold until1962


Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Sperry-Univac AN-UYK/20

Program from toggle switches on front panel


Note 64K of core memory (bottom half)
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Operating System Generations
(Silberschatz and others – S/W)
• Generation 1 (50’s on)
Resident Monitor – user = operator
Single application program at a time
• Generation 2 (late 50’s – 60’s)
Batch systems – user not operator, JCL
2a – uniprogrammed batch
2b – multiprogrammed batch
• Generation 3 (1960’s on)
Timesharing systems Did they improved productivity?
• Generation 4 (1980 – Present)
Personal computers – user = operator
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Operating System Generations
(Silberschatz and others – S/W)
• Generation 5 (1980 – present)
Network Operating Systems
Remote commands, interoperability key
• Generation 6 (late 80’s – present)
Distributed Operating Systems
Transparency key – homogenous systems
• Generation 7 (1990’s on)
Cooperative Autonomous Systems –
independent systems – integration key
Resource discovery, negotiation, etc.
e.g., Service Oriented Architectures
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Resident Monitor
• Users reserved time on machine (hour scale)
If not done when time up, too bad – try again later
• Useful to have a user interface and RM to allow you to
– Read program and data in from card reader, tape drive, etc.;
– Run program
– Print results
• Also had utility programs
– Compiler
– Linker
– Loader
– Editor
• Also had libraries
Sets of convenient procedures reused often
– Math functions
– Print formatting
– I/O access
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Early Batch System (1)

Figure 1-2. An early batch system. (a) Programmers bring


cards to 1401. (b)1401 reads batch of jobs onto tape.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Early Batch System (2)

Figure 1-2. An early batch system. (c) Operator carries input


tape to 7094. (d) 7094 does computing.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Early Batch System (3)

Figure 1-2. An early batch system. (e) Operator carries output


tape to 1401. (f) 1401 prints output.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Early Batch System (4)

Figure 1-3. Structure of a typical FMS job.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Uniprogrammed Batch System

User
Program
Fence register
Operating
System/RM

Uniprogramming – single process runs at a time


Protect OS/RM using fence register & test vs. address
Uniprogrammed Batch System

Job 1 Job 2 … Job N


OS OS OS

time

While there is another job


Read control card for
next job
Load job
Run job
Uniprogrammed Batch System
I/O
CPU-bound job
CPU
activit

CPU burst I/O burst


I/O
y

I/O-bound job
CPU
time

I/O-bound jobs underutilize CPU


Even CPU-bound jobs use little CPU when doing I/O
Desirable to overlap CPU use of one job with I/O of other job(s)
Multiprogramming

Figure 1-4. A multiprogramming system


with three jobs in memory.
Multiprogrammed Batch System
I/O-3
CPU-3
activit

I/O-2
CPU-2
I/O-1
CPU-1
OS
time
Doing I/O
Has CPU
Waiting for CPU or event (3 channels)
Processes

Figure 1-5. A process tree. Process A created two child


processes, B and C. Process B created three child
processes, D, E, and F.
How to create a child process?
Where does the first process come from?
File Systems (1)

Figure 1-6. A file system for a university department.


File Systems (2)

Figure 1-7.
(a) Before mounting, the files on drive 0 are not accessible.
(b) After mounting, they are part of the file hierarchy.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
File Systems (3)

Figure 1-8. Two processes connected by a pipe.


What is a pipe, anyway?
Not that kind of pipe!
A pipe is a character stream – one process can
write to it, the other one reads from it.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls (1)
Process Management

Figure 1-9. The MINIX system calls. pid is process ID;


statloc and status return exit status; name is filename; argv is
argument list; envp is environment pointer.
System Calls (2)
Signals

Figure 1-9. The MINIX system calls. sig is signal number, act and
oldact are procedures, how says what to do, old allows old
signal mask to be remembered.
System Calls (3)
File Management

Figure 1-9. The MINIX system calls. fd is a file descriptor; mode determines
access mode; nbytes is a byte count; buf holds status info.
System Calls (4)

Directory & File System Mgmt.

Figure 1-9. The MINIX system calls. s is return status;


namex, dirname, and special are file/directory names; mode is
protection mode.
System Calls (5)
Protection

Figure 1-9. The MINIX system calls. name is file/directory name;


mode is protection mode, complmode is its inverse; uid and
owner are user ID; gid and group are group ID.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls (6)

Time Management

Figure 1-9. The MINIX system calls. tp and timep are pointers to
time variable; file is filename.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
The fork Call in the Shell

Figure 1-10. A stripped-down shell. Throughout this book, TRUE


is assumed to be defined as 1.
Processes

Activation Stack and


frames with data grow
non-persistent and shrink
variables
Persistent
variables,
Instructions
constants

Figure 1-11. Processes have three segments: text, data, and


stack. In this example, all three are in one address space, but
separate instruction and data space is also supported.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Used stack space Processes
Free stack space
Free heap space Return from first
secondprocedure
procedure
Used heap space Call another procedure
a procedure
Activation Stack and
frames with data grow
non-persistent and shrink
variables Allocate another var
Allocate
Free a avariable
variable Persistent
variables,
Instructions
constants
A process uses up space in data segment as objects are
allocated, must increase space if none left.
A process grows the stack as procedures/methods are called,
shrinks it as they return.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for File Management (1)

Figure 1-12. The structure used to return information for the stat
and fstat system calls. In the actual code, symbolic names
are used for some of the types.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
I/O Redirection
In the shell:
$ cat - < file.txt | grep foo | sort > silly.txt

The '<' character redirects input to come from a file


The '|' characters indicate pipes
The '>' character redirects the output to a file

cat with the '-' option reads from stdin, and by default it writes to
stdout. Both grep and sort read from stdin and write to stdout
(cin and cout in C++)

Pipes allow linking a sequence of operations together without


having to make temporary files between each step

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for File Management (2)

NB: need two file descriptors – read (0) and write (1)

Figure 1-13. First part of a skeleton for setting up a two-process


pipeline.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for File Management (3)
Frees slot 0 in PFT

… Copies read end of pipe to slot 0 in PFT

Figure 1-13. Last part of a skeleton for setting up a two-process


pipeline.
Now when process1 writes to STDOUT, it appends to pipe
And when process2 reads from STDIN, it dequeues from pipe
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for Directory Management (1)

i-node number file name

link(“/usr/jim/memo”,”/usr/ast/note”);

Figure 1-14. (a) Two directories before linking /usr/jim/memo to


ast’s directory. (b) The same directories after linking.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
System Calls for Directory Management (2)

mount(“/dev/cdrom0”,”/mnt”,0);

Figure 1-15. (a) File system before the mount.


(b) File system after the mount.
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Operating System Structure

Figure 1-16. The 11 steps in making the system call


read(fd, buffer, nbytes).
Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Basic Structure for Operating
System
1. A main program that invokes the
requested service procedure
2. A set of service procedures that
carry out the system calls
3. A set of utility procedures that help
the service procedures

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Layered Systems (1)

Figure 1-17. A simple structuring model for a monolithic system.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Layered Systems (2)

Figure 1-18. Structure of the THE operating system.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Virtual Machines

Figure 1-19. The structure of VM/370 with CMS.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Client-Server Model (1)

Figure 1-20. The client-server model.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Client-Server Model (2)

Figure 1-21. The client-server model in a distributed system.

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Client-Server Model (3)

wait
Server for
request
reply reply

reque
st
reque
st

wait
for
Client wait reply

time

Client-server synchronous communication

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8
Summary

1. OS definition(s) and functions


2. OS history, functionalities
3. OS components
4. System calls
5. OS Architectures

Tanenbaum & Woodhull, Operating Systems: Design and Implementation, (c) 2006 Prentice-Hall, Inc. All rights reserved. 0-13-142938-8

You might also like