Lecture 1 - Introduction

It's a Unix system. I know this. - Ariana Richards as Lex Murphy, Jurassic Park


Welcome to CS 432!

The course is about, well, Operating Systems.

Agenda

Syllabus and Course Ground Rules

Please read the syllabus carefully. If there are questions, ask!

What is an Operating System?

Possible definition: "a program that acts as an intermediary between a user of a computer and the computer hardware."

It is a low-level program, which talks directly to computer hardware on behalf of user programs. The operating system kernel is the program that stays running on the computer at all times. The kernel decides what user programs can do and when they can do it.

What is this hardware? Depends... Could be a small single-user PC, could be a minicomputer, mainframe, supercomputer. One or more CPUs, main memory, disk resources, and I/O devices. Could even be something smaller - an embedded system or a PDA.

Much of operating system theory focuses on large, multiprogramming systems - multiple users, multiple programs, time share.

Goals/Functions of an OS:

  • facilitate use of hardware by user programs (convenience, efficiency, flexibility)
  • allocate resources (CPU, memory, I/O, file storage)
  • enforce security (controlled access to files, hardware resources, authentication)
  • These goals are often competing!

    One might say that the OS Brings order from Chaos.

    The definition of the user depends. It may be a user program, which is the user of the resources of the computer as managed by the operating system, or the user of the computer, who runs those programs.

    Many additional programs, often lumped in as part of the "operating system" such as utility programs, editors, office suites, etc., are not part of the kernel. They may or may not be part of the "operating system" depending on how you define it.

    Common Operating System Components. Many of these involve all three of the goals/functions we listed.

  • Process Management "process" is a program in execution. OS responsible for creation, deletion, scheduling, communication
  • Main-memory Management allocation, protection
  • File Management creation, deletion, directory structures, mapping files to hardware
  • I/O System Management device driver interface, buffering
  • Secondary Storage Management free space management, storage allocation, disk scheduling
  • Networking another device to manage - high-speed information flow
  • Protection System specification and enforcement of access controls
  • Command-interpreter - think UNIX command line or MS-DOS prompt. Deals with all of the above. Really, a windowing system is just a way to issue the same commands without knowing what they are.
  • Examples of Operating Systems

    There is a wide variety out there... We will look in detail at some Unix variants and see examples from others.

    Some History

  • Very Early Systems

    One user at a time. Everyone involved is an expert. Sign up for a block of time to go program the computer (possibly involving plugboards) and run the program.

  • Early Mainframe/Batch Systems

    One job in the system at a time. A "batch process" is a non-interactive process. You set everything up beforehand, it runs, you get your output.

    System memory:

    Card Reader (input) --> Memory/CPU (computation) --> Line Printer (output)

    Big problem here - card readers and line printers are slow - what is this expensive CPU doing while the card reader is loading a program or while the output is being printed? It's idle. Not good.

    When disks provided direct-access, the operating system of batch computers was able to use the faster disk (in relation to the card readers and printers anyway) to spool upcoming jobs and output. (Spool means Simultaneous Peripheral Operation On-Line). CPU can stay busier - better CPU utilization.

    But, we still have some idle time for the CPU - disk is still much slower than CPU, both then and today. When a job needs access to the disk (or any other I/O) while starting up, during the run, or when writing its output, the CPU is still idle or nearly idle. So we move on to...

  • Multiprogramming Batch Systems

    Have multiple jobs in the system. The CPU can service any job that is in memory.

    System memory:

    When one needs to access I/O or anything else that would cause the CPU to be idle, another job is selected to run while the I/O request is serviced.

    This brings up some new issues that we will discuss later in the semester:

  • I/O device must be able to operate without the CPU, as the CPU would be busy with another job when I/O is taking place.
  • I/O request must be made through system calls - not direct to hardware. Imagine two jobs both sending lines of output to the printer any time they wanted. System calls have access to the hardware, whereas the user processes should not.
  • Need to choose a job to run next when one job makes an I/O request or terminates. Need for CPU scheduling.
  • Need to make sure that job 1 can't read or interfere with job 2's memory. Memory management and protection.
  • But.. there are still significant limits... What about interactive processes?

  • Time-sharing Systems

    The batch systems do not allow user interaction with the program. This is obviously not sufficient in all cases, so operating systems evolved to allow multitasking.

    Users can run interactively - I/O can include a keyboard and a terminal display (or windowing system in a modern equivalent). A user typing at the keyboard is much slower than a computer.

    This is done by switching user tasks or processes transparently. This changes what it important for CPU scheduling. We want each interactive user to get a turn on the CPU quickly - good response time. Need to switch among processes quickly - context switching.

    Many of the concepts we'll talk about this term are present in multiprogramming and time-sharing systems.

  • Personal Computers

    PC's appeared when computers became cheap enough to be affordable for a single user to have one dedicated.

    Such a system has different needs - CPU utilization is generally not the biggest concern, since there are no other jobs waiting to execute. User convenience and responsiveness are the top concerns. One user means protection and security are not important.

    But, as the desktop computer gets more powerful, many of the concepts of the multiprogramming OS's are working their way down into the PC world.

  • Parallel and Distributed Systems

    What happens when we start having multiple CPUs? They might be in the same system, or they might be distributed across a number of systems. Or perhaps we have a whole collection of uniprocessor systems that might make sense to use or manage as a group. Many issues arise here.

  • Real-time systems

    Used for things like reading critical sensor values or controlling some device. The devices could range from kitchen appliance controls to the Mars explorer robot.

    Hard real-time systems for critical applications - automated vehicle (car, airplane, spacecraft) control

    Soft real-time for less critical - visualization, robotics, multimedia.

  • Handheld systems

    A relatively new category. PDAs, cell phones. Many of the issues that have trickled down from the multiprogramming and time-shared systems to the personal computer and workstation world are now starting to get down to this level. These have relatively slower processors, smaller displays, limited memory and non-volatile storage,

  • Other Introductory Notes

  • Competing design goals:
  • User wants - convenience, ease of use, reliability, safety, speed
  • System wants - ease of design, implementation, maintenance, also flexibilty and efficiency
  • Mechanism vs. Policy: mechanisms are provided to perform tasks, policy determines what will actually be done. Separation of mechanism from policy is an important principle. Allowing policy to be changed later allows maximum flexibility.