Click here to load reader

Operating Systems Concepts Manual 2010

  • View
    7.156

  • Download
    2

Embed Size (px)

Text of Operating Systems Concepts Manual 2010

OPERATING SYSTEMS CONCEPTSLECTURE NOTES

COURSE CODE: CSYS2402

Compiled by Mrs. G. CampbellCopyright @ 2010

TABLE OF CONTENTSCOURSE OUTLINE .............................................................................................................. 7 LECTURE 1 INTRODUCTION (1/2 HOUR) .................................................................. 14 DEFINE OPERATING SYSTEM.................................................................................................. 14 TYPES/CATEGORIES OF OPERATING SYSTEMS ....................................................................... 15 Stand-alone ...................................................................................................................... 15 Network ............................................................................................................................ 15 Embedded ........................................................................................................................ 16 TUTORIAL QUESTIONS .......................................................................................................... 16 PRACTICE MCQS ................................................................................................................. 16 THE HISTORY AND DEVELOPMENT OF THE OPERATING SYSTEM ............................................... 18 TUTORIAL QUESTIONS .......................................................................................................... 21 PRACTICE MCQS ................................................................................................................. 21 LECTURE 2 - OPERATING SYSTEMS FUNCTIONS (1 HOUR) .................................. 23 FUNCTIONS .......................................................................................................................... 23 WHAT IS A USER INTERFACE? ............................................................................................... 24 SERVICES ............................................................................................................................. 25 Buffering .......................................................................................................................... 25 Spooling (Simultaneous Peripheral Operation On-Line) .................................................. 25 Other Services .................................................................................................................. 26 TUTORIAL QUESTIONS .......................................................................................................... 27 PRACTICE MCQS ................................................................................................................. 27 LECTURE 3 - SOFTWARE AND FIRMWARE (1/2 HOUR) ........................................... 29 SYSTEM SOFTWARE.............................................................................................................. 29 APPLICATION SOFTWARE ...................................................................................................... 29 FIRMWARE ........................................................................................................................... 31 TUTORIAL QUESTIONS .......................................................................................................... 31 PRACTICE MCQS ................................................................................................................. 32 LECTURE 4 - FILE CONCEPTS (1 HOUR) ..................................................................... 34 FILE ATTRIBUTES ................................................................................................................. 34 FILE OPERATIONS ................................................................................................................. 35 What the Operating System must do for each of the 5 basic file operations ...................... 35 TUTORIAL QUESTIONS .......................................................................................................... 36 PRACTICE MCQS ................................................................................................................. 36 LECTURE 5 - DIRECTORY SYSTEMS (2 HOURS)........................................................ 38 DIRECTORY OPERATIONS ..................................................................................................... 38 DIRECTORY SYSTEMS TYPES OF DIRECTORIES/DIRECTORY STRUCTURES ................................ 38 TUTORIAL QUESTIONS .......................................................................................................... 41Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

1

PRACTICE MCQS ................................................................................................................. 41 LECTURE 6 - MULTI-PROGRAMMING AND TIMESHARING (1 HOUR) ................ 42 MULTI-PROGRAMMING ......................................................................................................... 42 TUTORIAL QUESTIONS .......................................................................................................... 43 PRACTICE MCQS ................................................................................................................. 43 TIME SHARING ..................................................................................................................... 44 TUTORIAL QUESTIONS .......................................................................................................... 44 LECTURE 7 - SCHEDULING CONCEPTS, CRITERIA, ALGORITHMS (6 HOURS) 45 SCHEDULING CONCEPTS ....................................................................................................... 45 TUTORIAL QUESTIONS .......................................................................................................... 46 PRACTICE MCQS ................................................................................................................. 46 SCHEDULING CRITERIA ......................................................................................................... 48 TUTORIAL QUESTIONS .......................................................................................................... 48 PRACTICE MCQS ................................................................................................................. 48 SCHEDULING ALGORITHMS ................................................................................................... 49 First Come First Served or First In First Out (FCFS/FIFO) ............................................. 49 Shortest Job First (SJF).................................................................................................... 49 Priority ............................................................................................................................ 50 Round robin (RR) ............................................................................................................. 50 Pre-emptive ...................................................................................................................... 50 Multilevel queues ............................................................................................................. 51 TUTORIAL QUESTIONS .......................................................................................................... 51 PRACTICE MCQS ................................................................................................................. 52 LECTURE 8- MULTIPLE PROCESSOR SCHEDULING (2 HOURS) ........................... 54 ASYMMETRIC MULTIPROCESSING .......................................................................................... 54 SYMMETRIC MULTIPROCESSING ........................................................................................... 54 HOMOGENOUS AND HETEROGENOUS SYSTEMS ...................................................................... 55 TUTORIAL QUESTIONS .......................................................................................................... 55 PRACTICE MCQS ................................................................................................................. 55 LECTURE 9 - MEMORY MANAGEMENT (1 HOUR).................................................... 57 INTRODUCTION .................................................................................................................... 57 TUTORIAL QUESTIONS .......................................................................................................... 57 PRACTICE MCQS ................................................................................................................. 58 MEMORY HIERARCHY........................................................................................................... 59 TUTORIAL QUESTIONS .......................................................................................................... 59 PRACTICE MCQS ................................................................................................................. 60 LECTURE 10 - BASIC MEMORY HARDWARE BASE REGISTER, LIMIT REGISTER (1 HOUR) ......................................................................................................... 61 WHAT IS A REGISTER?........................................................................................................... 61 TYPES OF REGISTERS ............................................................................................................ 61 TUTORIAL QUESTIONS .......................................................................................................... 62 LECTURE 11 - LOGICAL VS. PHYSICAL ADDRESS SPACE (1 HOUR) .................... 63Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

2

TUTORIAL QUESTIONS .......................................................................................................... 63 PRACTICE MCQS ................................................................................................................. 64 LECTURE 12 SWAPPING (1 HOUR) ............................................................................. 65 TUTORIAL QUESTIONS .......................................................................................................... 65 PRACTICE MCQS ................................................................................................................. 65 LECTURE 13 - CONTIGUOUS VS NON CONTIGUOUS MEMORY ALLOCATION (4 HOURS) ................................................................................................................................ 67 CONTIGUOUS ALLOCATION ................................................................................................... 67 NON-CONTIGUOUS ALLOCATION ........................................................................................... 67 TUTORIAL QUESTIONS .......................................................................................................... 68 PRACTICE MCQS ................................................................................................................. 69 MEMORY ALLOCATION STRATEGIES FIRST FIT, BEST-FIT, WORST-FIT .................................... 70 TUTORIAL QUESTIONS .......................................................................................................... 70 PRACTICE MCQS ................................................................................................................. 70 LECTURE 14 PARTITIONS AND FRAGMENTATION (1 HOUR)............................. 72 PARTITIONS.......................................................................................................................... 72 TUTORIAL QUESTIONS .......................................................................................................... 74 PRACTICE MCQS ................................................................................................................. 74 FRAGMENTATION INTERNAL, EXTERNAL............................................................................. 75 TUTORIAL QUESTIONS .......................................................................................................... 75 PRACTICE MCQS ................................................................................................................. 75 LECTURE 15 - INTRODUCTION TO VIRTUAL MEMORY (1 HOUR) ....................... 76 TUTORIAL QUESTIONS .......................................................................................................... 76 PRACTICE MCQS ................................................................................................................. 76 VIRTUAL ADDRESS SPACE .................................................................................................... 76 LECTURE 16 - PURE PAGING (2 HOURS) ..................................................................... 78 ADVANTAGES: ..................................................................................................................... 79 DISADVANTAGES: ................................................................................................................ 79 TUTORIAL QUESTIONS .......................................................................................................... 79 LECTURE 17 - PAGE REPLACEMENT (3 HOURS) ....................................................... 80 FIFO ................................................................................................................................... 80 OPTIMAL REPLACEMENT ....................................................................................................... 80 LEAST RECENTLY USED (LRU) ............................................................................................. 80 LEAST FREQUENTLY USED (LFU) .......................................................................................... 80 MOST FREQUENTLY USED (MFU).......................................................................................... 80 ALLOCATION ALGORITHMS ................................................................................................... 80 TUTORIAL QUESTIONS .......................................................................................................... 81 PRACTICE MCQS ................................................................................................................. 81 LECTURE 18 - DEMAND PAGING (2 HOURS) .............................................................. 82 ADVANTAGES ...................................................................................................................... 82 DISADVANTAGES ................................................................................................................. 82Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

