CS 149 Operating Systems January 22 Class Meeting

  • Slides: 38
Download presentation
CS 149: Operating Systems January 22 Class Meeting Department of Computer Science San Jose

CS 149: Operating Systems January 22 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak www. cs. sjsu. edu/~mak

Basic Info o Office hours n n o Tu. Th 7: 30 - 8:

Basic Info o Office hours n n o Tu. Th 7: 30 - 8: 30 PM MH 413 Class website n n http: //www. cs. sjsu. edu/~mak/ Green sheet Assignments Lecture notes Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 2

Project Teams o Assignments will be done by small project teams. o Form your

Project Teams o Assignments will be done by small project teams. o Form your own teams of 3 or 4 members each. o Choose your team members wisely! n n Be sure you’ll be able to meet and communicate with each other and work together well. No moving from team to team. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 3

Project Teams, cont’d o Each team member will receive the same score on each

Project Teams, cont’d o Each team member will receive the same score on each team assignment and team project. o Each team email to ron. mak@sjsu. edu by Monday, January 26: n n o Your team name A list of team members and email addresses Subject: CS 149 -n Team Name n n Where n is your section number (2, 3, or 8) Example: CS 149 -3 Team Super Coders Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 4

Individual Responsibilities You are personally responsible for participating and contributing to your team’s work,

Individual Responsibilities You are personally responsible for participating and contributing to your team’s work, and for understanding each part of the work for every assignment whether or not you worked on that part. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 5

Postmortem Assessment Report o At the end of the semester, each student will individually

Postmortem Assessment Report o At the end of the semester, each student will individually turn in a short (one page) report: n A brief description of what you learned in the course. n An assessment of your personal accomplishments for your project team. n An assessment of each of your project team members. _ Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 6

Your Individual Overall Class Grade o 65% assignments (team scores) 15% midterm exam (individual

Your Individual Overall Class Grade o 65% assignments (team scores) 15% midterm exam (individual score) 20% final exam (individual score) o Final letter grade based on the class curve. o o Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 7

Participation is Important o Can move your final grade up or down, especially in

Participation is Important o Can move your final grade up or down, especially in borderline cases. o Participation in class. Participation in your team. o n As reported by the postmortem assessment reports. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 8

Take roll! Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems ©

Take roll! Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 9

What is an Operating System? o The layer of “system software” between the machine

What is an Operating System? o The layer of “system software” between the machine hardware and the application programs. Operating Systems: Design and Implementation Tanenbaum & Woodhull (c) 2006 Prentice-Hall, Inc. All rights reserved. 0 -13 -142938 -8 Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 10

Why Study Operating Systems? o Become a better programmer. n n o Become a

Why Study Operating Systems? o Become a better programmer. n n o Become a power computer user. n n o Your applications can make better use of the underlying system. Be a systems programmer. Understand how to invoke OS services at the command line. Be able to write shell scripts. Become a better computer designer. n Understand hardware and software tradeoffs. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 11

Purpose of an Operating System o An extended machine or virtual machine n o

Purpose of an Operating System o An extended machine or virtual machine n o Easier to use and program than the underlying hardware. A resource manager n Programs share resources in time and space. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 12

What Resources Does an OS Manage? o CPUs n o Main memory n o

What Resources Does an OS Manage? o CPUs n o Main memory n o n disk management file management I/O devices n o memory management Data storage n o process management I/O management Networking, virtualization, security, etc. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 13

Abstractions o An operating systems provides abstractions of the computer system. o Abstractions are

Abstractions o An operating systems provides abstractions of the computer system. o Abstractions are useful for computer users and for software developers. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 14

Abstractions, cont’d o CPU multiple processes n o Physical memory virtual memory n o

Abstractions, cont’d o CPU multiple processes n o Physical memory virtual memory n o Process: A program that is running locally or remotely. Processes can simultaneously occupy more memory than is physically available. Disk storage files n Don’t worry about allocating space on disk drives that are local or on a network server. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 15

UNIX as an Example OS o In this class, we will use UNIX as

UNIX as an Example OS o In this class, we will use UNIX as an example operating system. o We will write system calls using the C language. o Install Debian Linux on your PC or Mac as a virtual machine. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 16

Virtual. Box (PC and Mac) o Challenging to set up, but very powerful. n

Virtual. Box (PC and Mac) o Challenging to set up, but very powerful. n n Free software from Oracle: https: //www. virtualbox. org/ Latest version is 4. 3. 20 o o Download the Debian ISO file. n n Debian Linux distro: http: //www. debian. org/distrib/ Latest version is 7. 8. 0 Download "small installation image" which is a. iso file. ISO: optical disk image: a. iso file Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 17

Virtual. Box (PC and Mac), cont’d o Load the Debian ISO file into Virtual.

Virtual. Box (PC and Mac), cont’d o Load the Debian ISO file into Virtual. Box to create a Debian virtual machine (VM). n n o You can run multiple VMs simultaneously, each with a different operating system. Subject to your disk and memory limitations. Also install Virtual. Box “guest additions” o n Allows you to mount a shared folder that is accessible by both Installation demo the VM and the host machine. next Tuesday. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 18

Operating System Generations o Generation 1 (1945 – 55) n o Generation 2 (1955

Operating System Generations o Generation 1 (1945 – 55) n o Generation 2 (1955 – 65) n o Transistors and batch systems Generation 3 (1965 – 80) n o Vacuum tubes and plugboards ICs and multiprogramming Generation 4 (1980 – Present) n Personal and mobile computers _ Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 19

Historical Perspective o Early batch computer systems a) Programmers bring punched cards to the

Historical Perspective o Early batch computer systems a) Programmers bring punched cards to the IBM 1401 computer system. b) The 1401 reads a batch of jobs onto tape. Operating Systems: Design and Implementation Tanenbaum & Woodhull (c) 2006 Prentice-Hall, Inc. All rights reserved. 0 -13 -142938 -8 Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 20

