t s i oto perating systems history & approaches

25
O ti S t O ti S t Operating Systems History & Approaches Operating Systems History & Approaches History & Approaches History & Approaches Jin-Soo Kim ( [email protected]) Jin Soo Kim ( [email protected]) Computer Systems Laboratory Sungkyunkwan University htt // l kk d http://csl.skku.edu

Upload: others

Post on 02-Dec-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

O ti S tO ti S tOperating SystemsHistory & Approaches

Operating SystemsHistory & ApproachesHistory & ApproachesHistory & Approaches

Jin-Soo Kim ([email protected])Jin Soo Kim ([email protected])Computer Systems Laboratory

Sungkyunkwan Universityhtt // l kk dhttp://csl.skku.edu

Pre-Multics Era (1)Pre-Multics Era (1)Pre Multics Era (1)Pre Multics Era (1) OS/360

• A batch processing OS developed by IBM for System/360 mainframe computers (announced in 1964).

• A family of three control programs• A family of three control programs.– The single task PCP (Primary Control Program) processed jobs

sequentially.l i i i h i d b f k dd d– MFT (Multiprogramming with a Fixed number of Tasks) added

multitasking, but only allowed a fixed number of concurrent tasks.– MVF (Multiprogramming with a Variable number of Tasks) allowed

varying numbers of tasks.

• OS/360 introduced IBM’s batch-scripting language JCL (Job Control Language).g g )

• OS/360 was amongst the earliest OS to make direct access storage devices (DASD) a prerequisite for its operation.E l i MFT OS/VS1 MVT OS/VS2 MVS

2ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

• Evolution: MFT OS/VS1, MVT OS/VS2 MVS

Pre-Multics Era (2)Pre-Multics Era (2)Pre Multics Era (2)Pre Multics Era (2) CTSS (Compatible Time-Sharing System)( p g y )

• Developed by MIT in 1961 for the IBM 709.• One of the first time-sharing operating systemsg p g y• “Compatible” with the standard batch processing OS,

the Fortran Monitor System (FMS).– FMS in “background”, and programs compiled for FMS batch

in “foreground” time-sharing environmentUsing virtual machines– Using virtual machines

• The system with the first computerized text formatting utility and inter-user electronic mailformatting utility and inter user electronic mail.

• A facility called RUNCOM for CTSS took a collection of commands contained in a file and executed them.

3ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

o co a ds co ta ed a e a d e ecuted t e .– This is the direct ancestor of the Unix shell script.

Multics (1)Multics (1)Multics (1)Multics (1) Multics

• Multiplexed Information and Computing Service• A time-shared, multi-processor mainframe , p

“computing utility” • Originally started by MIT, GE, and Bell Labs for GE-

645, a 36-bit system, in 1965.– Bell Labs quit in 1969 and built Unix.

GE’ b i i l di M l i k b– GE’s computer business, including Multics, was taken over by Honeywell in 1970.

– Last system shutdown on 10/31/2000.y / /

• http://www.multicians.org

4ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics (2)Multics (2)Multics (2)Multics (2) Multics innovations

• Hierarchical file system.– File / directory / path name / working directory– Access Control Lists (ACLs).– Long names on entries.

M lti l t i– Multiple names on entries.– Symbolic links.– Storage quotasStorage quotas.– Removable devices.– The backup procedures.

• Lots of developments in management of virtual memory including segmentation and paging.

5ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics (3)Multics (3)Multics (3)Multics (3) Multics innovations (cont’d)( )

• Separating the command shell from the OS kernel.• Dynamic linking.y g• Implementation of an OS in a high level language

(PL/1)• Management of shared memory.• Mapping of logical disk volumes onto physical pp g g p y

volumes.• Many developments in the area of secure computer

systems.– Multics was rated B2 by the NCSC in 1985.

A b t t (b d th M lti i ) b ilt

6ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

– A subsequent system (based on the Multics experience) built by Honeywell was the first computer system ever rated A1.

Multics (4)Multics (4)Multics (4)Multics (4) Multics innovations (cont’d)( )

• Multics Relational Data Store (MRDS) in 1976.– The first commercial relational DBMS.– The MRDS query language was similar to early SQL.– Concurrent access to a database by multiple processes was

supportedsupported.– The database could be backed up in its entirety.

• Spreadsheets were developed on the MulticsSpreadsheets were developed on the Multicsplatform.

• Multics supports BCPL, BASIC, APL, FORTRAN, LISP, C, pp , , , , , ,COBOL, ALGOL 68, and Pascal.

• Many optimizations for the LISP language through

7ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

work on the Multics MACLISP compiler.

Unix (1)Unix (1)Unix (1)Unix (1)