3

THRASHING.......................................................................................................................... 83 TUTORIAL QUESTIONS .......................................................................................................... 83 PRACTICE MCQS ................................................................................................................. 83 LECTURE 19 SEGMENTATION (1 HOUR) .................................................................. 85 TUTORIAL QUESTIONS .......................................................................................................... 86 PRACTICE MCQS ................................................................................................................. 87 LECTURE 20 - AUXILIARY STORAGE MANAGEMENT (1 HOUR) .......................... 88 INTRODUCTION .................................................................................................................... 88 TUTORIAL QUESTIONS .......................................................................................................... 88 BLOCKS ............................................................................................................................... 88 TUTORIAL QUESTIONS .......................................................................................................... 88 RAM AND OPTICAL DISKS .................................................................................................... 88 TUTORIAL QUESTIONS .......................................................................................................... 89 DISK CACHING ..................................................................................................................... 89 TUTORIAL QUESTIONS .......................................................................................................... 90 LECTURE 21 - MOVING-HEAD DISK STORAGE (2 HOURS) ..................................... 91 OPERATIONS ON MOVING-HEAD DISK STORAGE ..................................................................... 91 PRACTICE MCQS ................................................................................................................. 91 MEASURES OF MAGNETIC DISK PERFORMANCE ...................................................................... 92 TUTORIAL QUESTIONS .......................................................................................................... 92 PRACTICE MCQS ................................................................................................................. 92 DISK SCHEDULING ................................................................................................................ 93 First come first served (FCFS) ......................................................................................... 93 Shortest seek time first (SSTF) .......................................................................................... 93 SCAN and C-SCAN .......................................................................................................... 93 LOOK and C-LOOK ........................................................................................................ 93 TUTORIAL QUESTIONS .......................................................................................................... 94 PRACTICE MCQS ................................................................................................................. 94 LECTURE 22 RAID (2 HOURS) ...................................................................................... 95 RAID LEVELS ...................................................................................................................... 95 TUTORIAL QUESTIONS .......................................................................................................... 98 LECTURE 23 BACKUP AND RECOVERY METHODS (1 HOUR) ............................ 99 GRAND FATHER, FATHER, SON TECHNIQUE FOR MAGNETIC TAPE ............................................ 99 BACKUP TIPS ....................................................................................................................... 99 TUTORIAL QUESTIONS ........................................................................................................ 100 PRACTICE MCQS ............................................................................................................... 100 LECTURE 24 - FILE SERVER SYSTEMS (1 HOUR) .................................................... 101 TUTORIAL QUESTIONS ........................................................................................................ 101 LECTURE 25 - DISTRIBUTED FILE SYSTEMS (1 HOUR) ......................................... 102 TUTORIAL QUESTIONS ........................................................................................................ 103 PRACTICE MCQS ............................................................................................................... 103Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

4

LECTURE 26 - CO-PROCESSORS (1/4 HOUR)............................................................. 104 MATH CO-PROCESSORS ...................................................................................................... 104 ADVANTAGES .................................................................................................................... 104 DISADVANTAGES ............................................................................................................... 104 TUTORIAL QUESTIONS ........................................................................................................ 104 PRACTICE MCQS ............................................................................................................... 105 LECTURE 27 - RISC/CISC (3/4 HOUR) .......................................................................... 106 RISC (REDUCED INSTRUCTION SET COMPUTING) ................................................................. 106 Advantages of RISC ....................................................................................................... 107 Disadvantages of RISC................................................................................................... 108 Examples of RISC Processors......................................................................................... 109 CISC ................................................................................................................................. 110 Advantages of CISC ....................................................................................................... 111 Disadvantages of CISC .................................................................................................. 111 Examples of CISC Processors/Chips .............................................................................. 112 CRISC............................................................................................................................... 112 SUMMARY/CONCLUSION .................................................................................................... 113 TUTORIAL QUESTIONS ........................................................................................................ 113 PRACTICE MCQS ............................................................................................................... 113 LECTURE 28 SECURITY (1 HOUR) ............................................................................ 115 DEFINITION OF SECURITY.................................................................................................... 115 PURPOSE OF SECURITY ....................................................................................................... 115 FORMS OF SECURITY VIOLATION ......................................................................................... 115 SECURITY THREATS AND ATTACKS ...................................................................................... 116 Trojan Horse .................................................................................................................. 116 Virus .............................................................................................................................. 116 Logic bomb .................................................................................................................... 116 Worm ............................................................................................................................. 116 Denial-of-service............................................................................................................ 117 AUTHENTICATION, ENCRYPTION, VIRUS PROTECTION, FIREWALL ........................................ 117 Authentication ................................................................................................................ 117 Encryption ..................................................................................................................... 117 Virus protection.............................................................................................................. 117 Firewall.......................................................................................................................... 117 TUTORIAL QUESTIONS ........................................................................................................ 117 PRACTICE MCQS ............................................................................................................... 118 CASE STUDIES .................................................................................................................... 119 MS-DOS......................................................................................................................... 119 UNIX.............................................................................................................................. 119 OS/2 ............................................................................................................................... 119 OS/400 ........................................................................................................................... 120 MacOS ........................................................................................................................... 120 Microsoft Windows ......................................................................................................... 120 Novell Netware ............................................................................................................... 121Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

5

TUTORIAL QUESTIONS ........................................................................................................ 121 REFERENCES ................................................................................................................... 122

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

6

COURSE OUTLINE

THE COUNCIL OF COMMUNITY COLLEGES OF JAMAICACOURSE NAME: COURSE CODE: CREDITS: CONTACT HOURS: PRE-REQUISITE(S): CO-REQUISITE(S): SEMESTER: COURSE DESCRIPTION: This course presents the basic concepts of operating systems. Topics that will be examined include processes and interprocess communication/synchronization, virtual memory, program loading and linking system calls and system programs; interrupt handling, device and memory management, process scheduling, deadlock and the tradeoffs in the design of large-scale multitasking operating systems. GENERAL OBJECTIVES: Upon successful completion of this course, students should: 1. understand the fundamental concepts of modern operating systems 2. appreciate the wide variety of operating systems within diverse platforms 3. manipulate operating systems 4. use system tools to execute various computer functions UNIT I - Introduction Specific Objectives: Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. define operating system describe the historical development of operating systems describe at least six (6) functions and services of an operating system explain the difference between application and system software define firmwareUpdated Jan 2010

Operating Systems Concepts CSYS2402 3 45 (45 hours theory) None None

(2 hours)

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

7

Content: 1. Introduction: a. Define operating system. b. The history and development of the operating system. 2. Operating Systems Functions: a. System Startup, I/O (Buffering, Spooling), Storage, User Interface, Protection and Security, Resource Allocation, Program execution, File-system manipulation, Communications, Error Detection 3. Software and Firmware: a. System Software b. Application Software c. Utilities