Historical Perspective, cont’d o Early batch computer systems c) d) A computer operator carries

Historical Perspective, cont’d o Early batch computer systems c) d) A computer operator carries the input tape to a “large scale” IBM 7094. The 7094 does the computing. Operating Systems: Design and Implementation Tanenbaum & Woodhull (c) 2006 Prentice-Hall, Inc. All rights reserved. 0 -13 -142938 -8 Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 21

Historical Perspective, cont’d o Early batch computer systems e) f) The operator carries the

Historical Perspective, cont’d o Early batch computer systems e) f) The operator carries the output tape to the IBM 1401. The 1401 prints output. Operating Systems: Design and Implementation Tanenbaum & Woodhull (c) 2006 Prentice-Hall, Inc. All rights reserved. 0 -13 -142938 -8 Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 22

What was the IBM 1401? o A “small scale” computer system developed by IBM

What was the IBM 1401? o A “small scale” computer system developed by IBM in the late 1950 s. 1402 Card Read Punch Computer Science Dept. Spring 2015: January 22 1407 Console 1401 CPU CS 149: Operating Systems © R. Mak 729 Tape Drive 1403 Line Printer 23

Computing Before the IBM 1401 o Business data processing involved applications that manipulated data

Computing Before the IBM 1401 o Business data processing involved applications that manipulated data records: n n n Inventory Billing and receivables Payroll Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 24

Computing Before the IBM 1401 o Data was stored in punched cards called “IBM

Computing Before the IBM 1401 o Data was stored in punched cards called “IBM cards” or “Hollerith cards” n Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak Named after Herman Hollerith. o 80 columns per card, one character per column. o Up to 12 punched holes per column. o Alphanumeric data, often grouped into fields. 25

Computing Before the IBM 1401 o A data processing application involved passing decks of

Computing Before the IBM 1401 o A data processing application involved passing decks of punched cards through electromechanical “unit record” machines. o Repetitive sort, calculate, collate, and tabulate operations. . . n . . . were programmed with hand-wired plugboard control panels. _ Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 26

