course approach
play

Course Approach You will be building your own operating system - PowerPoint PPT Presentation

Course Approach You will be building your own operating system You will do it in steps INF 3150/3160 Operating Systems For each step Well define what your OS should achieve for this step Well provide you with a


  1. Course Approach • You will be building your own operating system • You will do it in steps INF 3150/3160 Operating Systems • For each step – We’ll define what your OS should achieve for this step – We’ll provide you with a starting point (code) • You may well choose to use your own starting point Fall 2003 – You will contemplate a design and present a brief design report indicating design issues, discussions, and decisions. The design report is Tore Larsen presented, discussed, and reviewed by staff Adaptions and additions to notes developed by – You develop and implement your solution. The solution is reviewed etc. Otto J. Anshus • For each step you will sweat • In December you will be ”King of the hill!” People Topics • Carsten Griwodz, Ifi, UiO • Course approach • Pål Halvorsen, Ifi, UiO • Presentation of teachers • Tore Larsen, Ifi, UiTø & UiO • Where do we find operating systems? • Teaching Assistants (TA’s) • What are the basic mechanisms for combining • Faculty currently on sabbatical the operating system and other SW? – Otto J. Anshus, Ifi/UiTø & Ifi/UiO • Why do we study operating systems? – Vera Goebel, Ifi, UiO & UiTø • … and how do we do it? – Thomas Plageman, Ifi, UiO 1

  2. From Tony Hoare’s Biography Is it challenging to write an OS? http://research.microsoft.com/~thoare/ • …He led a team (including his later wife Jill) in the • Yes, but you’ll manage. Employing your own efforts, design and delivery of the first commercial compiler and the assistance of fellow students, TA’s, and for the programming language Algol 60. (1960) professors. • …He then led a larger team on a disastrous project to • Low-level, architecture dependent programming implement an operating system • …His research goal was to understand why operating – We stick with only one architecture in only one systems were so much more difficult than compilers, configuration and to see if advances in programming theory and • Race-conditions languages could help with the problems of concurrency. (Queens Univ. 1968) • Let’s see (next slide) what a great computer scientist experienced some time ago … Where do we find OS’es these days? Game boxes have OS’es? 2

  3. Sidebar Cell-phones have OS’es? Penetration of Microprocessors • Early Nintendo game consoles • Symbian (previous page, early eighties) was the first ever microprocessor-based fad. When Yngvar Lundh (left) • Microsoft witnessed this, he predicted that microprocessors would become as widely applied and as ”invisible” as electrical motors were at that time. • More by Lundh at: – http://www.ifi.uio.no/ansatte/yngv ar.html Cameras have OS’es? Cars have OS’es? • FlashPoint • Car manufacturer – Pentax, Olympus, Sanyo, • Controller vendor Kodak • Software house • Sony? • Microsoft Cameras also have • Real-time software for exposure – Suspension and focus – Engine • Non real-time – Entertainment 3

  4. Big engines have OS’es Set-top boxes have OS’es? …And are getting smaller • Seen in late nineties as possibly controlling gateway into computerized future home • Fierce early competition • Expectations not yet met Observations and Two Questions OS, other programs, and HW • OS’es for many different types of devices • OS and other programs use the hardware – Differing requirements (functionality, footprint, real-time) (processor, memory, input, and output) • Abstractions and many design issues are still shared • How is the OS’s interaction with HW different • Does one size fit all, or is that a silly dream? from any other program? – Rick Rashid (Mach ++) reportedly wanted to see Mach in • Let’s look at some early HW: light switches (which are currently being computerized) 4

  5. Did this machine have an OS? EDSAC • Project led by Maurice Wilkes at Cambridge • Based on design written down by John Von Neumann (Neumann Janos) • First operational Von Neumann machine • Stored program concept • Also – Subroutines – Bootstrap (shadow ROM BIOS) • 31 instructions EDSAC, First operational Von Neuman Computer. Pictured 1949 http://www.dcs.warwick.ac.uk/~edsac/ http://www.cl.cam.ac.uk/UoCCL/misc/EDSAC99 / EDSAC Architecture Proceeding through Instruction Stream • Fetch instruction • When decoding instruction, what to do if bit-pattern • Decode instruction doesn’t represent a (legal) • Fetch operands instruction? • Execute – Halt? No! • Write back result – Instead: Trap: fetch next • Most architectures since have been like this • Next instruction instruction at predetermined address in memory. Make sure • Let’s depart, use the blackboard, and revisit how this that you have placed your OS architecture proceeds, and how it connects with the OS code there beforehand 5

  6. Two Execution Modes How we may proceed • Machine is in ”supervisor” (or similar term) -mode or • OS starting user program privilege level – Load program and initialize – The full instruction set of the processor decodes – Set privilege level ”user” – Load instruction register from start of program • Machine is in ”user” (or similar term) –mode or • User program requesting OS service privilege level – Make a mark ”somewhere” indicating which service is requested – Only a restricted set of instructions decodes, all other – Execute instruction that i bound to trap in decode instructions, typically referred to as ”privileged instructions” are treated as ”illegal,” – decoding them causes a trap to the • Still need mechanism that allows OS to ”preempt” user process, OS OS needs to be activated independently of running program. • Instruction set designer must make sure that ”the right That can only be achieved “external” to the running program’s set” of instructions are privileged. instruction stream. • What about the instruction to set privilege level? How can we activate the OS Sidebar: Interrups, traps, and exceptions independently of the instruction stream? • Interrupt signals, caused by events external to the • Be aware of these terms as they are used processor, are sensed by the processor and causes a inconsistently across the field of computing trap similar to what happens when decoding an ”illegal” instruction • Ask yourself • OS must make sure that interrupts happen. When they – Are we talking about events internal to the do, OS will be activated and may do whatever we want it to processor, generated synchronously with the • Interrupts are ensured by requesting recurring wake-up instruction execution stream signals from a ”timer” external to the processor – Or is it an external event, generated asynchronously • Lots of finesse has to be added, but these are some of with the processor, and the basic mechanisms 6

  7. Sidebar (cont.): Interrups, traps, and What Is an Operating System? exceptions • Ask further • Extension of hardware – Is occurence of the event to to be handled by the OS • Virtual machine interface and physical machine interface – …Or by user supplied code • Coordinate between applications and hardware resources • For numerical computations it may well be wise to let (concurrency, device drivers, memory, file system and user programs specify how some possibly probelematic networking) events are handled • Standard services (library, window system) – You may want to check William Kahans assault on Java for • What if you don't have an OS? source code -> compiler -> en entertaing and enlightening intro to some of the object code -> hardware numerical issues. • What if you run an application at a time? Early DOS, Libraries, • http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf device drivers, interrupt handler, No overlapping Approaches to Teaching Operating Why Study Operating Systems Systems • Understand how computers work under the hood • Paper – “You need to understand the system at all abstraction levels or you don’t” (Yale Patt, private communications) • Smaller exercises using existing operating systems – “The devil is in the details” (Unknown) • Modifications to exisiting systems • Magic to provide infinite CPUs, memory, devices, and – Emulator networked computing. • NachOS • Tradeoffs between performance and functionality, – ”Metal”, bare machine division of labor between HW and SW • Unix, Linux • Combine language, hardware, data structures, • Minix algorithms, money, art, luck, and hate/love • Roll your own • And operating systems are key components in many systems 7

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend