Professional Documents
Culture Documents
Mohamed Abdelrahman Anwar - 20011634 - Sheet 2
Mohamed Abdelrahman Anwar - 20011634 - Sheet 2
Operating Systems
Sheet 2
OS Principles
6.
a. Serial System: In a serial system, tasks are executed one after
the other. Each task must be completed before the next task
can begin. The system is not designed for multitasking, and
there is no overlap between tasks.
Essential Properties of a Serial System:
• Only one task is executed at a time.
• The system must wait for the current task to be completed
before the next task can begin.
• The system may be slow and inefficient, as tasks cannot
overlap.
b. Batch System: In a batch system, multiple jobs are executed
together in batches. A batch of jobs is submitted to the system,
and the system executes them one by one without any user
interaction until the batch is complete.
Essential Properties of a Batch System:
• Multiple jobs are executed together in batches.
• The system executes the jobs without any user interaction.
• Once a batch is submitted, the user must wait for the
entire batch to complete before receiving any results.
c. Multiprogramming System: In a multiprogramming system,
multiple programs are loaded into memory simultaneously, and
the CPU switches between them. This allows for overlapping of
CPU and I/O operations, making the system more efficient.
Essential Properties of a Multiprogramming System:
• Multiple programs are loaded into memory
simultaneously.
• The CPU switches between programs, allowing for
overlapping of CPU and I/O operations.
• The system is more efficient than a serial system, as tasks
can overlap.
d. Time-sharing System: In a time-sharing system, multiple
users can access the system simultaneously. Each user is given
a time slice, during which they can execute their programs. The
CPU switches between users, allowing each user to interact
with the system in real-time.
Essential Properties of a Time-sharing System:
• Multiple users can access the system simultaneously.
• Each user is given a time slice to execute their programs.
• The CPU switches between users, allowing each user to
interact with the system in real-time.
In uniprogramming:
Jobs will execute sequentially so job 1 would take 23ms then
job 2 would start and finish execution at 52ms then job 3 would
start and finish at 66ms so total time is 66ms.
9.
• An executable program.
• The associated data needed by the program (variables,
workspace, buffers, etc.).
• The execution context of the program.
10.
• Process isolation: The OS must prevent independent
processes from interfering with each other’s memory,
both data and instructions.
• Automatic allocation and management: Programs should
be dynamically allocated across the memory hierarchy as
required. Allocation should be transparent to the
programmer. Thus, the programmer is relieved of
concerns relating to memory limitations, and the OS can
achieve efficiency by assigning memory to jobs only as
needed.
• Support of modular programming: Programmers should
be able to define program modules, and to dynamically
create, destroy, and alter the size of modules.
• Protection and access control: Sharing of memory, at any
level of the memory hierarchy, creates the potential for
one program to address the memory space of another.
This is desirable when sharing is needed by applications. At
other times, it threatens the integrity of programs and
even of the OS itself. The OS must allow portions of
memory to be accessible in various ways by various users.
• Long-term storage: Many application programs require
means for storing information for extended periods of
time, after the computer has been powered down.
11.
• Fairness
• Differential responsiveness
• Efficiency
12.
Job 1: CPU for 8s then I/O for 8s
Job 2: CPU for 4s then Disk for 14s
Job 3: CPU for 6s
Job 4: CPU for 4s then Printer for 16s
a.
• Turnaround time = job 1 -> 16, job 2 -> 34, job 3 -> 40, job
4 -> 60.
• Throughput = 4 / 60 = 0.066666667 jobs/sec
• Processor utilization = (8+4+6+4) / 60 * 100% = 36.67%
b.
• Turnaround time = job 1 -> 30, job 2 -> 26, job 3 -> 20, job
4 -> 32.
• Throughput = 4 / 32= 0.125 jobs/sec
• Processor utilization = (8+4+6+4) / 32* 100% = 68.75%
13.
Monolithic kernel includes scheduling, file system, networking,
device drivers, memory management, and more Typically, a
monolithic kernel is implemented as a single process, with all
elements sharing the same address space,
Microkernel architecture assigns only a few essential functions
to the kernel, including address space management,
interprocess communication (IPC), and basic scheduling. Other
OS services are provided by processes, sometimes called
servers, that run-in user mode and are treated like any other
application by the microkernel.
15.
• Virtual machines: Virtual machines, as will be discussed in
Chapter 14, provide a greater degree of application
isolation and hence fault isolation. Virtual machines can
also be used to provide redundancy, with one virtual
machine serving as a backup for another.