Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction r Instructor: Dr Hanan Lutfiyya m Office: MC 418 m Email: hanan at csd dot uwo ca m Office Hours: Drop-by or by appointment.

Similar presentations


Presentation on theme: "Introduction r Instructor: Dr Hanan Lutfiyya m Office: MC 418 m Email: hanan at csd dot uwo ca m Office Hours: Drop-by or by appointment."— Presentation transcript:

1

2 Introduction

3 r Instructor: Dr Hanan Lutfiyya m Office: MC 418 m Email: hanan at csd dot uwo ca m Office Hours: Drop-by or by appointment

4 Course Overview r Course is about what lies under the command line prompts in Linux or the GUI in Windows/MAC. r We will discuss: m How are operating systems organized? m Process scheduling m Process coordination m Memory management m File systems m “hot topics” (time permitting)

5 Course Overview r Evaluation m 1 midterm, 1 final m 4 assignments r There is a heavy programming component based on C language r Grading is results based i.e., a good deal of the evaluating is based on an “acceptance test”.

6 FAQ r Why not use Java? Other universities do. m Java is NOT suitable for operating systems m Operating systems are written in C and assembly m Other universities that use JAVA are being wimps r How proficient do I need to be in C? m Pointers, casting r How heavy is workload? m The assignments do not necessarily involve a lot of coding m However, you will have to read and understand a lot of code

7 What is an Operating System? r System programs: m Generally execute in user mode. m Command interpreter (shell), compilers, editors, …..

8 What is an Operating System? r The software layer between user applications and hardware r Provides an abstraction for hardware by an interface to the hardware r Hides the messy details which must be performed

9 What is an Operating System? r Manages the hardware resources m Each program gets time with the resource m Each program gets space on the resource r May have potentially conflicting goals: m Use hardware efficiently (e.g., maximize throughput) m Give maximum performance to each user (e.g., minimize response time)

10 Why Study Operating Systems? r I probably will not write one from scratch r Haven’t OS developers figured out everything out already? What more is there to do?

11 Why Study Operating Systems? r I have been writing Java (or C or Python) programs and I didn’t need to know anything about how the OS works r All I need to know are the commands I should submit to the OS to get my program to run or to store my data in a file.

12 Why Study Operating Systems? r Understanding how operating systems manage CPU, memory can help you be a better programmer. r Example m Structuring a loop m Web servers

13 OS and Loops Consider the following code segments: int data[128][128]; for (j = 0; j <128; j++) for (i = 0; i < 128;i++) data[i,j] = 0; Does it matter which you use? int data[128][128]; for (i = 0; i <128; j++) for (j = 0; j < 128;i++) data[i,j] = 0;

14 OS and Loops r Reasoning for answering NO? The code segments execute the same number of instructions. r The correct answer: Yes it does matter m One will give you much faster results. m The reason has to do with the way the OS manages its memory

15 OS and Request Processing r Application: Withdraw money from a bank account r Two requests for withdrawal from the same account comes to a bank from two different ATMS r A thread for each request is created m A thread is a unit of execution m The same program (on the next page is executed)

16 OS and Request Processing int withdraw(account, amount) { balance = get_balance(account); balance = balance – amount; put_balance(account, balance) return balance } What happens if both requests request that $1000 be withdrawn from the same account? Assume that the account currently has $1000

17 OS and Request Processing r Both threads will read a balance of $1000 r Both threads will allow for $1000 to be withdrawn balance = get_balance(account) balance = balance – amount 1; balance=get_balance(account); balance = balance – amount; put_balance(account,balance) put_balance(account,balance); Execution sequence ss seen by CPU Thread 1 Thread 2 Thread 1 Context switch

18 Why Study Operating Systems? r You may object to this example: m Why are two requests taking turns using the CPU? m A request comes in, should get executed before the next request r If you did this it would very slow r Why? Well you have to wait until you learn more about operating systems

19 Why Study Operating Systems? r The example just presented is an example of concurrency r Concurrency lead to interesting programming challenges that were first addressed in operating systems r Today the ability to understand concurrency is important in developing efficient software applications for today’s multi-core machines

20 Why Study Operating Systems? r Also.... r The OS code is really large (Windows 7, Windows Vista is 50 million lines+, MAC OS is 80 millions lines+) m Thus the study of OS design is a study of the design of large software systems r Understanding operating systems gives you a leg up in understanding system security

