Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
COMP25111: Operating Systems Before we start: (and before you read the rest of this handout) What do you think each of these means? “Computer Architecture” Instruction Set Architecture = instructions, registers ... also internal major components & flow of information “System” Something complex, with lots of components & interactions between them “System Software” S/W you need to build & run an App. e.g. OS, compiler, PDE, shell, window-manager, library, DBM “Operating System (OS)” e.g. Linux, Windows, Android, ... The most fundamental piece of S/W between user and silicon COMP25111 Lecture 1 1/46 COMP25111: Operating Systems Lecture 1: Introduction John Gurd School of Computer Science, University of Manchester Autumn 2012 COMP25111 Lecture 1 2/46 Overview & Learning Outcomes Course-unit objectives Course-unit organisation Context Coda: Summary, (Exam) Questions, Your Questions, Glossary, Reading COMP25111 Lecture 1 3/46 Computer Architecture theme “Computer Architecture involves the selection and interconnection of hardware components to create computers that meet functional, performance and cost goals.” “As a result, the development of effective computer architectures is a central part of technology development, and an understanding of the capabilities of architectures is important for developers of higher-level systems.” COMP25111 Lecture 1 Objectives 5/46 Course-unit Aims/Outcomes Principles of operating system design & implementation techniques – overall structure & functionality – interactions with H/W & Apps – “managers”: process, memory, I/O-device, file & 1st 2 in labs Concurrent nature of operating system activities. Illustrate using two concrete examples (Linux, Windows) ?not formally assessed except to illustrate answers to exam Qs Take more control of your own learning Be flexible, keep an open mind, etc... Engineering, not an exact science Basic science skills are essential (e.g simple arithmetic) COMP25111 Lecture 1 Objectives 7/46 Contents Computer Architecture: ISA, Fetch-Execute, (Datapath, Control) Introduction to OS: purpose, concepts, entities, functions Processes: Creation, Scheduling, Termination, Communication, Synchronisation, Java Threads Memory: Basic concepts, Contiguous storage allocation, Single- & multi-programming, Segmentation, Paging Input/Output Device: Polling, Interrupts. File Systems: Directory organization, File types & organization Case Studies: MS Windows, Linux COMP25111 Lecture 1 Objectives 9/46 Why Study Operating Systems? To understand what is really happens in a computer computer system behaviour depends on OS A case study of how to cope with complexity abstraction, modularity, iteration constraints, optimisations, ... unreasonable (or infinite) demands, ... imperfections, trade-offs, ... Useful algorithms, techniques, concepts (e.g. Concurrency) deadlock, synchronisation Part of leading edge of CS Dynamic area of research: distributed systems, web-based systems, embedded systems, ... COMP25111 Lecture 1 Objectives 11/46 Module Organisation John Gurd: [email protected] (start and end) Richard Neville: [email protected] (middle, and non-151) http://www.cs.manchester.ac.uk/ugt/COMP25111/ QandA: http://qanda.cs.man.ac.uk/ Blackboard (notices, handouts, labs, revision etc.) 2 lectures per week attend, make notes, try questions, ... (lecture notes will contain essential information) COMP25111 Lecture 1 Organisation 14/46 Textbooks Silberschatz et al. - Operating System Concepts / with Java (8th ed) (many earlier editions: more recent ok but avoid older) Tanenbaum - Modern Operating Systems (3rd ed) (or 2nd?) COMP25111 Lecture 1 Read an OS book abundance of books and material; try different sources Organisation 16/46 Lab Ex 1: MU0 Computer Architecture (1 lab session) Ex 2: Process Scheduler (Java - 2 lab sessions) Ex 3: Paging Simulation (Java - 2 lab sessions) make sure your Java skills are up-to-date (details on website & Blackboard) 1 lab session per fortnight (starts week 3) & a marking session (semester 2 week 1) Start before scheduled session Get help during session Submit by midnight after session Get marked next session COMP25111 Lecture 1 Organisation 18/46 MU0 Computer Architecture: lectures 2 & 3, lab 1 Those who took COMP15111 (or equivalent): – processor design with me (1.1) Those who did not take COMP15111: – low-level programming & execution with Richard (IT407) Lab introduced in lectures (done in normal lab groups & rooms) COMP25111 Lecture 1 Organisation 20/46 Definition: System “A complex whole; a set of connected parts; an organized assembly of resources and procedures united and regulated by interaction or interdependence to accomplish a set of specific functions.” COMP25111 Lecture 1 Context 23/46 Definition: Operating System Intermediary between User/Program & Computer Hardware Goals: – run user programs – make the hardware convenient to use – use the hardware efficiently COMP25111 Lecture 1 Context 25/46 An OS can be viewed as ... The software that is always loaded/running A Resource Manager bottom-up resources include: CPU, memory, disk, network, devices OS determines how these resources will be used, allows sharing, protection, fairness, ... A Virtual Machine top-down provides an abstraction of a larger or different machine e.g., virtual memory A Service Provider ?unifies views e.g., access to a unique supercomputer COMP25111 Lecture 1 Context 27/46 Resources that need Managing COMP25111 Lecture 1 Context 29/46 Technology “I think there is a world market for maybe 5 computers” (1943) “There is no reason anyone would want a computer in their home” (1977) CPU power growth rate? 35% pa Disk capacity/$ growth rate? 50% pa Memory chip capacity growth rate? 60% pa Transistors/integrated circuit? (cf Moore’s law) 4004/2K (1971), 286/120K (1982), Pentium/3M (1993), P4/42M COMP25111 Lecture 1 Context 31/46 Q when I was your age, 2MFLOPS cost L1M, & L1M then is L10M now If a computer has a 3GHz clock: – how far can an electronic signal go in 1 clock cycle? <10cm – how many clock cycles while a 7200 rpm hard disk rotates 360 degrees? 7200/60 = 120rps; 3 ∗ 109 /120 = 25 ∗ 106 cycles – how many clock cycles between characters typed quickly on a keyboard? e.g.60words/minute ≈ 6ch/s = .5 ∗ 109 cycles How long is 106 seconds? >11.5 days i.e. CPU waiting for disk is like us waiting for months How long is 109 seconds? >31.7 years i.e. CPU waiting for keyboard is like us waiting for decades COMP25111 Lecture 1 Context 32/46 OS evolution – In those days, giants walked the land At first: 1 user, 1 program, 1 computer (no OS) until the mid 50s – An expensive commodity submit program, run, collect results Computers rare & expensive → improve utilisation Batch OS: run a series of programs, one-at-a-time Do 3 things at once: input progn+1 & run progn & output progn−1 In what order? - multiprogramming if a process waits, run another Time-sharing: multi-user on-line access – decentralisation COMP25111 Lecture 1 Context 34/46 OS Drivers Multiple users/programs, so need: – (efficient) sharing of resources – protection Changing objectives: Capacity → Features → Ease of use Technology: - memories & peripherals get bigger and more complex so take more looking after - CPUs get faster but memories & peripherals haven’t kept up so harder to keep CPU busy COMP25111 Lecture 1 Context 36/46 OS Diversity Multiprocessor (parallel computing) OS many CPUs in one system Distributed OS e.g. data migration=NFS, RPC, process migration Real-time OS: must respond within deadline – “hard” real-time: failure if system doesn’t respond on time or plane crashes – “soft” real-time: missing some deadline is acceptable e.g. audio/video glitch Embedded OS e.g. portable devices PC OS e.g. MS-DOS COMP25111 Lecture 1 Context 38/46 Summary of key points Objectives: Theme, Aims/Outcomes, Contents, Motivation Organisation: Staff, Web, Lectures, Labs, Books Context: Definitions, Views, Evolution, Drivers, Diversity OSs provide Services = Interface to Managed Resources – Sharing – Protection – Concurrency Goal: Efficient & Convenient use of Hardware Next Lecture: Remember to split COMP25111 Lecture 1 Coda 40/46 Your Questions Write down your questions – things you missed, things you didn’t quite understand, things you disagree with, or just things you would like to know more about. Try and answer them yourself, or with friends, or ask me (e.g. via email or http://qanda.cs.man.ac.uk/ or in a lab, or just before the next lecture starts) COMP25111 Lecture 1 Coda 41/46 For next time Exam questions – try them for next lecture (after split) A complete OS may contain managers for devices, network, filestore, memory, & processes. Which of these would you expect to be present in an OS for: – A process control computer with a sensor for monitoring, an actuator for control, and a network connection for reporting to and receiving commands from a control centre? – A dedicated, network-based filing machine or ”file server”? – A computer dedicated to controlling the communications passing between two networks; that is, a ”gateway”? – An autonomous lap-top personal computer? – A single-user workstation with services available across a network? – A machine dedicated to managing and answering queries on a database? COMP25111 Lecture 1 Coda 42/46 Exam Questions More exam questions – try them whenever you want One reason GUIs were initially slow to be adopted was the cost of the hardware needed to support them. – How much video RAM is needed to support a 25 line * 80 row character monochrome text screen? – How much for a 1024 * 768 pixel 24-bit color bitmap? – What was the cost of this RAM at 1980 prices ($5/KB)? – How much is it now? [MOS, ex.7, Ch.1] COMP25111 Lecture 1 Coda 43/46 Exam Questions ctd. How many clock-cycles happen on a 3GHz processor – in a millisecond? – during an Ethernet network transfer of 512 bytes at 100 Mbits/sec? – during a typical transfer of 1k bytes to a disk with a 10 ms seek time, 7200 rpm rotation speed, and a transfer rate of 300 Mbytes/sec? – sending a packet to a computer in New Zealand and waiting for the reply? (the radius of the earth is approx 7800 km, the speed of light is approx 3x108 m/s, New Zealand is approximately opposite England on the Earth’s surface) For each of your answers, how long is that many seconds? COMP25111 Lecture 1 Coda 44/46 Glossary More possible exam questions: “Define ...” or “Briefly explain ...” Computer hardware (H/W): Computer software (S/W): Computer architecture: Input-output (I/O) device: System software: Operating System (OS): Computer clock: A clock cycle: Hz: k, M, G, T: m, µ, n: COMP25111 Lecture 1 Coda 45/46 Reading MOS-2: §1.1, 1.2, 1.3 (pages 1-20) MOS-3: §1.1, 1.2, 1.4 OSC/J: §1.1, 1.2, 1.3, 1.11, 1.12 http://www.intel.com/technology/mooreslaw/index.htm COMP25111 Lecture 1 Coda 46/46