You are on page 1of 10

True or false:

1.An operating system does not perform useful function by itself, but it provides an
environment within which other programs can do useful work. ( T )
2. Multiprocessor systems have two or more processors in close communication,
sharing the computer bus with separate clock, memory, and peripheral devices. ( F )
3. The dual mode of operation provides us with the means for protecting the operating
system from errant users and errant users from one another. ( T )
4. After synchronous I/O starts, control returns to user program without waiting for I/O
completion. ( F )
5. The program stack can be used to pass a system call parameters to the operating
system. ( T )
6. Short-term scheduler controls the degree of multiprogramming. ( F)
7. In a hierarchical storage structure, each data item appears at least in two levels of the
storage system. ( F )
8. In case of direct communication, a link is established only if processes share a
common mailbox. ( F )
9. Some of system programs are simply user interfaces to system calls; others are
considerably more complex. ( T )
10. The objective of multiprogramming is to have some process running at all times, to
minimize CPU utilization. ( F )
11.Round robin scheduling is a non-preemptive scheduling algorithm. (F)

12. A major problem with FCFS scheduling algorithm is starvation. (F)

13. The operating system decides between conflicting requests for efficient and fair
resource use. (T)
14. A device controller informs CPU that it has finished its operation by causing a trap.
(F)
15. Incoming interrupts are enabled while another interrupt is being processed. ( F )

16. The registers can be used to pass a system call parameters to the operating
system. ( T )
17. Resource allocation is a one of operating-system services provides functions that
are helpful to the user. ( F )
18. Many operating systems now include both CLI & GUI interfaces. (T)

19. The job scheduler selects which processes should be brought into the ready queue.
(T)
20. An independent process can affect the execution of another process. (F)
21. Scheduling criteria can be computed for most scheduling algorithms using the
distribution formulas of system processes CPU burst and arrival time. ( T )
22. SJF is a priority scheduling where priority is the predicted next CPU burst time. ( T )
23. The operating system controls execution of programs to prevent errors and
improper use of the computer. ( T )
24. Caching is copying information into inexpensive storage system. (F)
25. Long-term scheduler controls the degree of multiprogramming. ( T )
26. The waiting queue is a set of all processes residing in main memory and waiting to
execute. (F)
27. The main target of CPU scheduling is to maximize response time.(F)
28.The Process address space refers to the binary form of the program code. ( F )
29.In asymmetric multiprocessor system, the kernel can execute on any processor, and
typically each processor does self-scheduling from the set of available processes ( F )
30.A process that cannot execute until some event occurs is said to be in the ready
state. ( F )
31.Unlike process, thread doesn’t transit among a series of states (F)
32.First-come-first-served (FCFS) is a simple scheduling policy that tends to favor I/O-
bound processes over CPU bound process ( T )
33.The DMA operation does not require generation of interrupts ( F )
34.When a process enters the system, it is kept in the ready queue. (F)
35.Multilevel Queue Scheduling requires scheduling to be done between queues. ( T )
36.The average turnaround time of a process always improve as the time quantum
Increase ( F )
37.Usage of DMA is the only method that enables the OS to effectively applying the
multiprogramming feature . ( F )
38.First-come-first-served (FCFS) is a simple scheduling policy that tends to favor I/O-
bound processes over processor bound processes.(F)
39.A short-term scheduling algorithm favors I/O bound process ( T )
40.The DMA operation requires to get only the address of I/O device (F)
41.PCB is a program that control exe of process ( F )
42.Concureny pbs not effect on uni-processors ( F )
43.The Kernel process is referred as less-privileged process ( F )
44.User thread are fast to create and manage than Kernel thread.(T)
45. Logical and physical addresses differ in execution time address binding.( T )
46. First-fit and best-fit better than worst-fit in terms of speed and storage utilization (T)
47. Concurrent access to shared data may result in data inconsistency. (T)
48. A process may never be removed from the semaphore queue in which it is
suspended. (T)
49. Counting semaphore can be implemented using binary semaphore. (T)
50. Main memory and registers are only storage CPU can access directly. (T)
51. Cache sits between main memory and CPU registers. (T)
52. Register access in one CPU clock (or less). (T)
53. Main memory can take many cycles. (T)
54. The user program deals with logical addresses. (T)
Answer the Questions

Q1: What is OS?

OS is a resource allocator:

1. Manages all resources.


2. Decides between conflicting requests for efficient and fair resource use.

OS is a control program: Controls execution of programs to prevent errors and


improper use of the computer.

Q2: What is the Bootstrap program?

Bootstrap program is loaded at powered-up or booted.

Q3: The services and functions provided by an operating system can be divided
into two main categories. Briefly describe the two categories and discuss how
they differ.

One set of operating system services is to provide functions that are helpful to user:
- GUI
- I/O management
- Program execution
- Communication
- File-system manipulation
- Error detection
Another set of operating system services is to ensure efficiency of system itself by
resources sharing:
- Resource allocation
- Accounting
- Security and protection
Q4: What is the purpose of interrupts? How does an interrupt differ from a trap?
Can traps be generated intentionally by a user program? If so, for what is the
purpose?

Interrupts are calls to the CPU that inform the system about other system programs.
The CPU will be in a specific state and an interrupt changes that state.

A trap is a software generated interrupt. It can be caused by an error or by a request


from a user program.

Interrupts come from hardware and the handling is asynchronous, Traps are software
generated and the handling is synchronous.

Q5: Explain the difference between interrupt & trap

Interrupt transfers control to the interrupt service routine generally which contains the
addresses of all the service routines.
Trap is a software generated interrupts caused either by an error or a user request.