21 Why Study Operating Systems? r Ok – I’m still never going to write one from scratch. r Probably true r But.. Operating systems gives you insight into other areas of computer science m Data structures, concurrency, synchronization, resource management, distributed systems, networks

22 Why Study Operating Systems? r Aren’t operating systems well-understood? r There isn’t much left to think about r Response: Absolutely NOT. r There are many challenges left e.g., m Parallel computing/programming with multicore m Mobile embedded devices e.g., iPhone, Blackberry

23 Challenge: Parallel Computing and Clusters r Many scientific applications want to use many CPUs at once m Need OS and language primitives for dividing program into parallel activities m Need OS primitives for fast communication between

24 Challenge: Mobile and Embedded Devices r Tiny computers everywhere – ubiquitous computing m Processor cost low enough to embed in many devices PDAs, cell phones r Very different hardware capabilities m Slow processors m Small amount of memory m Various wireless networks

25 Why Study Operating Systems? r Ok once we address these challenges then there isn’t much. r All I can say is that people have been making statements like this since the 1950’s. m They are wrong r Hence I’ll end this section with a brief history.

26 Operating System Timeline r First generation: 1945 – 1955 m Vacuum tubes m Plug boards r Second generation: 1955 – 1965 m Transistors m Batch systems r Third generation: 1965 – 1980 m Integrated circuits m Multiprogramming r Fourth generation: 1980 – present m Large scale integration m Personal computers r Next generation: ??? m Systems connected by high-speed networks? m Wide area resource management?

27 First Generation (1945-1955): Direct Input r Run one job at a time m Enter it into the computer (might require rewiring) m Run it m Record the results r Programming languages were unheard of r Assembly languages were not known r No reason for an OS Eniac, 1945

28 A Famous Quote r "I think there is a world market for maybe five computers." m Thomas Watson, Chairman of IBM - 1943

29 Second Generation (1955-1965): Batch Systems r Programs were written on paper in either FORTRAN or assembly r This then was put on punched cards r The card deck was taken down to the input room and handed to one of the operators r Programmer would come back later for results IBM 7094/1401

30 Second Generation (1955- 1965): Batch Systems r The programmer is waiting for this: m Bring cards to 1401 m Read cards onto input tape m Put input tape on 7094 m Perform the computation, writing results to output tape m Put output tape on 1401, which prints output

31 Programs on Punched Card Z(1) = Y + X(1) //Fortran statement

32 Spooling r Eventually tape drives were replaced with disks r Disks enabled simultaneous peripheral operation on-line (spooling) m Computer overlapped entering punched cards to disk of one job with execution of another m Still only one job active at any given time m CPU often underutilized Example: What if the job needs data from the disk?

33 OS/360 r A first example of an OS for this generation is IBM’s OS/360 r Considered a landmark operating systems

34 Other Famous Quotes r "I have traveled the length and breadth of this country and talked with the best people, and I can assure you that data processing is a fad that won't last out the year.“ m The editor in charge of business books for Prentice Hall – 1957 r “ But what is it good for“ m IBM engineer talking about the transistor

35 Third Generation: Multiprogramming (1965-1980) r Multiple jobs in memory m Protected from one another r Operating system protected from each job as well r Overlap I/O of one job with computing from another job

36 Third Generation: Multiprogramming (1965-1980) r Multiprogramming allowed several jobs to be active at one time r Computer use got much cheaper and easier r These developments allowed for interactive use

37 Yet Another Quote r “There is no reason anyone would want a computer in their home.“ m Ken Olson, president, chairman and founder of Digital Equipment Corp. - 1977

38 Fourth Generation (1980-) Personal Computers r Personal computing changed the computing industry r Intel came out with the 8080 in 1974 r Lots of companies produced complete systems r The Control Program for Microcomputers (CP/M) from Digital Research was used Altair 8080, 1975 256 bytes of memory Enter data through one of toggle switches on the front Results were indicated by flashing lights on the front panel

39 Fourth Generation (1980-) Personal Computers r Motorola produced an 8-bit microprocessor, the 6800. r Group of Motorola engineers left to form a new company to manufacture the 6502 after Motorola rejected it r CPU used in early systems including Apple I

40 Apple 1 Ad

