Está en la página 1de 84

Introduction to Operating Systems

The very basics

Prashant Borole
Department of Computer Science IIT Bombay

Prabhat, August 29, 2009

prashantb (IITB)

Intro. to OS

prabhat09

1 / 21

What is an operating System?

What do you do on your computer?

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?

What do you do on your computer? Check e-mail

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?

What do you do on your computer? Check e-mail Browse the Internet, Chatting

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?

What do you do on your computer? Check e-mail Browse the Internet, Chatting Play music/movies

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?

What do you do on your computer? Check e-mail Browse the Internet, Chatting Play music/movies Create reports, presentations

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?

What do you do on your computer? Check e-mail Browse the Internet, Chatting Play music/movies Create reports, presentations Play Games

prashantb (IITB)

Intro. to OS

prabhat09

2 / 21

What is an operating System?


Functions

Schematic of a computer

Hides underlying hardware Provides consistent environment for programs to run in Resource management

prashantb (IITB)

Intro. to OS

prabhat09

3 / 21

What is an operating System?


Functions

Schematic of a computer

Hides underlying hardware Provides consistent environment for programs to run in Resource management

prashantb (IITB)

Intro. to OS

prabhat09

3 / 21

What is an operating System?


Functions

Schematic of a computer

Hides underlying hardware Provides consistent environment for programs to run in Resource management

prashantb (IITB)

Intro. to OS

prabhat09

3 / 21

What is an operating System?


Functions

Schematic of a computer

Hides underlying hardware Provides consistent environment for programs to run in Resource management

prashantb (IITB)

Intro. to OS

prabhat09

3 / 21

Operating systems are almost everywhere !

Supercomputers desktop/laptops mobile phones iPod ...

prashantb (IITB)

Intro. to OS

prabhat09

4 / 21

Operating systems are almost everywhere !

Supercomputers desktop/laptops mobile phones iPod ...

prashantb (IITB)

Intro. to OS

prabhat09

4 / 21

Operating systems are almost everywhere !


Supercomputers desktop/laptops mobile phones iPod ... Established operating systems . . . Microsoft DOS and Windows GNU Linux UNIX Other UNIX derivatives - FreeBSD, OpenSolaris etc. Other . . .

prashantb (IITB)

Intro. to OS

prabhat09

4 / 21

Operating systems are almost everywhere !


Supercomputers desktop/laptops mobile phones iPod ... Established operating systems . . . Microsoft DOS and Windows GNU Linux UNIX Other UNIX derivatives - FreeBSD, OpenSolaris etc. Other . . .

prashantb (IITB)

Intro. to OS

prabhat09

4 / 21

Components
Legend

A Typical PC

2 = Mother Board 3 = Processor/CPU 4 = RAM 5 = Expansion Cards 7 = CD-ROM drive 8 = Hard disc drive

Source : Wikipedia

prashantb (IITB)

Intro. to OS

prabhat09

5 / 21

Operational requirements

You can run multiple programs simultaneously

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

You can run multiple programs simultaneously You can use any keyboard

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

You can run multiple programs simultaneously You can use any keyboard Run same program on different computers

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

You can run multiple programs simultaneously You can use any keyboard Run same program on different computers Copy between drives, either xed or USB pen-drive

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

Process management
You can run multiple programs simultaneously You can use any keyboard Run same program on different computers Copy between drives, either xed or USB pen-drive

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

Process management
You can run multiple programs simultaneously

Abstraction
You can use any keyboard Run same program on different computers Copy between drives, either xed or USB pen-drive

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

Operational requirements

Process management
You can run multiple programs simultaneously

Abstraction
You can use any keyboard Run same program on different computers

Input-Output (I/O) management


Copy between drives, either xed or USB pen-drive

prashantb (IITB)

Intro. to OS

prabhat09

6 / 21

A Process?

Running a program executing the program A Process = When the executable le is running Process is
Sequence of instructions to the CPU (Central Processing Unit) Area for data storage

prashantb (IITB)

Intro. to OS

prabhat09

7 / 21

A Process?

Running a program executing the program A Process = When the executable le is running Process is
Sequence of instructions to the CPU (Central Processing Unit) Area for data storage

prashantb (IITB)

Intro. to OS

prabhat09

7 / 21

A Process?

Running a program executing the program A Process = When the executable le is running Process is
Sequence of instructions to the CPU (Central Processing Unit) Area for data storage

prashantb (IITB)

Intro. to OS

prabhat09

7 / 21

A Process?

Running a program executing the program A Process = When the executable le is running Process is
Sequence of instructions to the CPU (Central Processing Unit) Area for data storage

prashantb (IITB)

Intro. to OS

prabhat09

7 / 21

A Process?

Running a program executing the program A Process = When the executable le is running Process is
Sequence of instructions to the CPU (Central Processing Unit) Area for data storage