Q6: Explain the difference between Design policy & Design Mechanism?

Policy: what will be done?


Mechanism: How to do it?

Q7: Describe three general methods for passing parameters to the operating system.
a. Pass parameters in registers
b. Registers pass starting addresses of blocks of parameters
c. Parameters can be placed, or pushed, onto the stack by the program, and popped off
the stack by the operating system
Q8: Describe the differences among short-term, medium-term, and long-term
scheduling.
Short-term (CPU scheduler): selects a process from memory and ready to execute,
and allocates the CPU to it.
Medium-term (memory manager): selects processes from the ready (or blocked
queue) and removes them from memory, then returns them later to continue running.
Long-term (job scheduler): determines which jobs are brought into the system for
processing.

Q9: Describe the actions taken by the kernel to context-switch between two processes.
The PCB of the current process must be saved. This information includes the values of:
(1) process state (2) program counter, (3) CPU registers, (4) scheduling information (5)
memory management information, (6) I/O status information.

The information is stored in the PCB of the process. We then restore the PCB of the
process that is to run next, and gives control to this process.

Q10: What is a process? What is a PCB? Which scheduler must work very fast in
order not to waste significant CPU time? Which can be slow?

The PCB is a Process Control Block. It contains various/ different information


associated to each process, as: (1) process state (2) program counter, (3) CPU
registers, (4) scheduling information (5) memory management information, (6) I/O status
information.
A process is a program in execution.
Fast: short-term (CPU) scheduler, Slow: long-term (job) scheduler.
Q11: As a process executes, it changes state. Describe the different states of a
process.

New: The process is being created.


Running: Instructions are being executed.
Waiting: The process is waiting for some event to occur.
Ready: The process is waiting to be assigned to a processor.
Terminated: The process has finished execution.

Q12: What is the Process Scheduling Queues?

- Job queue – set of all processes in the system.


- Ready queue – set of all processes residing in main memory, ready and waiting
to execute.
- Device queues – set of processes waiting for an I/O device.

Q13: What is the meaning of the term busy waiting? What other kinds of waiting
are there in an operating system? Can busy waiting be avoided altogether?
Explain your answer.
Busy waiting means that a process is waiting for a condition to be satisfied in a close
loop without leaving the processor. A process could wait by leaving the processor, and
block on a condition and wait to be awakened at some appropriate time in the future.
Busy waiting can be avoided but occurs the overhead associated with putting a
process to sleep and having to wake it up when the suitable program state is reached.
Q14: What is the definition of the following?

Compile Time: If memory location known a priori, absolute code can be generated.

Load Time: Must generate re-locatable code if memory location is not known at
compile time.

Execution time: Binding delayed until run time if the process can be moved during its
execution from one memory segment to another.

Q15: What is a critical section? What main requirements must a solution to the
critical-section problem satisfy?

The critical section problem is to design a protocol that a system consisting of several
processes can use to cooperate safely. Each process must request permission to enter
its critical section. The critical section may be followed by the exit section.

A solution to the critical section problem must satisfy the following three requirements:
1. Mutual Exclusion: If process Pi is executing in its critical section, then no other
process can be executing in their critical sections.
2. Progress: If no process is executing in its critical section and some processes wish
to enter their critical sections, then only those processes that are no executing in their
remainder section can enter its critical section next, and this selection cannot be
postponed.
3. Bounded Waiting: There exists a bound on the number of times that other
processes are allowed to enter their critical sections after a process has made a request
to enter its critical section and before that request is granted.

16. Describe the action taken by a kernel to context-switch between processes?

- When CPU switches to another process, the system must save the state of the old
process and load the saved state for the new process via a context switch.
- Context of a process represented in the PCB.
- Context-switch time is overhead; the system does no useful work while switching.
Q17: Explain the difference between each of the following:

System Calls System Programs


Allow user-level processes to request Can be thought of as bundles of
services of the operating system. useful system calls.

Logical Address Physical Addresses


Generated by the CPU; also referred Address seen by the memory unit.
to as virtual address.
A logical address is generated by the CPU
and is translated into a physical address by the memory management unit
(MMU).

Logical Address Space Physical Addresses Space


is the set of all logical is the set of all physical
addresses generated by a program addresses generated by a program

Internal Fragmentation External Fragmentation


Allocated memory may be larger than requested Total memory space exists to
memory; this size difference is memory internal to a satisfy a request, but it is not
partition, but not being used. contiguous.

Q18: How to satisfy a request of size n from a list of freeholes?

- First-fit: Allocate the first hole that is big enough.


- Best-fit: Allocate the smallest hole that is big enough; must search entire list,
unless ordered by size.
- Worst-fit: Allocate the largest hole; must also search entire list.
o First-fit and best-fit better than worst-fit in terms of speed and storage
utilization.
Q19: What advantage is there in having different time-quantum sizes on different levels
of a multilevel queuing system?
Processes which need more frequent servicing, for instance interactive processes such
as editors, can be in a queue with a small time quantum. Processes with no need for
frequent servicing can be in a queue with a larger quantum, requiring fewer context
switches to complete the processing, making more efficient use of the computer.

Q20: Why are page sizes always powers of 2?


Recall that paging is implemented by breaking up an address into a page and offset
number. It is most efficient to break the address into X page bits and Y offset bits, rather
than perform arithmetic on the address to calculate the page number and offset.
Because each bit position represents a power of 2, splitting an address between bits
results in a page size that is a power of 2.

Q21: What is the Storage-Device Hierarchy?

You might also like