UNIT II Directory Systems Specific Objectives:

(3 hours)

Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. list and describe at least five (5) file attributes describe at least five (5) file operations list at least five (5) directory operations describe at least four (4) directory structures compare and contrast the directory structures

Content: 1. File Concepts File Attributes, File Operations 2. Directory Systems Single-level, Two-level, Tree-Structured, Acyclic-Graph

UNIT III CPU Scheduling Specific Objectives:

(9 hours)

Upon successful completion of this unit, students should be able to: a. b. c. d. e. f. g. h. explain multiprogramming explain timesharing describe the CPU I/O burst cycle distinguish between preemptive and non-preemptive scheduling state the functions of the dispatcher list and explain at least three (3) scheduling criteria describe at least four (4) scheduling algorithms given a table with process data:Updated Jan 2010

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

8

i. j.

a. Calculate the turnaround time for each process for each scheduling algorithm. b. Calculate the average wait time for each scheduling algorithm c. Draw the GANTT chart for each process scheduling algorithm explain the advantages and disadvantages of each scheduling algorithm describe multiprocessor scheduling

Content: 1. Multiprogramming, Time Sharing 2. Scheduling concepts CPU I/O Burst cycle, Scheduler, Preemptive scheduling, Dispatcher 3. Scheduling criteria 4. Scheduling algorithms FIFO, Priority, Round Robin, Shortest Remaining Time, Shortest Job First 5. Multiple processor scheduling Asymmetric & symmetric multiprocessing UNIT IV Memory Management Specific Objectives: Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. 6. 7. 8. describe the memory hierarchy describe the basic hardware used in memory management distinguish between logical and physical addresses explain swapping distinguish between contiguous and non-contiguous memory allocation explain partitioning describe the three (3) memory allocation strategies given a list of free holes and a list of processes, correctly allocate the processes to holes using the three (3) memory allocation strategies 9. distinguish between internal and external fragmentation Content: 1. 2. 3. 4. 5. 6. 7. 8. Memory hierarchy Basic memory hardware base register, limit register Logical vs. physical address space Swapping Contiguous vs. non-contiguous memory allocation Memory allocation strategies first-fit, best-fit, worst-fit Partitions Fragmentation internal, external (9 hours)Updated Jan 2010

(9 hours)

UNIT V Virtual MemoryOperating System Concepts Mrs. G. Campbell Copyright @ 2010

9

Specific Objectives: Upon successful completion of this unit, students should be able to: 1. explain the term virtual address space 2. define page 3. define frame 4. explain the purpose of the page table 5. use a diagram to explain and illustrate address translation in paging 6. describe at least two (2) page replacement algorithms 7. distinguish between pure and demand paging 8. explain segmentation 9. use a diagram to explain and illustrate address translation in segmentation 10. explain thrashing Content: 1. Virtual address space 2. Pure paging pages, frames, page table, address structure, address translation 3. Page replacement a. FIFO b. Optimal replacement c. LRU d. LFU e. MFU f. Allocation algorithms 4. Demand paging 5. Segmentation segment table, address translation 6. Thrashing UNIT VI Auxiliary Storage Management Specific Objectives: Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. define block describe the structure of a RAM disk describe the structure of an optical disk describe at least four (4) disk scheduling algorithms given a disk scheduling algorithm and a list of disk requests, create the correct schedule to satisfy all requests 6. explain disk caching 7. state the advantages of disk caching 8. describe the various RAID levelsOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

(5 hours)

10

Content: Blocks RAM and Optical disks Operations on moving-head disk read, write, positioning Measures of magnetic disk performance transfer rate, positioning time, seek time rotational latency 5. Disk scheduling FCFS, SSTF, SCAN, LOOK, C-SCAN 6. Disk caching 7. RAID 1. 2. 3. 4.

UNIT VII File System Specific Objectives:

(3 hours)

Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. explain at least two (2) backup techniques explain at least one (1) recovery technique describe file-server systems describe distributed file systems explain the advantages and disadvantage of a distributed file system

Content: 1. Backup and recovery methods full backup, incremental backup, log-structured systems 2. File server systems client-server computing 3. Distributed file systems naming, location transparency, location independence

UNIT VIII Co- Processor and RISC and CISC Specific Objectives:

(1 hours)

Upon successful completion of this unit, students should be able to: 1. 2. 3. 4. 5. explain the purpose of co-processors describe the characteristics of RISC architecture describe the characteristics of CISC architecture explain one advantage of RISC architecture explain one advantage of CISC architecture

Content:Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

11

1. Advantages and disadvantages of co-processors 2. RISC / CISC development, advantage, disadvantage UNIT IX Operating Systems Security Specific Objectives: Upon successful completion of this unit, students should be able to: 1. define security 2. describe at least four (4) security threats and/or attacks 3. discuss various ways in which operating systems handle security threats or attacks Content: 1. 2. 3. 4. 5. Purpose of security Forms of security violation Security threats and attacks Trojan Horse, virus, logic bomb, worm, Denial-of-service Authentication, Encryption, Virus protection, Firewall Case Studies MS-DOS, UNIX, OS/2, Apple Macintosh, Windows (1hours)

METHODS OF DELIVERY: 1. 2. 3. 4. Lectures Demonstrations Discussions Presentations

METHODS OF ASSESSMENT AND EVALUATION: 1. Common Coursework 20% 2. Internal Tests 20% 3. Final Examination 60% (40MCQs 1 mark each and 5 Structured Questions 20 marks each to choose any 3)

RESOURCE MATERIAL: Prescribed: Silberschatz, A., Galvin, P.B. & Gagne, G. (2008). Operating systems concepts. (8th ed). NJ: John WileyOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

12

Recommended: Tanenbaum, A.S. (2007). Modern operating systems (3rd ed.). NJ: Prentice Hall Shay, W. (1999). An introduction to operating systems.(6th ed.) OH: McGraw-Hill Stallings, W. (2005). Operating systems: internal design principles (5th ed.). NJ: Prentice Hall.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

13

Lecture 1 Introduction (1/2 hour)Microsoft Windows 7, DOS, Unix, Linux, MacOS. These are all examples of operating systems. We do not use the computer because of these software. We use the computer because we want to type a document, play a game, surf the internet, do our budget etc. We would however not be able to do these things on our computers without an operating system installed. Define operating system An operating system (O/S) is a program which acts as an interface between a user of a computer and the computer hardware. The operating system provides an environment in which a user may execute programs. Its primary goal therefore, is to make the computer convenient to use. Without an operating system the user would have to communicate with the computer in binary form which would be very tedious and inconvenient. When you purchase a new computer, it typically has an operating system already installed. As new versions of the operating system are released, users upgrade their existing computers to the new version. An upgrade usually costs less than purchasing the entire operating system. A computer system is roughly divided into four (4) parts: hardware - CPU, memory, I/O devices etc. operating system (type of system software) application software/programs - database systems, video games, business programs, word processors, spreadsheets etc. users - people, machines, other computers etc.

The layers of a computer systemOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

14

By itself, the hardware is of as much use as a CD player without CDs. The hardware is capable of carrying out a wide variety of decisions and tasks in order to do this it needs to be given a set of instructions in a form that it can understand. Based on the diagram above it is clear that in order for the user to direct the hardware it does so through different layers. An operating system is divided into the kernel and the superstructure. kernel/monitor/supervisor/executive concerned with the allocation and sharing of resources interfacing to the hardware such as interrupt handling, storage management, processor scheduling always resident in memory once the computer is turned on has a special area in memory reserved for it superstructure concerned with everything else provides a user environment/interface that is convenient basis of services to the user e.g. filing system, command language, data management (control of I/O devices, mapping logical file structures onto physical devices, so no need to know which sector, track, block) and job control. Types/Categories of Operating Systems Operating systems fall mainly in 3 categories: Stand-alone, Network and Embedded. Stand-alone A stand-alone operating system is a complete operating system that works on a desktop computer, notebook computer, or mobile computing device. Some stand-alone operating systems are called client operating systems because they work in conjunction with a network operating system. Stand-alone operating systems include DOS, Early Microsoft Windows versions (e.g. 3.x, 95, NT Workstation, 98, 200 Professional, ME), Windows XP, UNIX, Mac OS X, OS/2 Warp Client, and Linux. Network A network operating system organizes and coordinates how multiple users access and share network resources. They can therefore be called multi-user operating systems. A network administrator uses the network O/S to add and remove users, computers, and other devices to and from the network. A network administrator also uses the network O/S to administer network security. Examples of network O/Ses include: Novell Netware, Early Microsoft Windows Server versions (NT Server, 2000 Server), Microsoft Windows Server 2003, OS/2 Warp Server for e-business, UNIX, and Linux.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

15

Embedded Most PDAs and small devices have an embedded operating system that resides on a ROM chip. Popular embedded operating systems include Windows CE .NET, Pocket PC 2002, Palm OS, and Symbian OS. Operating systems can also be categorized in the following ways Multi-programming - the available processor(s) is shared among several programs coresident in main memory, in order to improve CPU utilization. Foreground background - a single user system in which two programs are multiprogrammed. One (the foreground) interacts with the terminal and runs as long as it is able; the background program is assigned to the processor whenever the foreground program is unable to proceed. Time sharing - shares the processor and memory among a number of programs, each associated with a remote interactive terminal, in such a way that each user thinks he has a machine to himself. Transaction processing - resembles a time sharing system in that it serves a number of remote terminals. However, all the terminals are connected to the same program. E.g. airline reservation system. General Purpose - a multi-user system that combines batch processing, time sharing and possibly transaction processing in a single system. Tutorial Questions 1. 2. 3. 4. 5. 6. 7. Define operating system. Give the name of five (5) operating systems. What are the main purposes of an operating system? What is the difference between the kernel and the superstructure? Describe the different categories of operating systems. What operating systems are you familiar with? Have you ever used Windows 7? If yes, comment on its new features. If no, research its new features and comment on them. 8. Most modern operating systems are event/interrupt driven, what does this mean? 9. Research the features of the operating systems mentioned. 10. Is there a difference between a multi-programming O/S and a multi-tasking O/S? 11. Differentiate between multi-user and multi-programming. Practice MCQs 1. An operating system is a program that a. Gives instructions to the hardware b. Controls the user c. Is controlled by application software d. Is no longer essentialOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

16

2. Select the correct sequence a. Hardware, user, application software, system software b. User, application software, system software, hardware c. User, system software, hardware, application software d. User, hardware, application software, system software 3. The part of the operating system that is always resident in RAM is called a. Segment b. Superstructure c. Fence d. Executive 4. Which of the following is TRUE for an operating system? a) It performs word processing tasks b) It is controlled by application software c) It provides a user interface d) It is inconvenient to use 5. _____________ is an important part of a computer system that provides the means for the proper use of the computer resources. A. Hardware B. Application programs C. Operating System D. Users

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

17

The history and development of the operating system Operating systems first began to appear in the late 1950s. In the early days machines were hand operated, that is, the operator - usually the programmer set up a job by loading the card reader, mounting magnetic tapes etc., then started the program by manipulating switches on the console. When a job was done, he would unload tapes, remove the listing from the printer then set up the next job. During the time that tapes were being mounted or the programmer was operating the console, the CPU sat idle. If errors occurred then the programmer would halt the program, examine the contents of memory and registers and debug the program directly from the console. At that time computer time was very expensive (about $45.66 per hour). Eventually the programmer was replaced by professional computer operators, as soon as one job was finished, an operator could start the next job, and left the programmer with a much more difficult debugging problem. Another way of saving time was to batch the jobs together and run them through the computer as a group. These changes, making the operator distinct from the user and batching similar jobs, improved utilization quite a bit. Programmers would leave their programs with the operators. The operators would sort them into batches with similar requirements and as the computer became available, would run each batch. The output from each job would be sent back to the appropriate programmer. There were still problems however. E.g. when a job stopped, the operator would have to notice this by observing it on the console, determine why the program stopped, take a dump (printout of errors in hexadecimal) if necessary, then load the card reader or paper tape reader with the next job and restart the computer. During this transition from one job to the next the CPU sat idle. To overcome this: automatic job sequencing was introduced, and with it the first rudimentary operating systems were created. A small program called a resident monitor was created to automatically transfer control from one job to the next. This monitor is always resident in memory. Initially when the computer was turned on, control of the computer resided with the resident monitor, which would transfer control to a program, when the program terminated, it would return control to the resident monitor, which would then go on to the next program. Control cards were set up by the operator in order for the monitor to know the order in which jobs were to be run. In those days machines were slow, the operator was slow, I/O devices were slow. The relative slowness of the I/O devices meant that the CPU is often waiting on I/O. Also as computer speed increased the ratio of set-up time to run time grew unacceptably out of proportion and the need arose to efficiently automate the job to job transition. (E.g. to process some cards by the CPU may take 4 seconds, but take 60 seconds to be read by the card reader). Efforts to remove the mismatch led to 2 developments: introduction of I/O channelOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

18

a piece of hardware to control I/O devices in an autonomous manner. Once started the channel ran independent of central processor. introduction of the technique of off-lining I/O instead of the computer using the slow peripheral devices directly, input was transcribed from cards to magnetic tape and the program got its input by reading card images to tape and these were later transcribed to punch cards or the printer. (i.e. read data from tape and not from card). The main computer was therefore no longer constrained by the speed of the card readers and line printers, but only by the speed of the magnetic tape units. In addition, no changes need to be made to the application program to change from direct to offline I/O operation. Only the device driver must be changed. This ability to run a program with different I/O devices is called device independence. By the mid 1960s multiprogramming was introduced, this allowed the simultaneous processing of more than one program at a time. This was achieved by job/CPU scheduling, in which the CPU switches to another job instead of sitting idle waiting on I/O. Having several jobs in memory at one time requires memory management. By 1970 multiprocessing, high level user oriented programming languages, time sharing and data communications (network operating systems) were introduced. Time sharing allowed immediate access to all of the application programs that were running. Time sharing used CPU scheduling and multiprogramming to accomplish this. The first commercially successful time-sharing system, and the one which became the most widespread in the late 1960s and early 1970s, was the Dartmouth Time-Sharing System (DTSS) which was first implemented at Dartmouth College in 1964 and eventually formed the basis of General Electric's computer bureau services. Other early time sharing systems include: IBM CMS (part of VM/CMS), IBM Time Sharing Option (TSO), Michigan Terminal System, Multics, MUSIC/SP, WYLBUR. On into 1980s came interactive real-time systems that enabled on-line communication between the user and the computer. The user could now give instructions via commands instead of control cards. The mid 1980s also introduced distributed operating systems. A distributed operating system is one that appears to its users as a traditional uni-processor system, even though it is actually composed of multiple processors. The users should not be aware of where their programs are being run or where their files are located. Most of the first operating systems were device dependent and proprietary. A devicedependent program is one that runs only on a specific type or make of computer. Proprietary software is privately owned and limited to a specific vendor or computer model. Historically, when manufacturers introduced a new computer or model, they often produced an improved and different proprietary operating system. Problems arose when a user wanted to switch computer models or manufacturers. The users application software often would not work on the new computer because the programs were designed to work with a specific operating system. Some operating systems still are device dependent. The trend today, however, is toward deviceindependent operating systems that run on computers provided by a variety of manufacturers.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

