Operating System Principles - 1


INDEX

Chapter 1: OVERVIEW 4

1.1 Introduction 4

1.1.1 What is an operating system? 4

1.1.2 Simple batch processing systems 7

1.1.3 Batch and multiprogramming systems 8

1.1.4 Time division systems 9

1.1.5 Personal computer systems 11

1.1.6 Parallel systems, distributed systems, real-time systems 11

1.2 Operating system structure 15

1.2.1 System components 16

1.2.2 Operating system services 22

1.2.3 System Call 24

1.2.4 System programs 25

1.2.5 System structure 26

1.2.6 System installation and design 33

Chapter 1 Questions and Exercises 35

Chapter 2: PROCESS MANAGEMENT 36

2.1 Progress 36

2.1.1 Process concept 36

2.1.2 Process Scheduling 39

2.1.3 Operations on process 45

2.1.4 Interprocess Cooperation 49

2.1.5 Stream 52

2.1.6 Interprocess Communication 70

2.2 CPU Scheduling 74

2.2.1 Basic concepts 74

2.2.2 Scheduling criteria 78

2.2.3 Scheduling algorithms 79

2.2.4 Algorithm Evaluation 95

2.3 Synchronizing the 96 process

2.3.1 Facility 96

2.3.2 Critical Problem - Session 99

2.3.4 Classical problems in synchronization 114

2.4 Deadlock 126

2.4.1 Model 126

2.4.2 Characterizing deadlock 128

2.4.3 Methods of dealing with deadlock 132

2.4.4 Avoiding deadlock 136

2.4.5 Deadlock Detection 144

2.4.6 Recovering from Deadlock 148

Chapter 2 Questions and Exercises 150

Chapter 3: STORAGE MANAGEMENT 155

3.1 Memory Management 155

3.1.1 Facility 155

3.1.2 Physical memory and logical memory 160

3.1.3 Swap 161

3.1.4 Continuous allocation 163

3.1.5 Pagination 172

3.1.6 Segment 188

3.2 Virtual Memory 198

3.2.1 Facility 198

3.2.2 Paging on request 201

3.2.3 Performance of demand paging 205

3.2.4 Replace page 205

3.2.5 Replacement algorithms page 207

3.2.6 Frame allocation 215

3.2.7 Thrashing 218

3.2.8 Other issues 220

3.2.9 On-demand segmentation 221

3.3 File system interface 225

3.3.1 File concept 225

3.3.2 Access methods 229

3.3.3 Directory structure 231

3.3.4 Protection 243

3.3.5 Semantic consistency 246

3.4 File System Settings 246

3.4.1 File system structure 247

3.4.2 Allocation methods 249

3.4.3 Idle space management 260

3.4.4 Setting up the 262 directory

3.4.5 Efficiency and performance 264

3.4.6 Restore 265

Chapter 3 Questions and Exercises 265

Chapter 4: INPUT OUTPUT SYSTEM 271

4.1 Input and output system 271

4.1.1 Overview 271

4.1.2 Hardware input/output 272

4.1.3 Input/output programming interface 275

4.1.4 Input and output system of kernel 277

4.1.5 Converting input and output requests into hardware operations 281

4.1.6 Performance 283

4.2 Secondary storage structure 285

4.2.1 Disk structure 285

4.2.2 Disk Scheduling 286

4.2.3 Disk Management 290

4.2.4 Swap space management 292

4.2.5 Disk reliability 292

4.2.6 Setting up a stable storage system 294

4.2.7 Tertiary storage devices: Operating system tasks and performance issues 294

Chapter 4 Questions and Exercises 297

REFERENCES 300

Chapter 1: OVERVIEW

1.1 Introduction

An operating system is a software program that manages a computer's hardware. It provides a platform for application programs and acts as an intermediary between the computer user and the computer's hardware. Operating systems perform a wide variety of tasks, some are designed to perform a specific task while others are designed to be general-purpose.

1.1.1 What is an operating system?

An operating system is an important component of every computer system. A computer system can be divided into four components: hardware, operating system, application programs, and users.

- Hardware : includes central processing unit (CPU), memory, input/output devices (I/O),... providing basic resources for the system.

- Application programs : compiler, text editor, database system, web browser,... support users in using resources and solving user requests.

- User : is the person who uses the system, different users perform different requests using different applications.

- Operating system : also known as system program, controls and coordinates the use of hardware between different application programs for different users. The operating system can be exploited from two sides: user and system.

User 1

User 2

User N



Compliler Text editor Database System and application programs


Operating




Hardwave






Maybe you are interested!

Operating System Principles - 1

System

Figure 1.1 Components of a computer system

+ User vision

The user's perspective on computers is varied by the interface used. Most computer users sit in front of a personal computer consisting of a monitor, keyboard, mouse, and system unit. Such a system is designed for a single user to exclusively utilize its resources to optimize the task the user is performing. In this case, the operating system is designed for ease of use with less concern for performance than for resource utilization.

