Skip to main content

Answer Chapter 4

Question

Definition

1.    What is resource?
Answer
Resource are device connected to a computer, internal system component is a resource, Files, Network connections and Memory areas.



2.    Explain concept of resource management.
Answer
a.    Modern computers consist of processors, memories, timers, disks, mice, network interfaces, printers, and a wide variety of other devices. In the alternative view, the job of the operating system is to provide for an orderly and controlled allocation of the processors, memories, and input/output devices among the various programs competing for them.
b.    When a computer (or network) has multiple users, the need for managing and protecting the memory, input/output devices, and other resources is even greater, since the users might otherwise interface with one another. In addition, users often need to share not only hardware, but information (files, databases, etc.) as well.

Function of Resource Management

3.    Give function of resource management.
Answer
a.    To keep track of which programs are using which resources, to grant resource requests
b.    To account for usage
c.    To mediate conflicting requests from different programs and users.

Types of Scheduling

4.    Explain three types of scheduling.
Answer
a.    Long Term Scheduling
          Which determines which programs are admitted to the system for execution and when, and which ones should be exited
b.    Medium Term Scheduling
          Which determines when processes are to be suspended and resumed
c.    Short Term Scheduling
          Which determines which of the ready processes can have resources, and for how long.






1.    With aid diagram describe classification of scheduling activity.
Answer
a.    Long term: which process to admit?
b.    Medium term: which process to swap in or out?
c.    Short term: which process to execute next?

Process Control Block (PCB)

2.    Explain the Process Control Block (PCB)?
Answer
Control Block is a data structure maintained by the Operating System for every process. A PCB keeps all the information needed to keep track of a process.


3.    How PCB operates?
Answer
a.    Process identification.
b.    Process status (HOLD, READY, RUNNING, WAITING).
c.    Process state (process status word, register contents, main memory info, resources, process priority).
d.    Accounting (CPU time, total amount of time, I/O operations, number input records read, etc.).
4.    With aid diagram describe proses status.
Answer
As a process executes, it changes state:
a.    New: the process is being created
b.    Running: instructions are being executed
c.    Blocked: the process are waiting for some event to occur
d.    Ready: the process is waiting to be assigned to a process
e.    Terminated: the process has finished execution

Interrupts

5.    Explain the interrupts.
Answer
a.    Interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
b.    The processor responds by suspending its current activities, saving its state, and executing a small program called an interrupt handler (or interrupt service routine, ISR) to deal with the event. 
c.    This interruption is temporary, and after the interrupt handler finishes, the processor resumes execution of the previous thread.
6.    Give three types of interrupts.
Answer
a.    Hardware Interrupts (eg. Power failure – UPS needs to take immediate action)
b.    Program Interrupts (eg. A division by zero error in a program)
c.    Timer Interrupts (eg. An event generated by the internal clock of the computer)
d.    Input/Output Interrupts (eg. Autosave on a Word Document)

Non Pre-emptive Vs Pre-emptive

7.    Compare the term of non pre-emptive and pre-emptive
Answer
Non Pre-Emptive
Pre-Emptive
These schemes do not allow process execution to be interrupted.
These schemes allow interruptions.

Scheduling Algorithm

8.    Explain the six types of scheduling algorithm.
Answer
First Come First Served
a.    Also named as Fist In First Out (FIFO)
b.    Jobs are scheduled in order of arrival.
c.    Average waiting time can be large if small jobs wait behind long ones.
d.    The simplest non pre-emptive scheme.
e.    Executes without interruption.
Round Robin Scheduling
a.    Similar to FIFO because it runs each process in the order in which arrives but the key difference is that it is preemptive.
b.    It does not need to know the remaining computation time when it chooses which process will go next.
c.    It allows each process in the ready state to get access to the CPU on the regular basis.
Shortest Job First (SJF)
a.    The non-pre-emptive scheme.
b.    It only work if the amount of processing time is known in advance.
Shortest Remaining Time
a.    The non pre emptive scheme.
b.    It only work if the amount of processing time is known in advance.
Priority
a.    The priority scheduling allocation scheme assigns a priority level to each process in the ready queue depending on its importance.
b.    The most important are execution first, without interruption.
Multilevel Queue
Complex systems have requirements for real time, interactive users and batch jobs, therefore a combined scheduling mechanism should be used
a.    The processes are divided in classes
b.    Each class has a process queue, and it has assigned a specific scheduling algorithm
c.    Each process queue is treated according to a queue scheduling algorithm:
d.    Each queue has assigned a priority
e.    As long as there are processes in a higher priority queue, those will be serviced