19

The advantage of device-independence is that you can retain existing application software and data files even if you change computer models or vendors. This feature usually represents a sizable savings in time and money. The following table lists some of the operating systems that have been developed over the years. Decade 1950s Year 1954 1955 1956 1960s 1960 1961 1964 1965 1966 1967 1969 1970s 1970 1972 1975 1976 1980s 1980 1981 1983 1984 1986 1987 1988 1990s 1990 1991 1992 1993 1995Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Sample of Operating Systems MIT's operating system made for UNIVAC 1103 General Motors Operating System made for IBM 701 GM-NAA I/O for IBM 704, based on General Motors Operating System IBSYS (IBM) CTSS (MIT) MCP (Burroughs) OS/360 (IBM) Dartmouth Time Sharing System Multics (MIT, GE, Bell Labs) DOS/360 (IBM) CP/CMS (IBM) Unics (later Unix) (AT&T) DOS-11 (PDP-11) VM/CMS CP/M Cray Operating System Xenix PC-DOS MS-DOS Novell NetWare (S-Net) SunOS 1.0 Mac OS (System 1.0) AIX 1.0 SunOS 3.0 OS/2 (1.0) OS/400 BeOS (v1) Linux Mac OS (System 7) Solaris 2.0 Windows NT 3.1 Novell NetWare 4 Windows 95Updated Jan 2010

20

1996

1998 1999 2000s 2000

Mac OS 7.6 Windows NT 4.0 Palm OS Windows 98 Mac OS 9 RISC OS 4 Windows 2000 Solaris 8 Windows ME Mac OS X Windows XP SUSE Linux Windows Server 2003 Ubuntu 5.04 Windows Vista Ubuntu 7.10 Mac OS X v 10.5 Solaris 10 5/08 SUSE Linux 11.0 Windows 7 Windows Server 2008 R2 openSUSE 11.2 FreeBSD 8.0

2001 2002 2003 2005 2006 2007 2008 2009

Tutorial Questions 1. 2. 3. 4. 5. 6. Discuss the first operating system. Who invented it? Describe the situation that most impacted the development of operating systems. Describe the historical development of operating systems. In your description include the names and features of the older operating systems. Describe the historical development of operating systems from 1980 to the present. Describe the features of as many operating systems as you can. What generation do the different operating systems belong to?

Practice MCQs 1. One factor that led to the development of operating systems was that a) The CPU was often idle b) The I/O devices were too fast c) Programmers could not debug problems d) The CPU was overworked 2. Which of the following greatly impacted the development of the operating system? a) The CPU was slow compared to the operatorOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

21

b) The CPU was often idle c) The CPU was overworked d) The CPU was slow compared to I/O devices 3. All of the following describe ways in which designers dealt with the difference in speed between the CPU and I/O devices EXCEPT: a) Multi-programming b) I/O channel c) Off-lining I/O d) Buffering 4. In what time period was the first operating systems developed? A. First Generation B. Second Generation C. Third Generation D. Fourth Generation

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

22

Lecture 2 - Operating Systems Functions (1 hour)Functions Most operating systems perform familiar functions that include the following: Start up or boot up the computer Provide an interface between the hardware and the user that is more convenient than that presented by the bare machine. Manage other programs Manage memory Control/Co-ordinate/Configure the various hardware devices Manage the sharing of resources (such as two persons trying to print at the same time on a network) Schedule jobs Establish an internet connection Monitor performance Provide file management and other utilities Some operating systems also allow users to control a network and administer security. Booting is the process of starting or restarting a computer. When a user turns on a computer, the power supply sends a signal to the system unit. The processor chip finds the ROM chip(s) that contains the BIOS, which is firmware with the computers startup instructions. The BIOS performs the power-on self test (POST) to check system components and compares the results with data in a CMOS chip. If the POST completes successfully, the BIOS searches for the system files and the kernel of the operating system, which manages memory and devices, and loads them into memory from storage. Finally, the operating system loads configuration information, requests any necessary user information, and displays the desktop. Managing programs refers to how many users, and how many programs, an operating system can support at one time. An operating system can be single user/single tasking, single user/multitasking, multiuser, or multiprocessing. A single user operating system allows only one person at a time to use the computer. A single tasking operating system can run one program at a time. A multitasking/multiprogramming operating system can run more than one program at the same time by scheduling the processors time. A multi-user operating system allows more than one person to use the computer at a time. This is done on a network. A multiprocessing operating system is where more than one processor is used to run more than one program at the same time. Memory management optimizes the use of RAM. If memory is insufficient, the operating system may use virtual memory, which allocates a portion of a storage medium to function as additional RAM.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

23

Scheduling jobs determines the order in which jobs are processed. A job is an operation the processor manages. All hardware devices are managed and scheduled among the various jobs or programs that are run. Scheduling is done via a scheduling algorithm. Configuring devices involves loading each devices driver when a user boots the computer. A driver is a program that tells the operating system how to communicate with a specific device. Establishing an Internet connection sets up a connection between a computer and an Internet service provider. A performance monitor is an operating system program that assesses and reports information about computer resources and devices. File management utilities (such as Windows Explorer [Do not confuse this with Internet Explorer a web browser]) allows the user to copy files, move files, delete files and create folders. What is a User Interface? The user interface controls how data and instructions are entered and how information is displayed. Three types of user interfaces are command-line interface, menu-driven interface, and graphical user interface. What is a Command driven or command line interface? To configure devices, manage resources and troubleshoot network connections, network administrators and other advanced users work with a command-line interface. A command line interface is where a user types commands or presses special keys on the keyboard (such as function keys) to enter data and instructions. When working with a command-line interface the set of commands entered into the computer is called the command language. Command line interfaces often are difficult to use because they require exact spelling, grammar and punctuation. Minor errors such as a missing full stop, generate an error message. Command-line interfaces however, give a user more control over setting details. What is a Menu driven interface? A menu-driven interface provides menus as a means of entering commands. As in a restaurant, a menu is a list of items from which you may choose and option. Menu driven interfaces are easier to learn than command line interfaces because users do not have to learn the rules of entering commands. What is a Graphical user interface (GUI)? Most users today work with a graphical user interface. With a graphical user interface (GUI), you interact with menus and visual images such as icons, buttons and other graphical objects to issue commands. Many current GUI operating systems incorporate features similar to those of a Web browser.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

24

