Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Operating Systems

• Chapter 2:
1- Discuss some of the OS services that provide functions helpful to the user.
➢ User Interface (UI) → as CLI, GUI, touch screen, and batch.
➢ Program execution → where the system must load the program to the
memory and run it.
➢ File-system manipulation → as reading, writing, creating, or deleting files.
➢ Error detection → where the system must be aware of all possible errors.
2- Discuss some of the OS services that ensure the efficient operation of the
system itself via resource sharing.
➢ Resource allocation → when multiple jobs run concurrently, resources
must be allocated to each of them.
➢ Logging → to keep track which users use how much and what kind of
resources they use.
➢ Protection → ensuring that all access to system resources is controlled.
3- What’s the purpose of the Command Line Interpreter (CLI) and why it’s
usually separate from the kernel?
➢ Its purpose is to provide a user interface for executing commands and
interacting with the OS as well as handling errors and exceptions.
➢ It’s usually separate because it allows different types of shells to be used on
the same OS to give the users the flexibility of choosing what suit them.
4- What are the system calls and mention their purpose?
➢ They are low-level functions provided by the OS.
➢ Their purpose is to request services from the OS and allow programs to
interact with the hardware and resources of the computer system.
5- Describe the 3 general methods for passing parameters to the OS.
➢ Register passing → the simplest, fast, and efficient because it avoids the
need to allocate memory to store parameters.
➢ Stack passing → flexible in the number and type of parameters passed.
➢ Memory-mapped passing → provides direct access to the system memory.
6- What are the types of system calls and mention examples for each type?

File management Protection Information maintenance


• Read file → read() • Set file security • Set timer → alarm()
• Write file → write() → chmod() • Sleep → sleep()

Process control Communications Device management


• Create process → • Create pipe → • Read console → read()
fork() pipe() • Write console → write()
• Exit process → • Map view of file
exit() → mmap()

7- What system calls have to be executed by the command line in order to start
a new process on a UNIX system?
➢ First the fork() is called to create new process. Then, in the child process,
execve() is called to load the new program into the current process.
➢ Then, waitpid() is called and wait the child process to terminate and obtain
its exit status.
8- What’s the purpose of system programs (services)?
➢ They help users and applications to interact with the OS and perform their
common tasks as executing programs, managing file and directories.
9- What are the linkers and loaders and mention the difference between them?
➢ They are software programs that are used in the process of converting
source code into a runnable executable program:
1- Linker → combines object files and libraries into a single executable file.
2- Loader → loads an executable program into memory and prepares it for
execution.
10- Compare between the user goals and system goals regarding the OS.
➢ User goals → the OS should be convenient to use, easy to learn, reliable,
safe, and fast.
➢ System goals → the OS should be easy to design, implement, maintain,
flexible, reliable, error-free, and efficient.
11- Mention examples of OS that vary in their structure.
➢ Simple structure → MS-DOS
➢ More complex → UNIX (Consists of kernel and system programs)
➢ Microkernel → Mach
12- What are the benefits of the microkernel?
➢ Simplicity → designed to be small and simple, with only the essential
functions included in the kernel.
➢ Security → as it provides a minimal set of services, there is less code
running in kernel mode. So, this reduces the attack surface.
➢ Flexibility → allows for greater flexibility in the design of the system.
13- What steps needed to generate an OS from scratch?
➢ Writing the OS source code.
➢ Configure the OS for the system on which it will run.
➢ Compile the OS then install it.
➢ Boot the computer to launch the new OS.
14- Mention some tools used by the OS in tracing and their purpose.
➢ strace → trace system calls invoked by a process.
➢ gdb → source-level debugger.
➢ perf → collection of Linux performance tools.
➢ tcpdump → collects network packets.
15- What’s the BCC (BPF Compiler Collection) and mention its benefit?
➢ It’s a rich toolkit providing tracing features for Linux.
➢ Some of its benefits are:
1- Debugging interactions between user-level and kernel code.
2- Fast and efficient in tracing system and application performance in real-
time.
16- How could be a system be designed to allow a choice of OS from which to
boot and what bootstrap need to do?
➢ It can be designed using a boot loader program which is a program that’s
executed by the computer’s firmware.
➢ The bootstrap needs to locate the boot loader program on the system’s
storage.
17- Why do some systems store the OS in firmware while others store it on
disk?
➢ Because it depends in several factors as:
1- The type of the system.
2- The desired level of security.
➢ Additionally, storing in firmware is faster while in the disk is more flexible
and allow more OSes to be installed on the same system.

You might also like