Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet121/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   117   118   119   120   121   122   123   124   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

Name
Use
accept, bind
Accept a network socket connection, bind a name to a socket
access
Check user’s permission of a file
chdir
Change working directory
creat
Create a file (or device)
create_module
Create a loadable module entry
execve, execp, execl, and so on
Execute a program
exit
Terminate the calling process
fork, vfork
Create a child process, vfork further blocks the parent
getpriority/setpriority
Return or set process-scheduling priority
getuid/setuid
Return or set a user ID
kill
Send a signal to a process (depending on the signal, it might terminate 
the process or might cause exception handler to be invoked)
mknod
Create a file (or device or named pipe)
mmap
Map (or unmap) files/devices into memory (in essence, place a new 
process into an area of memory, or remove it from memory)
mprotect
Set protection on an area of memory
open, close
Open, close a file
pause
Suspend a process until signaled
pipe
Create an interprocess channel for communication
read, write
Read from or write to an open file
wait
Wait for the process to change state before continuing


Installing Linux

319
side (running applications) and the kernel side is handled through system calls. Through 
the system calls, running processes are able to communicate requests for process manage-
ment, memory management, I/O, and interprocess communication to the kernel.
Early operating systems used a monolithic kernel but one that was rather small because 
computer memory was limited and operating systems of that era were not asked to do a lot. 
As computer capabilities grew, operating systems became larger and monolithic kernels 
became more and more complex.
A reaction to the complexity of the monolithic kernel was the development of the 
micro-
kernel
, starting in the 1980s. In this approach, the operating system contains a smaller ker-
nel, which operates within privileged mode and in its own address space. To support the 
expected range of functions, the operating system is extended by a number of subsystems 
referred to as 
servers
. Servers operate with user applications using user mode and the user 
section of memory’s address space.
Communication between application software and kernel is much like with the mono-
lithic kernel, but the kernel then calls upon servers to handle many of the operations. Thus, 
the microkernel involves a far greater amount of system calls as the servers are separate 
from the kernel.
Among the server components are file system servers, network servers, display serv-
ers, user interface servers, and servers that can directly communicate with device drivers. 
Remaining in the kernel are the process scheduler, memory manager (including virtual 
memory), and the interprocess communication between operating system components. 
One of the most prominent operating systems to use the microkernel is Mach, Carnegie 
Mellon University’s implementation of Unix.
The 
hybrid
kernel compromises between the two extremes where the kernel is still kept 
small, but server-like components are added on. Here, the server components run in kernel 
mode but often in the user’s address space. In this way, processes can call upon the serv-
ers more easily than with the microkernel approach and thus bypass some of the time-
consuming system calls. The small kernel might handle tasks such as interrupt handling 
and process and thread scheduling. The servers, also called 
modules
(as discussed shortly) 
might handle virtual memory, interprocess communication, the user interface, I/O (device 
drivers), and process management.
Windows NT, and later versions of Windows, including Windows 7 and 8 use forms 
of hybrid kernels. The MacOS X and the iOS used on Apple mobile devices combine the 
microkernel of Mach with components from FreeBSD and NetBSD (both descendants 
from Berkeley Standard Distribution) that use a modular kernel and a monolithic ker-
nel, respectively. Thus, the resulting kernel, known as XNU (X is not Unix), is a hybrid 
kernel.
You might wonder what the fuss is about. Those who work with either microkernels or 
hybrid kernels cite that the monolithic kernel is too complicated and large. As the mono-
lithic kernel is essentially one large piece of code, making a minor modification to one 
portion might have completely unexpected impacts on other portions. In fact, it is possible 
that errors may arise that are very hard to identify and locate in the code. This could lead 
to an unstable operating system that yields errors and system crashes for reasons that have 


320

Linux with Operating System Concepts
little to do with the actual modified code. There are also concerns that the monolithic ker-
nel will be inefficient because of its size.
Imagine, for instance, that a programmer modifies a few lines of code that deal with an 
interrupt handler. Unknowingly, the code change impacts some aspect of memory man-
agement. Now, a user is running a program and when virtual memory kicks in, the error 
arises. The programmers cannot identify the cause because there is nothing wrong with the 
memory manager. Tracing it to the changed interrupt-handling code may take a huge effort.
Linux was developed around a monolithic kernel. Andrew Tanenbaum, a computer sci-
entist and author of many textbooks, initially criticized Linus Torvald’s Linux because he 
felt that a monolithic kernel would not succeed with modern computers. This has led to a 
continued debate over which approach is better.
Given the problems with a monolithic kernel, why would anyone want to produce one? 
To improve on the efficiency and reduce the impact of errors of the monolithic kernel, the 
modern monolithic kernel includes numerous 
modules
, each of which implements one or 
more of the core kernel’s responsibilities. Modules are loaded either at kernel initialization 
time, or on demand. Thus, the kernel can itself be modularized. The efficiency of a mono-
lithic kernel’s execution is in part based on the number of modules loaded. Loading fewer 
modules leads to a more efficiently executing kernel. Through modules, the Linux kernel 
can be kept relatively small.
Figure 8.2 illustrates a rudimentary difference between the monolithic kernel and 
microkernel. On the top, the monolithic kernel is large and handles all kernel operations. 
System calls are limited to just the applications software invoking the kernel. On the bot-
tom, the microkernel is smaller and simpler but system calls exist now between the kernel 
and servers as well as between the application software and servers.
8.2.4 Loading and Removing Modules
As a system administrator, you are able to tune the kernel by adding and removing modules. 
This is of course something you would only want to do if you find your Linux-operating 
Running application
System calls
System calls
Servers
Device drivers
Device drivers
Running application
Kernel
Kernel
Hardware
Hardware
FIGURE 8.2 
Monolithic kernel (top) versus microkernel (bottom).


Installing Linux

321
system is not running efficiently leading you to remove modules or is alternatively lacking 
functionality leading you to add modules. To see the modules that are loaded by default, use 
the command 
lsmod
. This will tell you the modules that are loaded, their size, and what 
software or service might use that module. You can also inspect each individual module 
by using 
modinfo

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   117   118   119   120   121   122   123   124   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish