cs341 Lecture Notes Spring 2002 Week 1, Monday For next time: 1) Read Section 1.1 of Nutt. 2) Fill in the preparation section at the end of these notes. 3) Read the pages I hand out from The Little Book of Semaphores and write a solution, to be handed in, to the puzzle at the end of the section. 4) Make sure that you can log into your puma account, or get help from me if you can't. 5) Get two three-ring binders, one for lecture notes and one for The Little Book of Semaphores. Outline ------- 1) What is an operating system? 2) What is this class about? Nutt Section 1.1 ---------------- This book is about issues that arise in the design of operating systems. 1) you understand how it works 2) you are a better (or at least empathetic) user 3) you are a better designer 4) you might be on the implementation side some day (maybe an OS, or maybe a library that provides services) Nutt distinguishes Application software from System software 1) Application software solves a specific problem. 2) System software provides general programming environment. 3) OS is a subset of the system software. What does the OS part of the system software do? 1) provide basic functions, usually in the form of a library of functions (methods) that can be invoked (called) from application programs Examples: input/output, math, graphics, GUI, database, system configuration 2) provide resource abstraction Resources are things like CPU time, memory, disk space, access to the network, space on the screen... The OS hides low-level details while providing abstract services Example #1: disk abstraction abstract: open, write, close concrete: find and allocated free block(s), make sure disk is spinning, move read/write head, wait for allocated track to spin under head, write data, verify write, update journal Multiple similar devices can be hidden under the same abstraction (floppy disk, zip disk, cdrom, hard disk) 3) protect users from each other (or processes from each other) OS is like a government (or maybe the police) Protect the rights of each individual, prevent individuals from infringing each other's rights. 4) facilitate sharing Allow users to work together (example: read each other's files). Allow processes to work together (example: share memory) (4) is frequently in conflict with (3) Case Study ---------- DOJ vs. Microsoft Microsoft entered into a consent agreement with the DOJ saying that they would not use their power in the OS market to leverage themselves into the application market. Specifically, they agreed not to bundle applications (like MS Office) with Windows. Later, they started bundling Internet Explorer, a web browser, with Windows. The DOJ took them to court for violating the consent decree. Their defense: 1) lots of things that used to be third-party software, like a disk defragmenter, are now bundled with the OS 2) a browser is part of the OS, not an application Needless to say, the case was in court for a long time. In class exercise: Read Nutt, page 2, first paragraph of Section 1.1 and write a response to the following questions. According to Nutt's definitions of application and system software, is a browser an application or an example of system software? Do you think Nutt's definitions are correct and sufficient to resolve the MS case? Are their other criteria you can suggest to distinguish an application from a part of the OS? What is this class about? ------------------------- Four parallel threads: 1) Operating system design issues. Readings in Nutt and some written exercises. 2) Synchronization. Readings in The Little Book of Semaphores and written exercises. 3) Experimental design. Roughly weekly homeworks and written lab reports. 4) System programming in C. Programming problems that are part of the weekly homeworks. An an organizational issue, it will be challenging to keep track of everything you have to do. I will try to help by putting a to-do list at the top of the lecture notes. The Linux Lab ------------- There are roughly 26 computers in the CS department that run Linux, which is an implementation of UNIX. As of last semester, the departmental server was a machine named nike running HPUX. This January, we replaced it with puma, which runs Linux. For a while, both machines are running. Eventually, we will retire nike. At the same time, we added some machines to the Linux lab and upgraded others. The old machines were named after Greek islands. The ones that remain are crete, santorini, rhodes, druantia, kefalonia The new machines are named after lions, tigers and bears: lynx, jaguar, tiger, ocelot, leopard, lion, grizzly, teddy, panda, polar, koala A few of these machines still use nike as their server, but most now use puma. All of you should have accounts on puma. If not, we will take care of that real soon now. You can log into puma and any of the puma hosts using telnet. Or you can sit down in front of the machines in the Linux Lab. Before next time, you should go to the Linux Lab and try the following: 1) log in by typing your username and password you should get a text prompt that tells your your name, the machine's name, and the directory you are in. For example: [downey@rocky ~/cs341] 2) to start the desktop environment, type startx KDE may ask you what to do with your old KDE configuration. If you never changed your KDE configuration, you might as well discard the old one. Otherwise, you might want to convert it. You should see a graphical desktop with a toolbar at the bottom. 3) Hit the shell icon to create a text window (called a shell) where you can type and execute UNIX commands. 4) In the shell window, type a few UNIX commands like pwd (to print the current directory) ls (to print the contents of the directory) If you don't know any other UNIX commands, don't worry about it for now. We'll get there! 5) Click on the KDE icon in the lower left and select logout from the menu. KDE will ask if you really want to log out. You do. You should end up back at the text prompt. WARNING: at this point you are still logged in!!! 6) Type logout at the text prompt to actually log out. Any problems? Come see me or send me email. Preparation for next time ------------------------- Read Nutt, pages 21--25, and write answers in your notes for the following questions: 1) What is the relationship of Linux to UNIX? What is the relationship of UNIX to POSIX? What is the relationship of Linux to POSIX? 2) What are the ways that the original UNIX was intended to be different from previous operating systems? Do recent UNIXes satisfy the original goals? 3) What does it mean to say that Linux is an open operating system?