Services An operating system provides an environment for the execution of programs. The O/S provides certain services to programs and the users of the programs. Services provided differ from one operating system to the other. These services are functions that are provided for the convenience of the programmer. This section deals with some of the common services provided by operating systems. Buffering A buffer is high speed storage (memory). An input buffer accepts data from a slow speed device at a slow speed but releases it at high speed to the CPU. An output buffer accepts data at a high (electronic) speed from the CPU and releases it at the slower speed of the output device. A buffer can be a reserved section of primary storage or can be located on the I/O device itself. An area in memory being used for data awaiting processing or output is called a buffer area. Output devices are slow compared to processing so in order to keep the CPU busy with processing and not waiting on an output device to finish before it can move on, the data is put in a buffer (in fraction of the time) rather than being put straight to a slow output device. The CPU can then move on to do other things. Buffering is therefore the solution to the slowness of I/O devices. It attempts to keep both the CPU and the I/O devices busy all the time. After data is read and the CPU is about to operate on it the input devices are instructed to begin the next input immediately. The CPU and input devices are therefore both busy. Data is put into a buffer (memory) until the output device can accept it. Spooling (Simultaneous Peripheral Operation On-Line) This method was invented at Manchester University in England. It puts the output to the disk in the form of a spool file instead of to the printer. It therefore uses the disk as a very large buffer. The problem with tape systems is that the card reader could not write onto one end of the tape while the CPU read from the other, the entire tape had to be written before it was rewound and read. Disk systems eliminated that problem. In disk systems, cards are read directly from the card reader onto the disk. The location of the card is recorded in a table and is kept by the operating system. Requests for card reader input, is satisfied by reading from the disk. By moving the read/write head from one area of the disk to the other, the disk can rapidly switch from one card to another. Similarly when a job requests printer output, the print line is copied into a system buffer and written to the disk. When the job/program is completed then the output is actually printed. The CPU is therefore free to carry on with other work while the spool file is being created.Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

25

Other Services Program execution The operating system loads a program into memory and runs it. The program must be able to end its execution, either normally or abnormally. Input/Output Operations A user program cannot execute I/O operations directly, the operating system must provide some means to do so. File System Manipulation Programs need to read from and write to files, the operating system should allow creation and deletion of such files. Deadlock Prevention/Recovery This is a situation where waiting processes stay permanently in a wait state because other waiting processes are holding the resources that they have requested. To prevent deadlock, or recover from one, the operating system may take resources from a job (i.e. Pre-emption of resources, terminate process). Example:- If there are 4 tape drives and 2 processes and each process holds 2 tape drives but needs 3, then each will wait for the other to release its tape drives, which will never happen unless the operating system steps in. Deadlock prevention - ensure that at least one of the following conditions does not hold. All 4 conditions must exist for deadlock to occur. 1. mutual exclusion - must hold for non sharable resources (e.g. A printer cannot be shared simultaneously). Each resource is either currently assigned to exactly one process or is available. (a read only file is sharable) 2. Hold and wait - when a process requests a resource it does not hold another resource. One protocol is that the job requests all the resources that it needs at the start. Another protocol allows a request from a job only when it has no resources. Processes currently holding resources granted earlier can request new resources.Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

26

3. No pre-emption (No taking away) - of resources that have already been allocated. Resources previously granted cannot be forcibly taken away from a process. They must be explicitly released by the process holding them. 4. Circular wait - each job is assigned a number as to who gets a resource next (linear ordering - each process can request resources only in increasing order). There must be a circular chain of two or more processes, each of which is waiting for a resource held by the next member of the chain. Error Detection/Troubleshooting The operating system constantly needs to be aware of possible errors. Errors may occur in the CPU, memory, jam in the card reader etc. The operating system should be able to take the appropriate action. Resource Allocation This is due to multiple users or multiple jobs running at the same time. Accounting To keep track of which users use how much of what kinds of computer resources. Protection So that one job does not interfere with the others. To reconcile conflicting demands. Tutorial Questions 1. State three (3) functions of an operating system. 2. With the aid of a diagram, name and discuss a method by which the operating system is able to correct the imbalance between the speed of the CPU and the I/O devices. 3. How does buffering differ from spooling? 4. List examples of deadlock which are not related to a computer system environment. 5. Describe the conditions for deadlock. 6. Describe how the bankers algorithm works. 7. What are some of the services provided by an operating system? Practice MCQs 1. All of the following are conditions for deadlock except: a) Circular wait b) Pre-emption c) Hold and wait d) Mutual exclusion 2. All of the following are services provided by an operating system EXCEPT: a) File system management b) Buffering c) CPU schedulingOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

27

d) Record management 3. One of the services provided by an operating system is deadlock prevention. What is deadlock? a) A user is locked out of a program due to insufficient authority levels b) A job recovers from hanging and reboots slowly c) A job is in a permanent wait state due to another job holding a needed resource d) A computer hangs because the kernel is overwritten 4. ____________ allows you to send a second job to the printer without waiting for the first job to finish printing. A. Spooling B. Paging C. Thrashing D. Scheduling 5. A __________ is an area of memory or storage in which data and information is placed while waiting to be transferred to or from an input or output device. A. RAM B. buffer C. cache D. registers

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

28

Lecture 3 - Software and Firmware (1/2 hour)This topic is mostly revision as it was already covered in the course Fundamentals of Information Technology. Software is a collection of machine interpretable instructions that define the activities related to performing a specific task by computer. In other words software is any instruction that tells the computer what to do. There are two types of software: system software and application software. System Software There are two types of system software: operating system and utility. As mentioned before, an operating system consists of the programs that control or coordinate the operations of a computer and its devices. Operating systems tell the computer what to do and how to do it, when to do it. Examples include: Microsoft Windows XP, Linux, Unix, OS/2, DOS etc. Utilities provide a useful service to the user by providing facilities for performing common tasks. The following are examples of utilities: File viewer Displays the contents of a file. E.g. Quickview in Windows. File compression Reduces the size of a file usually to a ZIP extension. E.g. PKZIP, WinZip, WinRAR. Diagnostic utility Compiles technical information about your computer hardware and reports physical and logical problems. Example of a physical problem scratch on disk. Example of a logical problem corrupted file. E.g. Scandisk, Norton disk doctor. Defragmenter Reorganizes files and unused space on a disk so that data can be accessed quickly and programs run faster. E.g. defrag in Windows Backup Copies selected files to another disk/tape. It alerts you if an additional disk is needed. The opposite RESTORE utility should also exist in order to recover the files in case of loss/damage. E.g. MSBACKUP, NovaBACKUP Anti-virus Prevents, detects, removes viruses from a computer system. E.g. Norton Anti-virus, McAfee, Trend Micro PC-cillin, AVG etc. Application software Application software is designed to fulfil a specific set of activities. Examples include: accounting, word processing, banking, graphics, database management, spreadsheet. Application software is the users reason for using the computer. We do not use the computer because we want to use Microsoft Windows 7, we use the computer to type documents, create graphs, enter data into a database, do our accounting, draw pictures, play games etc. The software that allow us to do these things are application software. The following are examples of types of application software:Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

29

Word-processing Allow easy creation, editing, correction, printing of documents. Features include:- Bold, underline, margins, spell check, print, page number, justify, footnotes, table of contents, font size and type, mail merge, save. E.g. Microsoft Word, WordPerfect, Wordstar, WordPad, AmiPro Spreadsheets Designed to manipulate numeric data in a tabular form. This is the electronic equivalent to accountants ledger - a large piece of paper divided into columns and rows into a grid of cells. User can enter numbers, formulas, text in each cell. E.g. Visi-Calc, Lotus 1-2-3, Symphony, Microsoft Excel, Quattro Pro, Multiplan Database Management Information is vital to business. A database is a collection of organized of information stored in a way that makes it easy to find and present. Database management software allows you to create and maintain a database. Field, fieldtype, keys, fieldsize. Can sort, query. E.g. Foxpro, Oracle, Dbase, Microsoft Access Desktop Publishing To produce documents, newsletters, posters. Combine word processing and graphics packages. E.g. Page Maker, Microsoft Publisher Graphics Provide facilities that allow user to do various kinds of computer graphics. Requires a lot of main memory and usually special circuit board (graphics card) and a high resolution screen. E.g. Corel Draw, Adobe Photoshop Programming languages/program development software Used to create programs. People called programmers use programming languages to tell the computer what to do. Hundreds of programming languages or language variants exist today. Most were developed for writing specific types of applications. However, many companies insist on using the most common languages so they can take advantage of programs written elsewhere and to ensure that their programs are portable, which means that they will run on different computers. E.g. Foxpro, C, C++, Pascal, Visual Basic, COBOL etc. Communication Software This is any program that a) helps users establish a connection to another computer or network or b) manage the transmission of data, instructions, and information or c) provide an interface for users to communicate with one another. Communication software allows users to send messages and files from one location to another. E.g. Network Operating Systems (NOS), Web Browsers, Outlook Express, Netscape Navigator, Outlook (Email), etc. Entertainment software These software include games, software that allows you to listen to music of watch movies. E.g. Windows Media Player, Chess, Monopoly, Solitaire etc.Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

