Page 426 - DCAP103_Principle of operating system
P. 426
Unit 14: Case Study of Linux Operating System
paragraphs indicates that a scheduling decision can be made through access to the appropriate active Notes
list, it can be done in constant O(1) time, independent of the number of processes in the system.
In addition, the scheduler includes features particularly useful for multiprocessor or multicore
platforms. First, the runqueue structure is associated with each CPU in the multiprocessing
platform. The scheduler tries to maintain benefits from affinity scheduling, and to schedule tasks
on the CPU on which they were previously executing. Second, a set of system calls is available
to further specify or modify the affinity requirements of a selected thread. Finally, the scheduler
performs periodic load balancing across runqueues of different CPUs to ensure that the system
load is well balanced, while still meeting certain performance or affinity requirements.
The scheduler considers only runnable tasks, which are placed on the appropriate runqueue.
Tasks which are not runnable and are waiting on various I/O operations or other kernel events
are placed on another data structure, waitqueue. A waitqueue is associated with each event
that tasks may wait on. The head of the waitqueue includes a pointer to a linked list of tasks
and a spinlock. The spinlock is necessary so as to ensure that the waitqueue can be concurrently
manipulated through both the main kernel code and interrupt handlers or other asynchronous
invocations.
In fact, the kernel code contains synchronization variables in numerous locations. Earlier Linux
kernels had just one Big Kernel Lock (BLK). This proved highly inefficient, particularly on
multiprocessor platforms, since it prevented processes on different CPUs to execute kernel code
concurrently. Hence, many new synchonization points were introduced at much finer granularity.
Self Assessment
Multiple choice questions:
1. A command line interface is called ..................... .
( a) Shell (b) kernel
( c) Linux (d) None of these
2. The forking process is called the ..................... .
( a) Memory management (b) Parent process
( c) Loading process (d) None of these
Fill in the blanks:
3. The function of Linux system is to ..................... the hardware.
4. A full desktop environment contains a ..................... which controls the placement and
appearance of window.
5. To make it easy to specify multiple file names, the shell accepts ..................... .
14.3 Booting Linux
Details vary from platform to platform, but in general the following steps represent the boot
process. When the computer starts, the BIOS performs Power-On-Self-Test (POST) and initial
device discovery and initialization, since the OS’ boot process may rely on access to disks,
screens, keyboards, etc. Next, the first sector of the boot disk, the Master Boot Record (MBR) is
read into a fixed memory location and executed. This sector contains a small (512-byte) program
that loads a standalone program called boot from the boot device, usually an IDE or SCSI disk.
The boot program first copies itself to a fixed high memory address to free up low memory for
the operating system.
LOVELY PROFESSIONAL UNIVERSITY 419