prashantb (IITB)

Intro. to OS

prabhat09

7 / 21

Multiple processes

Process

Process

Process

Process

Scheduler

C P U

prashantb (IITB)

Intro. to OS

prabhat09

8 / 21

Process states

prashantb (IITB)

Intro. to OS

prabhat09

9 / 21

Memory Hierarchy

Hard disk drive, CD-ROM drive etc.


Slow, Huge Cost/Megabyte very low Persistent

A Typical PC

Random Access Memory (RAM)


Fast (avg 3-5GBps), Few Gigabytes Cost/Megabyte moderate, getting cheaper Volatile

Processor cache
Extremely fast (avg 20GBps), Few Kilobytes Cost/Megabyte extremely high Volatile

Source : Wikipedia

prashantb (IITB)

Intro. to OS

prabhat09

10 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

Swapping

RAM

prashantb (IITB)

Intro. to OS

prabhat09

11 / 21

File Systems

File : Block of arbitrary data/information Similar to : How do you manage storage in a library such that
Locating a book is fast, easy Least space is wasted

Well known le-systems


Microsoft FAT16/32 NTFS (NT le system) ext2/3/4 ZFS, xfs, UFS1/2, jfs, ReiserFS . . .

prashantb (IITB)

Intro. to OS

prabhat09

12 / 21

File Systems

File : Block of arbitrary data/information Similar to : How do you manage storage in a library such that
Locating a book is fast, easy Least space is wasted

Well known le-systems


Microsoft FAT16/32 NTFS (NT le system) ext2/3/4 ZFS, xfs, UFS1/2, jfs, ReiserFS . . .

prashantb (IITB)

Intro. to OS

prabhat09

12 / 21

Why let operating system manage I/O?

Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Why let operating system manage I/O?

Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Why let operating system manage I/O?

Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Why let operating system manage I/O?


Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution

Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Why let operating system manage I/O?

Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Why let operating system manage I/O?

Abstraction : Consistent access for all programs, across machines Arbitration / Conict resolution Easy software development Security

prashantb (IITB)

Intro. to OS

prabhat09

13 / 21

Device drivers

Sequence of instructions Programmed for a particular piece of hardware Helps higher-level programs to talk with hardware Operating System specic

prashantb (IITB)

Intro. to OS

prabhat09

14 / 21

Device drivers

Sequence of instructions Programmed for a particular piece of hardware Helps higher-level programs to talk with hardware Operating System specic

prashantb (IITB)

Intro. to OS

prabhat09

14 / 21

Device drivers

Sequence of instructions Programmed for a particular piece of hardware Helps higher-level programs to talk with hardware Operating System specic

prashantb (IITB)

Intro. to OS

prabhat09

14 / 21

Device drivers

Sequence of instructions Programmed for a particular piece of hardware Helps higher-level programs to talk with hardware Operating System specic

prashantb (IITB)

Intro. to OS

prabhat09

14 / 21

Device drivers

Sequence of instructions Programmed for a particular piece of hardware Helps higher-level programs to talk with hardware Operating System specic

prashantb (IITB)

Intro. to OS

prabhat09

14 / 21

I/O Requests

prashantb (IITB)

Intro. to OS

prabhat09

15 / 21

Security
Each entity in the system
Well dened set of operations Dene who can perform what operation

If all rules above are obeyed, system is more secure :) Types of Users
Super User / Administrator
Has (almost) full control over the system Not recommended for day-to-day use

Normal User
Has some usage restrictions eg. Sensitive les and directories, operating with devices, Software installation Recommended for casual day-to-day use

Restricted user
Even tighter restrictions eg. guest accounts

prashantb (IITB)

Intro. to OS

prabhat09

16 / 21

Security
Each entity in the system
Well dened set of operations Dene who can perform what operation

If all rules above are obeyed, system is more secure :) Types of Users
Super User / Administrator
Has (almost) full control over the system Not recommended for day-to-day use

Normal User
Has some usage restrictions eg. Sensitive les and directories, operating with devices, Software installation Recommended for casual day-to-day use

Restricted user
Even tighter restrictions eg. guest accounts

prashantb (IITB)

Intro. to OS

prabhat09

16 / 21

Security
Each entity in the system
Well dened set of operations Dene who can perform what operation

If all rules above are obeyed, system is more secure :) Types of Users
Super User / Administrator
Has (almost) full control over the system Not recommended for day-to-day use

Normal User
Has some usage restrictions eg. Sensitive les and directories, operating with devices, Software installation Recommended for casual day-to-day use

Restricted user
Even tighter restrictions eg. guest accounts

prashantb (IITB)

Intro. to OS

prabhat09

16 / 21

Security
Each entity in the system
Well dened set of operations Dene who can perform what operation