41 Fourth Generation (1980-) Personal Computers r Now came the 16-bit systems with Intel’s 8086 r IBM designed the IBM PC around the 8088 (an 8086 on the inside with an 8 bit external data path) r IBM needed an OS for their PCs; CP/M behind schedule r Who did they turn to? IBM PC, 1981 Retailed at $2880 64 kilobytes of RAM Single-sided 160K 5.25 floppy drive

42 Famous Quote “We don't see Windows as a long-term graphical interface for the masses.” –A Lotus Software Development official, while demonstrating a new DOS version - 1989

43 Fourth Generation (1980-) Personal Computers r Bill Gates suggested to IBM that they should look at CP/M (one of the the most successful OS for microcomputers at that time, by Gary Kildall) r The biggest mistake of all: m Kindall refused to sign a non-disclosure agreement

44 Fourth Generation (1980-) Personal Computers r IBM went back to Bill Gates r Gates offered an OS called DOS r DOS came from a company called Microsoft r Microsoft hired Bill Gates to improve it r The new OS was renamed MS-DOS

45 Fourth Generation (1980-) Personal Computers r Up to this point all operating systems were command line r Doug Englehart at Stanford invented the Graphical User Interface (GUI)

46 Fourth Generation (1980-) Personal Computers r Steve Jobs saw the possibility of a user- friendly PC r This led to the Apple Macintosh in 1984 Steve Jobs is also the co- founder of Pixar which has created very successful animated films: Toy Story ; A Bug's Life; Toy Story 2; Finding Nemo; Monsters.

47 Fourth Generation (1980-) Personal Computers r Used Motorola’s 16-bit 68000 r 64 KB of ROM r Of course it had the first GUI r BTW, Apple only started using Intel processors in 2006

48 What about UNIX? r Let’s go back to the 60’s r MULTICS was the first large timesharing system developed jointly between MIT, General Electric (computing division eventually sold to Honeywell) and Bell Labs r MULTICS introduced many seminal ideas r But,…. OS was written in a language called PL/1 r Not a lot of these got sold but they were very popular with those who bought r Last one was put out of commission in 2000 m It was owned by the Canadian Department of National Defence

49 MULTICS

50 What about UNIX? r One of the computer scientists at Bell Labs who worked on MULTICS was Ken Thompson r He found a small PDP-7 minicomputer that no one was using r He decided to write a stripped-down, one-user version of MULTICS in the C programming language r This became UNIX. r This was open source which led to other versions: System V (AT&T) and BSD (Berkeley Software Distribution)

51 What about MINIX? r Eventually AT&T realized that UNIX was commercially viable r Unix, Version 7’s license prohibited the source code from being studied in courses r A computer scientist, Andrew Tanenbaum, was appalled r He created a new OS (using the C programming language) from scratch that would be compatible with UNIX but completely different on the inside r This was MINIX or mini-Unix; released in 1987 r Better structured then UNIX r MINIX-2 released in 1997 r MINIX-3 released in 2006

52 MINIX-3 r Minix-3: about 30,000 lines r Other operating systems (source is http://en.wikipedia.org/wiki/Lines_of_code) : m Vista: 50 million Windows 7 is probably 50 million+ m Mac OS X 10.4: 86 million m Linux kernel 2.6.32: 12.6 million r We may use Minix-3 in at least one assignment

53 LINUX r After MINIX was released a USENET newsgroup (think of this as a chatroom), comp.os.minix was formed. r Quickly had 40,000 subscribers who wanted to add stuff r One was a Finnish student named Linus Torvalds

54 LINUX r Torvalds wanted to add features which led to other things r Eventually this led to his own OS called Linux (August 1991) r Linux is a notable success of the open source movement

55 Mobile Operating Systems r The “newest” operating systems are for mobile devices (smartphones). m Symbian OS m Windows Mobile m Palm OS m Google’s Android (based on Linux) 2007 Earlier this year there were more phones with Android then iOS m BlackBerry OS m iOS (Apple’s OS) 2007 Originally for iPhone; Now used on iPad

56 Next Generation? r What do you think will constitute the next generation of operating systems? r Do you think we will be able to interact with systems in a more “natural way” e.g., voice input?

57 Summary r We have discussed what is an operating system r We have shown examples of why you should want to know more r We have looked at a brief history of operating systems r Now it is time to learn more about the insides of an operating system


Download ppt "Introduction r Instructor: Dr Hanan Lutfiyya m Office: MC 418 m Email: hanan at csd dot uwo ca m Office Hours: Drop-by or by appointment."

Similar presentations


Ads by Google