Some users are sitting at terminals connected to a mainframe or minicomputer. Others are accessing the same computer through other terminals. These users share resources and can exchange information. The operating system is designed to optimize resource utilization to ensure that all CPU, memory, and I/O device time is used efficiently and fairly.

Recently, portable computers have become widely used. These devices are used by individual users only. Some of these computers are connected to a network either directly by network cable or through wireless modems. Because of the limited power, operating systems are designed to maximize the computer's energy efficiency.

Some computers have little or no user interface. For example, computers embedded in home appliances and cars may have a dial pad and lights to show whether they are on or off, but most computers and operating systems are designed to control the device without interacting with the user.

+ System vision

We can see an operating system as a resource allocator. A computer system has many resources - hardware and software - that can be requested to allocate resources: CPU time, memory space, file storage space, input/output devices, etc. The operating system acts as a resource manager, handling a large number of potentially conflicting requests for resources, and must decide how to allocate resources to specific programs and users in order to operate the computer system efficiently and fairly.

Another view of the operating system emphasizes the need to control the various input/output devices and user programs. An operating system is a control program. The control program manages the execution of user programs to prevent errors and misuse of the computer. It is particularly concerned with the manipulation and control of input/output devices.

In general, there is no complete definition of an operating system. Operating systems exist because they are a reasonable way to solve the problem of creating a usable computer system. The basic goal of a computer system is to execute user programs and solve problems to make it easier for users to use the computer system. Towards this goal, computer hardware is built. However, hardware alone does not make it easy to use and develop application programs. These different application programs require certain common operations, such as controlling input/output devices. These common functions of control and resource allocation are then put together in a piece of software called an operating system.

The main purpose of an operating system is to make it easier for users to use the computer system. Because the existence of an operating system greatly assists the computer in responding to user applications. This is especially evident when considering the operating system on personal computers.

The second goal of an operating system is to operate the computer system efficiently. This goal is especially important for large, shared, multi-user systems. These systems are typically quite expensive, and getting the most out of them is always desirable. However, the two goals of usability and efficiency are sometimes in conflict. In the past, efficiency was often considered more important than usability. Therefore, operating system theory focused more on optimizing the use of computing resources. Operating systems also evolved over time. For example, UNIX started with a keyboard and printer as its interface limited its usability to the user. Over time, hardware changed and UNIX was attached to new hardware with more user-friendly interfaces. Many graphical user interfaces (GUIs) were added to allow for greater usability while still maintaining efficiency.

1.1.2 Simple batch processing systems

Mainframe computer systems were the first computers used to handle commercial and scientific applications. In this section, we trace the evolution of mainframe systems from batch systems, in which the computer ran one—and only one—application, to time-shared systems, which allowed users to interact with the computer system.

Early computers were very large machines and ran from a console. Common input devices were card readers, disk drives, and tape. Common output devices were line printers, disk drives, and punched cards. Users did not interact directly with the computer system. Instead, users prepared a job—a program, data, and control information about the nature of the job.

– then send it to the computer operator. This is usually done on punch cards. After a while (minutes, hours or days), the resulting data appears.


Operating system

The operating systems in these early computers were relatively simple. Their main task was to automatically transfer control from one task to another. The operating system was always resident in memory.


User program area

Figure 1.2 Memory arrangement for a simple batch system

To speed up processing, the operator “bundles” jobs with similar requirements and runs them through the computer as a group. So programmers would give their programs to the operator. The operator would arrange the programs into “bundles” with similar requirements and run each of these bundles as the computer became available. The output from each job would be sent back to the respective programmer.

In this implementation environment, the CPU is always idle because the speed of mechanical I/O devices is usually slower than the speed of electronic devices. A slow CPU can execute thousands of instructions per second, while a fast card reader can only read 1200 cards per minute (or 20 cards per second). Therefore, the difference between the CPU speed and its I/O devices can be 3 times or more. Over time, advances in technology lead to faster I/O devices. However, CPU speeds increase at a much greater rate, so the problem is not solved but rather increases.

Magnetic disk technology allows the operating system to store all jobs on a single disk instead of storing them in a sequential card reader. With direct access to multiple jobs on a magnetic disk, the operating system can perform job scheduling, making more efficient use of resources and performing jobs.

1.1.3 Batch and multiprogram processing systems

A very important issue in job scheduling is multiprogramming. Normally, a user wants to keep the CPU and I/O devices busy, maximizing the performance of the hardware. Multiprogramming increases CPU utilization by organizing jobs so that the CPU always has something to do.

The idea of ​​multiprogramming can be illustrated as follows: at any given time, the operating system holds several jobs in memory. This set of jobs is a subset of the jobs held in the work pool - because the number of jobs that can be held in memory at the same time is usually smaller than the number that can be held in the buffer pool. The operating system will fetch and start executing one of the jobs in memory. When a job has to wait for some task such as an I/O operation to complete, in a single-programming system the CPU will be idle, and in a multiprogramming system the operating system will switch to executing another job. Eventually the first job finishes waiting and gets the CPU to continue. As long as there is at least one job waiting to be executed, the CPU will never be idle.

Comment


Agree Privacy Policy *