30

Integrated Packages Collections of packages which have been designed to be used together. E.g. Spreadsheet data might be easily fed into a database or displayed in a diagrammatic form using a graphics package. E.g. Microsoft Office, Lotus Smartsuite, Corel Wordperfect Suite, Open Office. Firmware Firmware is also known as micro-code or micro-program. This is software embedded in hardware. This is made with CMOS (complementary metal-oxide semiconductor) technology. Firmware are programs held in ROM (i.e. hard-coded in the hardware). They are stored permanently in ROM and are ready when the computer is switched on. When you turn on a computer the first thing that tells the computer what to do is firmware. Firmware therefore facilitates booting. When the computer is switched on a control signal is sent to the microprocessor which causes it to reset its current instruction register to the location address of a firmware instruction. E.g. location 0. The processor immediately starts to execute the instruction in firmware. The reset control signal takes place as part of the switching on operation. On a small microcomputer based system the firmware ROM normally containing a special loader program to load a program into memory from the floppy disk. Normally a special control program is loaded which in turn loads and runs a program called a command interpreter or shell. On smaller machines the 2 programs may be combined into a single program called a monitor. When you turn on a computer: Run BIOS programs (basic input output system) checks hardware - monitor, keyboard, mouse, hard disk, diskette drive, memory, cd-rom drive, printer port, serial ports (modem) Loads operating system (usually independent of the machine) must look at particular address (ie goes to booting device) For PCs operating system must be on track 0, sector 0 of boot disk. For mainframes etc. the area on device is specific to the manufacturer. Tutorial Questions 1. Differentiate between system software and application software. 2. Identify the type of application software that would be best suited in the following situations. Give examples of the type chosen. a) Preparing a letter to a customer. b) A teacher calculating student grades. c) A financial controller making a speech to the shareholders of a company. d) A human resource manager who wants to perform various queries on employee data. e) A publishing house who wants to produce a magazine. 3. How does a word processor (e.g. MS-Word) differ from a text editor (e.g. Notepad)?Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

31

4. 5. 6. 7. 8.

What are the utilities that you have used? Comment on them. Do some research and describe other popular utilities. How does software differ from firmware? Give examples of how firmware is used. Research the various web browsers. [Make sure that you include the ones made for mobile devices]

Practice MCQs 1. The utility that is always provided with a backup utility is a. Scandisk b. Restore c. Anti-virus d. Defrag 2. Which of the following is TRUE about application software? a) It provides a user interface b) It allows the user to perform a specific task c) It is in charge of the utility programs d) It controls the hardware 3. What are the two types of system software? a) Application software and operating system b) Utility and application software c) Utility and operating system d) Special purpose and general purpose 4. Which of the following types of system software provides a maintenance function? a) Application software b) Utility c) Operating system d) Special purpose 5. All of the following are TRUE statements about firmware EXCEPT: a) Assists in the booting process b) Programs held in the boot sector c) Forms a part of the operating system d) Programs held in ROM chips 6. ______________ consists of programs that control the operations of the computer and its functions. A. Application software B. System software C. Utilities D. Antivirus softwareOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

32

7. ____________ utility compiles technical information about a computers hardware and certain system software programs and then prepares a report outlining any identified problems. A. Disk cleanup B. Disk scanner C. Disk defragmenter D. Diagnostic 9. ____________ is a utility that reorganizes the files and unused space on a computers hard disk so that data can be accessed more quickly and programs can run faster. A. Disk defragmenter B. Disk scanner C. Diagnostic utility D. Disk cleanup

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

33

Lecture 4 - File concepts (1 hour)Files store data and programs. A file is a named collection of related information usually saved on secondary storage. It is a logical storage unit, abstracting out the physical properties of the storage device. The operating system implements the abstract concept of a file by managing storage devices such as tapes and disks. Files are normally organized into directories (folders) for ease of use. For convenient use the operating system provides a uniform logical view of information storage. The operating system abstracts from the physical properties of its storage devices to define a logical storage unit, the file. A file is a collection of related information. It is a sequence of bits, bytes, records. A file is named and is referred to by its name. It has other properties such as its type, date and time of creation, its length etc. A file is a logical entity which represents a named piece of information. It is mapped onto a physical device. Common File types:text file - sequence of characters organized into lines (and possibly pages) - TXT source file - sequence of subroutines and functions object/executable file - sequence of words organized into loader record blocks EXE, COM graphics files - JPG, BMP, TIF database file MDB, DBF etc. File Attributes A file has the following attributes: Name a string of characters that identifies the file. Type some operating systems support different file types and handles them differently Location information on the device and location of the file data Size current size of the file (in bytes) Various dates date created, last modified, last accessed Protection access control who is allowed to read, write, execute Ownership who owns the file. The owner decides on the file operations allowed and by whom. A file attribute (or just attribute) is a specific condition in which a file or directory can exist. It is a characteristic of a file. Examples include read-only, hidden, compressed, system, archive. In MS-DOS, OS/2 and Microsoft Windows the attrib command can be used to change and display file attributes. File attributes are maintained in the directory structure. A read-only file is any file with the read-only attribute turned on. A read-only file can be viewed, but not changed. In other words, "writing" to the file is disabled. A file with the readonly attribute turned on can be opened and accessed normally by your computer. Read-only files can be deleted and moved, but Windows will prompt you with a special dialog box asking you to confirm that you want to move or delete the read-only file. Some common files that are readonly by default in Windows include boot.ini, io.sys, msdos.sys.Operating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

34

A hidden file is any file with the hidden attribute turned on. Most Windows powered computers are configured by default not to display hidden files in normal file searches. Files marked Hidden and System do not normally display unless the file manager option to display them is selected. Any file can be marked as Hidden; however, operating system and other control program files are marked as System files as a means of identification. The most popular hidden files you might encounter in a Windows system include msdos.sys, io.sys and boot.ini. A compressed file is any file with the compressed attribute turned on. Most Windows computers are configured by default to display compressed files in blue text in normal file searches and in folder views. Setting the compressed file attribute on a file will reduce the size of the file but will allow Windows to use the file just as any other. However, working with a file that is compressed will use more processor time than working with an uncompressed file because Windows has to decompress and then recompress the file during use. Since most computers have plenty of hard disk space, compression isn't usually recommended, especially since the trade off is an overall slower computer thanks to the extra processor usage needed. A system file is any file with the system attribute turned on. Most Windows computers are configured by default not to display system files in normal file searches or in folder views. The most popular system files you might encounter on a Windows computer include msdos.sys, io.sys, ntdetect.com and ntldr. An archive file is any file with the archive attribute turned on. The archive attribute is used for backup. Many files that you'll encounter in normal computer use will likely have the archive attribute turned on. The archive attribute is usually turned on when a file is created or modified. Once the file is backed up by a backup program, the archive attribute is turned off. This way, the backup program can use the archive attribute to determine which files have changed and need to be backed up and which have not changed and do not need to be backed up. File Operations A file is a means of storing information for later user. Some of the things we would want to do are: create a file, write to the file, rewind the file, read from the file, delete the file edit/modify the file, append new information to the file create a copy of a file, copy file to an I/O device (printer, display), rename a file etc. What the Operating System must do for each of the 5 basic file operations NB. Before you can use a file you must Open it. To avoid constant searching most operating systems keep a table of open files. When finished with a file Close it. 1. Open a file Check permissions, Return integer (file descriptor) if permitted, Return error code if not. 2. Creating a fileOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

