1) The document discusses various concepts related to operating systems including system calls, processes, memory management, file systems, interprocess communication, and more.
2) It compares and contrasts different operating system designs such as microkernels versus monolithic kernels, and discusses features of mobile operating systems like Android and iOS.
3) The document is a chapter from a textbook or course, providing definitions and explanations of core operating system concepts. It examines both low-level system components and higher-level aspects.
1. 1 | P a g e
Chapter One
Solved by Navid Daneshvaran, Software Engineering Student at Kharazmi University, Tehran
Please tell me if you see mistakes in solving problems
Contact Info:
E-Mail: nd.naviddaneshvaran@gmail.com
2.1
When an application wants to access the services that are provided by operating system,
application uses system call to tell the operating system to access to these services.
2.2
1. Creation and deletion of processes
2. Suspension of processes
3. Process synchronization
4. Process communication
5. Deadlock handling
2.3
1. Keep track of which portion of the memory is being used and by which process
2. Which job must be loaded into memory?
3. Allocate and free memory
2.4
1. Free-space management
2. Storage allocation
3. Disk scheduling
2. 2 | P a g e
2.5
The purpose of command interpreter is to get and executes the command of the users. It is
separated from the kernel, because command interpreter itself has its implementation code for its
command and isn’t related to kernel and must to be changed.
2.6
First system call must end the currently process and second system call must start executing of
new process.
2.7
System programs give service to application program and communicate with operating system to
get services.
2.8
Advantage: The maintains and debugs of layered approach is much easier
Disadvantage: The implementation of layered approach is more complex
2.9
Program execution: The operating system loads programs to memory and allocates CPU to them.
It is not reliable to do these work by user-level program.
I/O Operation: Disks, tapes, and other I/O devices needs to access and communicate very low-
level. The user choose the devices and do its work on it and operating system manage this low-
level communication. We can’t trust to user level programs to do these works.
File-system manipulation: There are many work to do including creation, deletion, naming and
etc. for files. There must be a mechanism to allocate and deallocate space to these blocks for files
and it is not trusted for application program to do these works.
Communication: The packets must be sent to network and transmitted across a communication
medium and all these works can’t be done by application program.
Error detection: Software and hardware errors must be tracked by the operating system and it
handles them.
3. 3 | P a g e
2.10
In smartphones and PDAs, we don’t have a disk with file system, therefor we put operating
system on the firmware.
2.11
If we have several operating system, a program that is called boot manager in the start-up must
be executed. It choose which system to boot. Also if we have only one operating system, it sets
default boot to start.
2.12
System programs: Provides a convenient environment for program development and execution.
Some of them are simply user interfaces to system calls.
System calls: Provides services to application programs and communicates with operating
system.
2.13
1. Pass the parameters in registers.
2. If parameter is more than register, it is stored in a block or table in memory and the address of
the block is passed as a parameter to register.
3. Parameters can be placed, or pushed onto the stack by the program and popped of the stack by
the operating system.
2.14
Profiling, which periodically samples the instruction pointer to determine which code is being
executed, can show statistical tends but not individual activities. Code can be included in the
kernel to emit specific data under specific circumstances, but that code slows down the kernel
and tends not to be included in the part of the kernel where the specific problem being debugged
is occurring.
2.15
1. Create file, delete file
2. Open file, close file
4. 4 | P a g e
3. Read file, write file
4. Reposition file
5. Get file attribute, set file attribute
2.16
Advantage: The system calls that are used by file management, can be used by device
management so it isn’t necessary to design a new system call and with interface user assume that
device and files are the same although the underlying process may be different.
Disadvantage: For devices it can be contention or deadlock.
2.17
In command interpreter when we command, in the operating system related system calls are
called so we can’t directly use system calls in the command interpreter.
2.18
There two model for interprocess communication: message passing model and shared-memory
model. In message passing each of the process interconnect with each other and for
communication, first of all must a connection be opened. In shared-memory model a common
memory for process is considered and if one process wants to send message, first stores its
message to shared-memory.
2.19
Mechanism determines how to do something. Policy determines what will be done.
2.20
If two component exchange data with each other, for example CPU and memory unit. In layered
structure when one layer is higher than other layer, higher level use the services provided by
lower level but lower level independent from higher level, so in that situation layered structure is
difficult.
5. 5 | P a g e
2.21
Advantage: Because kernel is smaller the development and extension of the kernel is easier, it
has more security because most of services are in user space.
Disadvantage: The performance of the operating system is lower because some services are in
the user space.
The interaction with microkernel is performed by message passing.
2.22
This more efficient than microkernels because it uses services when needed it also uses layered
approach concepts that makes its debugging easier
2.23
Similarity: both use layered structure for operating system.
Difference: iOS is close-sourced but Android is open-sourced. iOS language is Objective-C
(Now is Swift) But Android is Java.
2.24
Android has its own virtual machine that is called Dalvik and it is designed for devices with
limited memory and CPU processing capabilities.
2.25
The performance of the Synthesis operating system is better, because its assembler is placed in
the kernel and parameter passing through layered is deleted but implementing and debugging is
harder.