If all rules above are obeyed, system is more secure :) Types of Users
Super User / Administrator
Has (almost) full control over the system Not recommended for day-to-day use

Normal User
Has some usage restrictions eg. Sensitive les and directories, operating with devices, Software installation Recommended for casual day-to-day use

Restricted user
Even tighter restrictions eg. guest accounts

prashantb (IITB)

Intro. to OS

prabhat09

16 / 21

Security
Each entity in the system
Well dened set of operations Dene who can perform what operation

If all rules above are obeyed, system is more secure :) Types of Users
Super User / Administrator
Has (almost) full control over the system Not recommended for day-to-day use

Normal User
Has some usage restrictions eg. Sensitive les and directories, operating with devices, Software installation Recommended for casual day-to-day use

Restricted user
Even tighter restrictions eg. guest accounts

prashantb (IITB)

Intro. to OS

prabhat09

16 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...

prashantb (IITB)

Intro. to OS

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...

prashantb (IITB)

Intro. to OS

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

. . .
Source : OpenClipart

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS prabhat09 17 / 21

. . .
Source : OpenClipart

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS

. . .
Source : OpenClipart

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS

. . .
Source : OpenClipart

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS
Lorem Ipsum
This album is by somebody.

Lorem Ipsum

Ipsum Lorem

. . .
Source : OpenClipart

.ydobemos yb si mubla sihT

muspI meroL

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...
prashantb (IITB) Intro. to OS
Lorem Ipsum
This album is by somebody.

Lorem Ipsum

Ipsum Lorem

. . .
Source : OpenClipart

.ydobemos yb si mubla sihT

muspI meroL

prabhat09

17 / 21

Linux

A popular UNIX-clone Absolutely Free !! No less usable !! The Linux kernel Rest of the system Highly portable and congurable
Servers, Super Computers Desktop/Laptop Mobile phones Router iPod and others A toaster !! ...

Lorem Ipsum
This album is by somebody.

Lorem Ipsum

Ipsum Lorem

. . .
Source : OpenClipart

prashantb (IITB)

Intro. to OS

.ydobemos yb si mubla sihT

muspI meroL

prabhat09

17 / 21

Linux

Linux comes with Console and GUI based shells


Many customizable User Interfaces to choose from

Networking : Web browsers, chatting clients, Torrent and P2P softwares Ofce suite Multimedia Players : vlc, mplayer, totem Very reliable le systems - ext3/ext4, jfs . . .

prashantb (IITB)

Intro. to OS

prabhat09

18 / 21

Linux

Linux comes with Console and GUI based shells


Many customizable User Interfaces to choose from

Networking : Web browsers, chatting clients, Torrent and P2P softwares Ofce suite Multimedia Players : vlc, mplayer, totem Very reliable le systems - ext3/ext4, jfs . . .

prashantb (IITB)

Intro. to OS

prabhat09

18 / 21

Linux

Linux comes with Console and GUI based shells


Many customizable User Interfaces to choose from

Networking : Web browsers, chatting clients, Torrent and P2P softwares Ofce suite Multimedia Players : vlc, mplayer, totem Very reliable le systems - ext3/ext4, jfs . . .

prashantb (IITB)

Intro. to OS

prabhat09

18 / 21

Linux

Linux comes with Console and GUI based shells


Many customizable User Interfaces to choose from

Networking : Web browsers, chatting clients, Torrent and P2P softwares Ofce suite Multimedia Players : vlc, mplayer, totem Very reliable le systems - ext3/ext4, jfs . . .

prashantb (IITB)

Intro. to OS

prabhat09

18 / 21

Linux

Linux comes with Console and GUI based shells


Many customizable User Interfaces to choose from

Networking : Web browsers, chatting clients, Torrent and P2P softwares Ofce suite Multimedia Players : vlc, mplayer, totem Very reliable le systems - ext3/ext4, jfs . . .

prashantb (IITB)

Intro. to OS

prabhat09

18 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave Games

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave Games

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave Games . . . Whoops !

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave ...

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave ...

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave ...

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Linux
Lives happily with other Operating Systems! Runs many tools of Academic use
Programming Environments : Eclipse, NetBeans . . . Electronic circuit design and simulation Mathematics : matlab, SciLab, Octave ...

Has a huge user base, helpful communities Secure fun !!

prashantb (IITB)

Intro. to OS

prabhat09

19 / 21

Thanks!!

prashantb (IITB)

Intro. to OS

prabhat09

20 / 21

For Further Reading I

Maurice J. Bach The Design Of The Unix Operating System. A.Silberschatz, P.Galvin, G.Gagne Operating System Concepts. http://www.wikipedia.org

prashantb (IITB)

Intro. to OS

prabhat09

21 / 21

También podría gustarte