Computer Operating Systems Single-user/Multi-user Operating Systems Dr. E.C. Kulasekere University of Moratuwa IEE Sri Lanka Chapter 1 Expectations Define what an operating system is. List at least four functions performed by an operating system. Briefly explain the difference between a general purpose operating system and a dedicated operating system. classify software according to either business, operating system, utility, education or entertainment categories Short Course 2003 2 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 1 Expectations (Cont …) Identify input output devices. Explain the difference between a singleuser operating system and a multi-user operating system. Identify some of the available operating systems. Classify common operating systems as single-user or multi-user. Short Course 2003 3 Dr. E.C. Kulasekere IEE Sri Lanka What is an operating system? is a collection of system programs that together control the operation of a computer system (?). The OS is based on particular hardware. Short Course 2003 4 Dr. E.C. Kulasekere IEE Sri Lanka Abstract view of system components Short Course 2003 5 Dr. E.C. Kulasekere IEE Sri Lanka What does an operating system do? The OS controls the way the the Computer Systems functions. initialize the hardware of the computer system. provide basic routines for device control provide for the management, scheduling and interaction of tasks maintain system integrity and handle errors. Maintains system clean up functions. Short Course 2003 6 Dr. E.C. Kulasekere IEE Sri Lanka Where are operating systems found? The complexity of the OS depends on the type of functions that they provide. Some OSs are meant for managing networks. Some are found in petrol pumps. Some are found in electronic items in homes. Some are found in cars. Embedded devices are some examples as well. Short Course 2003 7 Dr. E.C. Kulasekere IEE Sri Lanka What are General purpose/Dedicated OSs? Windows operating systems. Many of the Unix operating systems. Embedded systems are not GP OSs. Firmware is also not GP. The characteristic of a GP OS is its ability to run many software on an application platform. Short Course 2003 8 Dr. E.C. Kulasekere IEE Sri Lanka Some available operating systems. MS-DOS Windows 9x Windows NT Windows XP Windows 200x Unix – Solaris Unix - Linux Short Course 2003 9 Dr. E.C. Kulasekere IEE Sri Lanka Example OS: A security control Short Course 2003 10 Dr. E.C. Kulasekere IEE Sri Lanka What support utilities are required by an Operating System to perform its tasks? Short Course 2003 11 Dr. E.C. Kulasekere IEE Sri Lanka What are programs? A set of instructions for a specific platform? Byte code? Machine code? Programming languages (Compilers) Application software Special purpose software Short Course 2003 12 Dr. E.C. Kulasekere IEE Sri Lanka What are input and output devices? These are devices controlled by the operating system. Commonly found in most computer systems. Input devices: Keyboard, mouse tablet, sensors. Output devices: monitors, printers speakers, actuators. Short Course 2003 13 Dr. E.C. Kulasekere IEE Sri Lanka What is a single user operating system? All windows operating systems fall into this category. In essence, a single-user operating system provides access to the computer system by a single user at a time. If another user needs to access the computer resources, he/she has to wait until the current user departs. Short Course 2003 14 Dr. E.C. Kulasekere IEE Sri Lanka What is a multi-user operating system? It lets more than one user to access the computer system resources at one time. Access is provided via networks. Short Course 2003 15 Dr. E.C. Kulasekere IEE Sri Lanka Multi-user ? Short Course 2003 16 Dr. E.C. Kulasekere IEE Sri Lanka Issues raised by multi-user OSs. System manages multiple requests to same resource concurrently. Should avoid deadlocks. Serial equipment (printers) hooked up to the multi-user OS should be queued. The OS simulates real time performance by task switching. Short Course 2003 17 Dr. E.C. Kulasekere IEE Sri Lanka Operating system utilities The OS is stored in the hard disk. The part relevant is loaded into RAM at the time of execution. Some of the utility programs of the OS are Managing files and documents Development of programs and software Communicating with other computer systems. Managing user requirements for programs, storage space and priority. Short Course 2003 18 Dr. E.C. Kulasekere IEE Sri Lanka Operating system interfaces This can be a basic command interpreter (SHELL) like the dos prompt or a Unix command window. Shell is also called the command line interpreter (CLI). The interface can be graphical as well. X-Windows for Unix. Windows GUI Short Course 2003 19 Dr. E.C. Kulasekere IEE Sri Lanka Advantages and problems of multi-user OSs Advantages Expensive hardware can be shared. Better utilization of resources and less idle time for each resource. Problems As number of users increase the performance degrades. Some resources such as HD space can be expensive since a lot is needed. The software is more complicated making it expensive. Short Course 2003 20 Dr. E.C. Kulasekere IEE Sri Lanka What is a multi-tasking OS? Ability to run more than one program at a time. A requirement of a multi-user system. Simulates real time (Video games) Increases productivity but also increases coordination complexity. More resources required. Short Course 2003 21 Dr. E.C. Kulasekere IEE Sri Lanka What are application software? Software is another word for program. Category of software that runs on an operating system platform. The operating system and nay associated software does not fall into the category of application software. Enhances the utility value of the operating system. Types: Business, Education, Entertainment, Utility. Short Course 2003 22 Dr. E.C. Kulasekere IEE Sri Lanka Research Artwork Air control Fishing, coastal data Short Course 2003 23 Dr. E.C. Kulasekere IEE Sri Lanka Application Software (Cont …) Hair dryer, Washing machine, Kettle, ... Short Course 2003 24 Dr. E.C. Kulasekere IEE Sri Lanka Summary of Definitions Whether multiple programs can run on it simultaneously: multitasking or Single-tasking if not Whether it can take advantage of multiple processors: multiprocessing Whether multiple users can run programs on it simultaneously: multi-user Short Course 2003 25 Dr. E.C. Kulasekere IEE Sri Lanka Summary of definitions (Cont …) Whether it can reliably prevent application programs from directly accessing hardware devices: protected Whether it has built-in support for graphics: GUI Based Whether it has built-in support for networks: Networked Short Course 2003 26 Dr. E.C. Kulasekere IEE Sri Lanka More classifications Real-Time Operating System (RTOS): used to control machinery, scientific instruments and industrial systems Single-User, Single Task: to manage the computer so that one user can effectively do one thing at a time. Palm OS is an example Short Course 2003 27 Dr. E.C. Kulasekere IEE Sri Lanka More classifications (Cont …) Single-User, Multi-Tasking: use on their desktop and laptop operating systems today. Examples are windows based OS Multi-User: allows many different users to take advantage of the computer's resources simultaneously. Example can be UNIX. Short Course 2003 28 Dr. E.C. Kulasekere IEE Sri Lanka It's important to differentiate here between multi-user operating systems and single-user operating systems that support networking. Windows 2000 and Novell Netware can each support hundreds or thousands of networked users, but the operating systems themselves aren't true multi-user operating systems Short Course 2003 29 Dr. E.C. Kulasekere IEE Sri Lanka Popular OS classification Unix: multi-tasking, multi-processing, multiuser, protected, with built-in support for networking but not graphics. Windows NT: multi-tasking, multi-processing, single-user, protected, with built-in support for networking and graphics. Windows 95/98: multi-tasking, multiprocessing, single-user, unprotected, with built-in support for networking and graphics. Short Course 2003 30 Dr. E.C. Kulasekere IEE Sri Lanka Popular OS classification (Cont …) Windows 3.x: single-tasking, singleprocessing, single-user, unprotected, with built-in support for graphics but not networking. DOS: single-tasking, single-processing, single-user, unprotected with no built-in support for graphics or networking. NetWare: multi-tasking, multiprocessing, single-user, unprotected, with built-in support for networking but not graphics. Short Course 2003 31 Dr. E.C. Kulasekere IEE Sri Lanka UNIX: Most popular multi user OS Solaris, from Sun Microsystems. AIX, from International Business Machines (IBM). Digital Unix, from Compaq (which purchased Digital Equipment). IRIX, from Silicon Graphics (SGI) HPUX, from Hewlett-Packard. SCO, from the Santa Cruz Operation. FreeBSD, maintained by a group of individuals. OpenBSD, maintained by a group of individuals with a single coordinator. NetBSD, maintained by a Foundation incorporated in the state of Delaware. Linux, maintained by a loosely coordinated group of volunteers. Short Course 2003 32 Dr. E.C. Kulasekere IEE Sri Lanka NT Based: Most popular single user OS Developed and promoted by Microsoft. It is multi-tasking Multi-processor Network-aware Used to provide: Networked file system (NFS) Printer sharing Run shared application software. Short Course 2003 33 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 2 Expectations list four typical parts (modules) of an operating system. state three functions performed by a realtime executive. explain the difference between pre-emptive and co-operative switching. discuss the relationship between system performance and system overhead. identify the essential operations that need to be performed in order to switch from one program to another. Short Course 2003 34 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 2 Expectations (Cont…) define the terms context switching, system overhead, time-slice, quantum period and scheduling. distinguish between first-in first-out and round robin scheduling Short Course 2003 35 Dr. E.C. Kulasekere IEE Sri Lanka What are the various parts of an OS Real time executive (kernel) is the part of the OS that is responsible for running and coordinating programs. Modularizing the OS helps coordination of programs in a multi-user environment. Typical modules: Kernel Process manager Scheduler File manager Short Course 2003 36 Dr. E.C. Kulasekere IEE Sri Lanka What are the various parts of an OS (Cont …) Short Course 2003 37 Dr. E.C. Kulasekere IEE Sri Lanka applications software utilities systems software Operating system hardware components Short Course 2003 CPU device device ... device memory 38 Dr. E.C. Kulasekere IEE Sri Lanka Kernel functions Switching between programs. Hardware device control and programming. Memory management. Process management. Scheduling. Inter-process communication. Processing of exceptions and interrupts. Short Course 2003 39 Dr. E.C. Kulasekere IEE Sri Lanka How do OSs run more than one program at a time? Single-user and multi-user OSs both can be multi-tasking. Single processor or multi processor systems can be multi-tasking. Simulating multi-tasking using Co-operative switching. Preemptive switching Short Course 2003 40 Dr. E.C. Kulasekere IEE Sri Lanka What is cooperative and preemptive switching? Co-operative switching means that a task that is currently running will voluntarily give up the processor at some time, allowing other processes to run. Preemptive switching means that a running task will be interrupted (forced to give up) and the processor given to another waiting process. Short Course 2003 41 Dr. E.C. Kulasekere IEE Sri Lanka Issues related to task switching co-operative switching: one process could hang and thus deny execution of other processes, resulting in no work being done. Eg. Win3.1 Pre-emptive scheduling gives more response to all processes and helps prevent (or reduce the number of occurrences of) the dreaded machine lockup. Eg. Win NT. Short Course 2003 42 Dr. E.C. Kulasekere IEE Sri Lanka Issues related to task switching (Cont …) Only 32-bit programs in Windows 95 are pre-emptive switched. 16-bit programs are still co-operatively switched, which means it is still easy for a 16-bit program to lock up a Windows 95 computer. Advantages gained out weigh the disadvantages associated with switching. Short Course 2003 43 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 3 Expectations describe how an operating system is initially loaded. given a set of characteristics, determine the type of operating system as batch, real-time, time-sharing, interactive or embedded. state an example of a shell Short Course 2003 44 Dr. E.C. Kulasekere IEE Sri Lanka How does an OS load itself? It can be loaded in two ways: it is already present in ROM (so is permanent, immediately accessible and difficult to update). Eg. Petrol pumps, industrial controllers. Best suited for small and simple OS. it is loaded from disk to RAM when the computer is turned on. Eg. Win 9x. Easier to update and manipulate. Short Course 2003 45 Dr. E.C. Kulasekere IEE Sri Lanka What is the bootstrap process? describes the task of initially loading the operating system from disk into RAM. Short Course 2003 46 Dr. E.C. Kulasekere IEE Sri Lanka What are the different types of OSs. Batch Inter-active Time-sharing/multi-user Multi-tasking Real-time Multi-processor Embedded Short Course 2003 47 Dr. E.C. Kulasekere IEE Sri Lanka What is a shell? A shell is a program that handles user input and output It provides routines for handling user input from a keyboard or mouse It provides routines for displaying information on the terminal screen. A shell also provides a mechanism to interpret user commands and run additional programs that users request Short Course 2003 48 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 4 Expectations define the terms file, cluster, inode, symbolic link describe a typical structure for the root file system list four typical entries for a root file entry explain how free space might be managed list the file systems supported by Windows Short Course 2003 49 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 4 Expectations (Cont …) describe what access or file control permissions are and why they might be needed explain how the file space may become fragmented, what effect this might have on performance, and how the problem might be corrected Short Course 2003 50 Dr. E.C. Kulasekere IEE Sri Lanka File management What is a file? What are the typical operations performed on files? How does the above operations different for single and multi user OS s? What are the security risks associated with file access? Short Course 2003 51 Dr. E.C. Kulasekere IEE Sri Lanka What are file control blocks? FCB is also called the file descriptor is a data structure. The FCB consists of the following: Filename Location of file on secondary storage Length of file Date and time or creation or last access Short Course 2003 52 Dr. E.C. Kulasekere IEE Sri Lanka Naming files MS-DOS Uses eight character file names, a dot, then a three-character extension that denotes the type of file. Filenames are not case-sensitive. UNIX Filenames can be up to 254 characters long and are case-sensitive Windows Filenames can be up to 255 characters long and are not case-sensitive File types? Doc,txt and associated programs. Short Course 2003 53 Dr. E.C. Kulasekere IEE Sri Lanka How does an OS keep track of files? Is it different for single user and multi user systems? How does hardware such as HDs play a role here? As files are created, free sectors are allocated to hold the file contents and marked as allocated. Tables will keep track of the used sectors. Short Course 2003 54 Dr. E.C. Kulasekere IEE Sri Lanka What is a root file system? The root file system is a table of entries like a directory Short Course 2003 55 Dr. E.C. Kulasekere IEE Sri Lanka How is free space managed? Free space is unused clusters. Clusters can come in different sizes. How does sector size affect the free space available when the disk is in use? What is a linked list of clusters? What are FAT, FAT32 and NTFS file systems? Short Course 2003 56 Dr. E.C. Kulasekere IEE Sri Lanka Access control and file permissions In multi-user operating systems, files may be accessed by multiple users Permission rights associated with folders (directories) and files are used to protect or restrict access to files In UNIX this is a rwx format while in NTFS more permissions are available. Short Course 2003 57 Dr. E.C. Kulasekere IEE Sri Lanka Other information What is a symbolic link or short cut? How are they used in multi-user OS s? What is file system integrity? How can it be checked? Are they the same for UNIX and WINDOWS? Short Course 2003 58 Dr. E.C. Kulasekere IEE Sri Lanka What is fragmentation? An OS reads data from HD in contiguous clusters more efficiently and faster than from non-contiguous clusters. Short Course 2003 59 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 5 Expectations List the system requirements for Windows 95, Windows NT and Windows 2000 Professional State the general features of Windows operating systems Short Course 2003 60 Dr. E.C. Kulasekere IEE Sri Lanka Hardware requirements System requirements for Windows 95 386DX or higher 4MB memory or higher [8MB recommended] 35-40MB disk space 3.5" floppy drive or CD-ROM VGA or higher resolution graphics card System requirements for Windows 98 486DX/66MHz or higher 16MB memory or higher 195MB disk space CD-ROM VGA or higher resolution graphics card Short Course 2003 61 Dr. E.C. Kulasekere IEE Sri Lanka Hardware requirements (Cont …) System requirements for Windows NT Workstation 4.0 16 MB RAM Recommended 486/25MHz or higher processor 110 MB available hard-disk space VGA, Super VGA, or video graphics adapter CD-ROM drive. System requirements for Windows 2000 Professional 133MHz Pentium compatible processor 64MB RAM 2GB Hard disk with 650MB available free space Single or dual processor systems Short Course 2003 62 Dr. E.C. Kulasekere IEE Sri Lanka What to look for in the previous slides The resource requirements increase. The resource requirements will be higher for a multiple user system. The resource constraints are not a problem in UNIX multi-user systems. Increase in efficiency of operation as the operating system improves. The graphical requirements as the operating system improves hog a lot of resources. Short Course 2003 63 Dr. E.C. Kulasekere IEE Sri Lanka More advance topics in Operating Systems Short Course 2003 64 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 6 Expectations explain what a process is and how an operating system manages each process identify the relationships between the three process states list four items associated with a process control block define the terms thread, process, critical section and semaphore Short Course 2003 65 Dr. E.C. Kulasekere IEE Sri Lanka Chapter 6 Expectations (Cont …) illustrate how access to a shared resource can be controlled using a semaphore discuss the problems associated with critical sections explain the difference between a foreground and a background task Short Course 2003 66 Dr. E.C. Kulasekere IEE Sri Lanka What is a process? A process or task is a portion of a program in some stage of execution. A process can be periodically communicating with each other as well. Each process has a unique PCB. The process priority is used to determine how often the process receives processor time. How does this scheduling occur? Or priority increase? Short Course 2003 67 Dr. E.C. Kulasekere IEE Sri Lanka What about process states? Some possible states are: ready - if it can run when the processor becomes free. running - it currently has the processor. blocked - it cannot run when the processor becomes free Running processes are interrupted to change state. The PCB is saved to recall it back. Short Course 2003 68 Dr. E.C. Kulasekere IEE Sri Lanka What is a PCB? The data structure for a PCB contains the location in memory of where the process is. the priority of the process a unique process identification number (called PID) the current process state (ready, running, blocked) associated data for the process Short Course 2003 69 Dr. E.C. Kulasekere IEE Sri Lanka Process synchronization Problems associated with synchronization. Semaphore method. Critical section method. Use of synchronization in single user systems and multi user systems. Deadlock. Short Course 2003 70 Dr. E.C. Kulasekere