Plugboard Control Panel IBM 407 Accounting Machine (1949) Computer Science Dept. Spring 2015: January

Plugboard Control Panel IBM 407 Accounting Machine (1949) Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 27

Programming a Plugboard o “Programming” was hand-wiring plugboards. “Hmm, should I pass this parameter

Programming a Plugboard o “Programming” was hand-wiring plugboards. “Hmm, should I pass this parameter by value or by reference? ” Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 28

Data Processing Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems ©

Data Processing Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 29

Data Processing Computer Science Dept. Spring 2015: January 22 o Cards were punched manually

Data Processing Computer Science Dept. Spring 2015: January 22 o Cards were punched manually at a keypunch machine. o Or they were punched automatically by unit-record equipment under program control. CS 149: Operating Systems © R. Mak 30

Running a Data Processing Application. . . o . . . meant passing decks

Running a Data Processing Application. . . o . . . meant passing decks of cards through a sequence of unit-record machines. n Each machine was programmed via its plugboard to perform its task for the application. n Each machine had little or no memory. n The punched cards stored the data records n The data records moved as the cards moved. An entire work culture evolved around punched cards! Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 31

A Data Processing Job o A typical “job”. Operating Systems: Design and Implementation Tanenbaum

A Data Processing Job o A typical “job”. Operating Systems: Design and Implementation Tanenbaum & Woodhull (c) 2006 Prentice-Hall, Inc. All rights reserved. 0 -13 -142938 -8 Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 32

A Data Processing Program o Data processing was all about punched cards. o My

A Data Processing Program o Data processing was all about punched cards. o My school compiler project: n n Computer Science Dept. Spring 2015: January 22 3½ boxes of punched cards Each box = 2000 cards, 10 lbs. CS 149: Operating Systems © R. Mak 33

The IBM 1401 Computer System o Memory was a limited resource. n The main

The IBM 1401 Computer System o Memory was a limited resource. n The main CPU unit contained up to 4 K characters of core memory (1 character = 8 bits). n You could add the IBM 1406 memory unit which contained up to 12 K of additional memory n Maximum memory was 16 K. K = 1000 In the 1401, each core bit cost 60¢ ($3/bit in today’s dollars). Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 34

The IBM 1401 Computer System o The 1401 computer system had amazing peripherals (I/O

The IBM 1401 Computer System o The 1401 computer system had amazing peripherals (I/O devices). n n 1403 Line Printer 1402 Card Reader Punch 729 Magnetic Tape Drives Disk drives became available later. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 35

The 1401 Architecture o 11. 5 microsecond clock cycle n n o Add two

The 1401 Architecture o 11. 5 microsecond clock cycle n n o Add two decimal digits in one cycle, or Move one character between memory and a peripheral 87 KHz n n Today’s 4 GHz PC can add two 20 -digit numbers about 1 million times faster than a 1401. A single laptop computer today has more computing power than all the 1401 systems ever installed. Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 36

How the 1401 Transformed Data Processing o It was cheap enough for small businesses.

How the 1401 Transformed Data Processing o It was cheap enough for small businesses. o Programs were stored in main memory. n No more plugboards! o Transferred data from punched cards to magnetic tape and disk. o Customers could program their own machines. n n Autocoder assembly language. “High level” languages: o FORTRAN, COBOL, RPG Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 37

The 1401 Had No Operating System! o Only one program ran at a time.

The 1401 Had No Operating System! o Only one program ran at a time. n o The program had full control of the machine. Programmers had to know how to code instructions to read and write the I/O devices. n Example: The read instruction read the contents of the next card from the card reader into memory locations 101 -180. n Example: The print instruction printed whatever was in memory locations 201 -332 to the next line of the line printer. The card reader and line printer were directly connected to the CPU Computer Science Dept. Spring 2015: January 22 CS 149: Operating Systems © R. Mak 38