35

Find space on the file system, Make an entry in the directory (directory entry records name/location of file) 3. Writing to a file (must be opened as output) 1. system call must specify name of file and the information to be written, 2. system searches directory to find location of file, 3. directory entry has stored a pointer to current end of file using this pointer the address for the next block is computed and the information can be written, then the write pointer is updated. 4. Reading a file (open as input) specify name. System specifies where in memory the next block of the file should be put. When the next block is to be read the pointer to next block is updated. 5. Delete Release file space and erase the directory entry so that it can be reused by other files. Other file operations include: Rewind (only with tapes) Current file position pointer is reset to the beginning of the file. Seek Repositions the location pointer for the file. Truncate Maintains file attributes but erases the content of the file. Append Writes information to the end of the file. Tutorial Questions 1. Describe five file attributes. 2. Describe five file operations. 3. Suppose systems automatically open a file when it is referenced for the first time and close the file when the job terminates. Discuss the advantage and disadvantage of this scheme as compared to the scheme when the user has to explicitly open and close the file. 4. Make a list of as many file types that you can (e.g. doc, com, exe, jpg, bmp). Describe the type of file. Practice MCQs 1. A file is a) A collection of directoriesOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

36

b) A group of application programs c) A mapping of the physical properties of a storage device to a logical storage unit d) A group of related databases with minimum duplication and redundancy 2. Which of the following is NOT a file attribute? A. Name B. Identifier C. Truncated D. Location

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

37

Lecture 5 - Directory Systems (2 hours)Early file systems were tape based. Each file was implemented by mapping it onto its own reel of tape. The advantage of this approach is simplicity, but it suffers from some inefficiency, since physical tape reels are quite large (e.g. 2,400 feet). Studies showed that most files were small, therefore they would take up a small amount of tape. To handle this problem, systems were created to store multiple files on one tape. There was a problem in determining which files were on which tape. To solve this problem a directory was added to the tape. The directory lists the name and location of each file on the tape. The device directory records information such as name, location, creation date, size and type for all files on that device. Directory structure provides a mechanism for organizing the many files on the file system. A file can be on more than 1 disk, but the user only has to worry about logical directory and file structure, not physical. A directory is therefore similar to a table of content or index in a text book. The table of content or index is used to location specific chapters or topics. Directory Operations Directory operations are those actions performed on a directory by a user. They include the following: Search for a particular file Create a file Delete a file Rename a file Create directory List directory Traverse the file system Backup

Nowadays, directories are known as folders and are identified by a folder icon . Just think of all of the things that you can do in MyDocuments or Windows Explorer. These are all directory operations. Directory Systems Types of directories/directory structures The term directory system can also be referred to as type of directory or directory structure. A directory structure organizes and provides information about files on the system. This allows the file to be easily located. The following describes the different directory systems:

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

38

Single level - the simplest directory structure. All files are in the same directory. All files must have unique names. It is easy to support and understand. It however has significant limitations in terms of the naming of a large number of files as well as supporting different users and topics (groups).

Two level There is one master file directory but a separate directory per user. When a user lists the directory he sees only his files. This isolates one user from another. A file name is prefixed by user name. Each entry in the master file directory points to a user file directory. There are limitations in terms of sharing files with other users, system files and grouping files.

Tree- structures - e.g. UNIX, Windows, DOS. Allows users to create their own subdirectories and organize their files accordingly. The tree has a root directory. Every file has a unique path name. A path name is the path from the root through all the subdirectories, to a specified file. In normal use, each user has a current directory. The current directory should contain most of the files that are of current interest to the user. If a file is needed which is not in the current directory, then the user must either specify a path name or change the current directory. Users may also create their own subdirectories. This structure is efficient for searching, grouping and other operations such as deleting.

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

39

EXAMPLE OF A TREE DIRECTORY STRUCTURE

The diagram shows that the path to file D is ROOT\DIRECTORY2\DIRECTORY2A Acyclic Graph - A shared directory or file exists in the file system in two (or more) places at once. NB. It is not the same as two copies. This occurs in cases where two users need to use a common directory as their own directory. This directory system therefore allows for the sharing of directories and files. The same file may be in two different directories (i.e. can be access through more than one path). Changes made by one user to the file are viewed immediately by the other user. Note that files have multiple path names, therefore distinct file names may refer to the same file.

EXAMPLE OF AN ACYCLIC GRAPH DIRECTORY STRUCTURE

The diagram shows that file D has multiple paths which are:ROOT\DIRECTORY2\DIRECTORY2A and ROOT\DIRECTORY1 There are different ways in which acyclic graphs (shared files and directories) are implemented. The following is an example using Unix. Symbolic linksOperating System Concepts Mrs. G. Campbell Copyright @ 2010 Updated Jan 2010

40

A different type of a directory entry (other than a file or a directory) Specifies the name of the file that this link is pointing to Can be relative or absolute. Problem: What happens when the original file is deleted?

Duplicate directory entries (also called hard links) The original and copy entries are the same Problem: What happens when one deletes the original or copy entries? Tutorial Questions 1. Research the General-Graph directory. How does it deal with the problems of the acyclic graph directory? 2. Differentiate between the tree structure and the acyclic structure. 3. Research on the various filing systems (such as FAT, HPFS, NTFS). 4. Compare and contrast FAT with NTFS. Practice MCQs 1. A two-level directory structure a) Has a root directory and two subdirectories b) Is the most complex directory structure c) Has two files in each directory d) Has a separate directory per user 2. Which of the following directory systems have a separate directory for each user? a) Single level b) Two level c) Tree d) Acyclic 3. Which of the following directory systems allow files to be in more than one directory at the same time? a) Single level b) Two level c) Tree d) Acyclic 4. All of the following are TRUE for the tree structure EXCEPT: a) Files are organized into directories and sub-directories b) Changes made by one user of the file is viewed immediately by the other user c) Every file has a unique path name d) Duplicate file names are seen as different files

Operating System Concepts Mrs. G. Campbell Copyright @ 2010

Updated Jan 2010

41

Lecture 6 - Multi-programming and TimeSharing (1 hour)Multi-programming A single user cannot keep either the CPU or the I/O devices busy at all times. Multiprogramming or multi-tasking is an attempt to increase CPU utilization by always having something for the CPU to execute. The basic idea is that the operating system picks one of the jobs in the job pool and begins to execute it. Eventually the job may have to wait for something (e.g. a tape, keyboard input etc.). Normally the CPU would sit idle. In a multi-programmed environment the operating system would switch to another job. By switching between processes the operating system can make the computer more productive. This is also called concurrent processing. The basis of the multi-programmed operating system is that by switching between jobs the CPU becomes more productive.

Process State Diagram

Updated Process State Diagram

While one job is waiting (e.g. for an I/O device), another job can be using the CPU. The operating system picks one of the jobs in the job pool (ready queue) and begins to execute it. Eventually the job may have to wait for something, normally the CPU would sit idle, but in a multi-programmed environment the CPU will switch to another job. Memory management software keeps track of the jobs being run, the current instruction, variables, file pointers, addresses etc. (i.e. Process images) so that movement between the disk and main memory isOperating System Concepts Mrs. G