“… When BTL (Bell Telephone Laboratories) withdrew from the Multicsproject, they needed to rewrite an operating system in order to play

space war on another smaller machine (a DEC PDP-7 with 4K memory for user programs). The result was a system which a punning colleague

ll d UNICS (UNi l d I f ti d C ti S i )called UNICS (UNiplexed Information and Computing Services) – an ‘emasculated Multics’; no one recalls whose idea the change to UNIX was.”

-- Peter H. Salus, A Quarter Century of Unix, Addision-Wesley, 1994.

“… It was the summer of '69. In fact, my wife went on vacation to my family's place in California.... I allocated a week each to the operating

system, the shell, the editor, and the assembler to reproduce itself, andsystem, the shell, the editor, and the assembler to reproduce itself, and during the month she was gone, it was totally rewritten in a form that

looked like an operating system, with tools that were sort of known, you know, assembler, editor, and shell .... Yeh, essentially one person for a

8ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

, , , , y pmonth.”

-- Ken Thompson

Unix (2)Unix (2)Unix (2)Unix (2) Unix Features

• Hierarchical file systems– Special files: uniform I/O, naming, and protection.

R bl fil t i t/ t– Removable file systems via mount/umount– i-node

• Process controlProcess control– fork(), exec(), wait(), exit()– Pipes for inter-process communication

h ll• Shells– Standard I/O and I/O redirection– FiltersFilters– Command separators– Shell scripts

9ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

• Signals

Unix (3)Unix (3)Unix (3)Unix (3)

10ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics vs. Unix (1)Multics vs. Unix (1)Multics vs. Unix (1)Multics vs. Unix (1) Timingg

• Multics: 1965 – 2000 – The system was made available for general use in 1969.

• Unix: 1969 – Present– Fourth Edition (1973): rewritten in C.– Sixth Edition (1975): available outside of Bell Labs.

Design approach• Multics: Top-down

– Clear goals drive design and primitives.

• Unix: Bottom-up– Primitives define functionality (No predefined goals), while

retaining simplicity and elegance

11ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

retaining simplicity and elegance.

Multics vs. Unix (2)Multics vs. Unix (2)Multics vs. Unix (2)Multics vs. Unix (2) Developmentp

• Multics: – Well-organized:

MIT Project MAC: Design is key strength.Bell Labs: Online update capabilities, robustness, scalabilityGE/Honeywell: Defense contractor, hardware./ y ,

– 3000-page program module specification BEFORE coding.– An unanticipated phase of design iterations was necessary

d t di i b t t l d t ddue to gross discrepancies between actual and expected performance.

» Design, build, evaluate, design, build, evaluate, …g g– $6M / year for five years.– 150 Man-Years for design and system programming, another

50 M Y f i t

12ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

50 Man-Years for improvements.

Multics vs. Unix (3)Multics vs. Unix (3)Multics vs. Unix (3)Multics vs. Unix (3) Development (cont’d)

• Unix: – Two Man-Years.

B ild/d i i d t ti– Build/design mixed at same time.

Target usersTarget users• Multics: military, government agencies, NSA, …• Unix: Universities, research institutions, …Unix: Universities, research institutions, …

Protection• Multics: Protection rings• Unix: All or nothing (superuser model)

13ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics vs. Unix (4)Multics vs. Unix (4)Multics vs. Unix (4)Multics vs. Unix (4) Resource utilization

• Multics:– Memory: 256KWords/box (1 word = 36 bits)– Paging device (Drum): 4MWords– Disk: 136MB

U i• Unix:– Old, unused PDP-7

Occupies 42KBytes on PDP 11/45 with 144KBytes of memory– Occupies 42KBytes on PDP-11/45 with 144KBytes of memory.– PDP-11 has a 1MB disk used for file system storage and

swapping.

14ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics vs. Unix (5)Multics vs. Unix (5)Multics vs. Unix (5)Multics vs. Unix (5) Resource managementg

• Multics:– Multiprocessor support from start.– Transparent multi-level memory model: memory – drum –

diskTrue memory mapped world view– True memory-mapped world view.

• Unix:– Simple 3 segment viewSimple 3 segment view.– Partial memory mapped model later.

15ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Multics vs. Unix (6)Multics vs. Unix (6)Multics vs. Unix (6)Multics vs. Unix (6) Summaryy

• Multics:– Too complicated, too costly hardware.– “Second system effect”

(by Fred Brooks, The Mythical Man-Month)S t f l (CTSS)» System one was successful (CTSS)

» System two aims to correct all flaws from #1» Almost always fails» Almost always fails.

• Unix:– Low cost hardware– University adoption– Simplicity, elegance, and ease of use.

16ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Operating System Structure (1)Operating System Structure (1)Operating System Structure (1)Operating System Structure (1) Monolithic

• “The Big Mess” - a single large software system.• Local procedure calls are used to communicate p

among different components. • Advantages: performance API

• Disadvantages:– Difficult to maintain and upgrade

b f h i d d i

MonolithicKernel

because of the interdependencies in the code.

– Operating system code runs at supervisor level in the same

Hardware

Operating system code runs at supervisor level in the same memory space so that any component of the system could corrupt data being used by other components.

U i S l i AIX HP UX Li t

17ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

• Unixware, Solaris, AIX, HP-UX, Linux, etc.

Operating System Structure (2)Operating System Structure (2)Operating System Structure (2)Operating System Structure (2) Layeredy

• A hierarchy of layers, each one constructed upon the one below it.

• The layered approach is modular; simplifies the extension and maintenance of the code base.

• THE (Dijkstra, 1968): 6 layers

18ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Operating System Structure (3)Operating System Structure (3)Operating System Structure (3)Operating System Structure (3) Layered (cont’d)y ( )

• Multics: 8 rings of protection– The inner ones are more privileged than the outer ones.

(The supervisor runs in ring 0)– Calling a procedure in an inner ring requires a system call,

where the parameters are carefully checked for validitywhere the parameters are carefully checked for validity.– The ring mechanism is present at run time and enforced by

the hardware.» The hardware made it possible to designate individual

procedures (memory segments, actually) as protected against reading, writing, or executing.g g g g

– The ring mechanism can easily be extended to structure user subsystems.

19ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Operating System Structure (4)Operating System Structure (4)Operating System Structure (4)Operating System Structure (4) Microkernel

• Move as much functionality as possible from the kernel into “user” space.

• Communication takes place between user modules using message passing.

– A request for an operating system service from an application is processed by the Client

MemoryServer

TerminalServerapplication is processed by the

microkernel and forwarded to the appropriate server.The ser er handles the req est

process

FileServer

Microkernel

– The server handles the request and passes the results back to the kernel, which forwards h h lli li i

20ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

them to the calling application.

Operating System Structure (5)Operating System Structure (5)Operating System Structure (5)Operating System Structure (5) Microkernel (cont’d)( )

• The Mach kernel only includes:– Thread scheduling– Message passing– Virtual memory

D i d i d– Device driver code

• MicrokernelsMach (CMU) OSF/1 NeXTSTEP IBM OS/2 MkLinux GNU– Mach (CMU) OSF/1, NeXTSTEP, IBM OS/2, MkLinux, GNU Hurd, Microsoft Windows NT/XP, Mac OS X

– Chorus (INRIA, Chorus)– Amoeba (Andrew Tanenbaum @ Vrije Univ.)– QNX

L3/L4 (GMD J h Li dtk @ U i K l h )

21ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

– L3/L4 (GMD, Jochen Liedtke @ Univ. Karlsruhe)

Operating System Structure (6)Operating System Structure (6)Operating System Structure (6)Operating System Structure (6) Microkernel: Benefits

• Extensibility, Reliability, Simplicity, Maintainability, Flexibility– Modular structure (easy to add services)– Easing system design, implementation, and maintenanceg y g p– Failure isolation, enhancing debuggability and validation

(small microkernel can be rigorously tested.)– Coexistence of different APIs, file systems, and OS personalities.y p

• Portability– Changes needed to port the system to a new processor is done in

the microkernel – not in the other services.• Distributed system support

– Transparent access to network services, aiding and encouraging distribution.distribution.

• Object-oriented operating system– Components are objects with clearly defined interfaces that can be

interconnected to form software

22ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

interconnected to form software.

Operating System Structure (7)Operating System Structure (7)Operating System Structure (7)Operating System Structure (7) Linux

• Monolithic kernel + (layered) kernel modules

Kernel extensions

System Calls

Monolithic Linux Kernel

Device driver modulesDevice driver modules

(cf.) Monolithic kernels vs. Microkernels: A debate between Linus Torvalds and Andrew Tanenbaum (1992)

23ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

A debate between Linus Torvalds and Andrew Tanenbaum (1992)http://www.oreilly.com/catalog/opensources/book/appa.html

Operating System Structure (8)Operating System Structure (8)Operating System Structure (8)Operating System Structure (8) Microsoft Windows NT/2000/XP

• Modified microkernels or hybrid kernels– Keep some codes in kernel space to run them more quickly.

24ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])

Operating System Structure (9)Operating System Structure (9)Operating System Structure (9)Operating System Structure (9) Mac OS X

25ECE5658: Operating System Design | Summer 2010 | Jin-Soo Kim ([email protected])