Scheduler

1.    How Queuing Routine and Scheduler work together?
Answer
Queuing routine and a scheduler are two module that make decision which program is loaded into memory next when a program finishes processing and space becomes available.
Example process:
a.    As programs enter the system, they are placed on a queue by the queuing routine
b.    When space becomes available, the scheduler selects a program from the queue and loads it into memory. 
c.    Clearly distinguish between a program’s internal and external priorities.
d.    Once a program is in memory, the dispatcher uses its internal priority to determine its right to access the processor.
e.    In contrast, the program’s external priority has to do with loading it into memory in the first place.
f.     Until the program is in memory, it has no internal priority. Once in memory, its external priority is no longer relevant

Deadlock

2.    Define the deadlock.
Answer
A set of processes is in a deadlock state if every process in the set is waiting for an event (release) that can be caused by process in the same time.
3.    Describe four conditions deadlock to occur.
Answer
a.    Mutual exclusion
Only one process at a time can use the resource.
b.    Hold and Wait
Processes hold resources already allocated to them while waiting for other resources.
c.    No Pre-emptive
Resources are released by processes holding them only after that process has completed its task.
d.    Circular Wait
A circular chain of processes exists in which each process waits for one or more resources held by the next process in the chain.



Dispatcher

4.    With aid diagram explain the dispatcher.
Answer

The dispatcher monitors processes and decides when to switch execution from one process to another.

Comments

Popular posts from this blog

2.1.4 Distinguish between logical I/O and physical I/O

2.1.4 Distinguish between logical I/O and physical I/O logical input relate to hard disk Logical I/O an Physical I/O Physical" I/O is an actual fetch of data from a storage device such as a disk. Logical" I/O is a programmatic request for data satisfied by a memory (block, buffer) access. A logical I/O may cause a physical I/O in the first place, or a logical I/O may retrieve a part of a block (buffer) of data from memory. 2.1.5 Distinguish between directory management and disk space management. Directory management A directory is a hierarchical collection of directories and files.  The only constraint on the number of files that can be contained in a single directory is the physical size of the disk on which the directory is located. Disk management A hard disk is a rigid disk inside a computer that stores and provides relatively quick access to large amounts of data. It is the type of storage most often used with Windows. The system also supp

3.1.1 Identify Between Resident And Transient Routines

Memory Management Memory management is concerned with managing: The computer’s available pool of memory Allocating space to application routines and making sure that they do not interfere with each other. 3.1.1 Identify between resident and transient routines The operating system is a collection of software routines. Resident routines Transient routines Routines that directly support application programs as they run Stored on disk and read into memory only when needed Example: routine that control physical I/O Example: routine that formats disks The operating system occupies low memory beginning with address 0. Key control information comes first followed by the various resident operating system routines. The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded. Resident & transient routines structure

Operating Systems Definition and the Classification of OS

             OPERATING SYSTEMS ( OS ) What is an operating system? An operating system (sometimes abbreviated as "OS") is the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer. The other programs are called applications or application programs. The application programs make use of the operating system by making requests for services through a defined application program interface (API). In addition, users can interact directly with the operating system through a user interface such as a command language or a graphical user interface (GUI). An operating system performs these services for applications:     In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before giving another application a turn.     It manages the sharing of