You are on page 1of 9

Test one

1. List and define the four main elements of a computer (8 marks)


Processor:Controls the operation of the computer and performs its data processing functions.
When there is only one processor, it is often referred to as
the central processing unit(CPU).

Main memory:Stores data and programs. This memory is typically volatile;

that is, when the computer is shut down, the contents of the memory are lost.

In contrast, the contents of disk memory are retained even when the computer
system is shut down. Main memory is also referred to as real memoryor primary memory.

I/O modules:Move data between the computer and its external environment.

The external environment consists of a variety of devices, including secondary

memory devices (e.g., disks), communications equipment, and terminals.

System bus: Provides for communication among processors, main memory,

and I/O modules.

2. Define the two main categories of processor registers(4 marks)


Processor-memory: Data may be transferred from processor to memory or
from memory to processor.
Processor-I/O: Data may be transferred to or from a peripheral device by
transferring between the processor and an I/O module.

3. in general terms, what are the four distinct actions that a machine instruction can specify(4
marks)
With this as a foundation, processor designers have proposed several machine instructions
that carry out two actions atomically,such as reading and writing or reading and testing, of a
single memory location with one instruction fetch cycle.

4. explain the following terms:(20 marks)


chache memory:memory that is invisible to the OS, it interacts with other memory management
hardware.

kernel:A portionof the OS is in main memory which contains the most frequently used functions
in the OS and, at a given time.

multiprogramming: refers to expanding memory to hold three, four, or more programs and
switch among all of them.

process: collection of one or more threads associated system resource.

swapping: removal of the process from the memory and make space for other processes,
suspended process stored in the secondary storage.

time slice:is the maximum amount of time that a process can execute before being interrupted.

jacketing:way to overcome the problem of blocking threads

round-robin scheduling technique: strategy to give each process in the queue some time in
turn and employs a circular queue.

5. how are multiple interrupts dealt with(4 marks)


-disable interrupts while an interrupt is being processed.
-interrupts are reenabled before resuming the user program, and the processor checks to see if
additional interrupts have occurred.

6. mention four common events that lead to the (4 marks)


7. distinguish between the following: (10 marks)
the multiprocessor and a multicore processor:

multiprocessor:

multicore processor: combines two or more processors (called cores) on a single piece of silicon
(called a die).

spatial locality and temporal locality:


Spatial localityrefers to the tendency of execution to involve a number of memory locations
that are clustered.
Temporal localityrefers to the tendency for a processor to access memory locationsthat have
been used recently.

interrupts and trap:


interruptsa mechanism by which other modules (I/O, memory) may interrupt the normal
sequencing of the processor.
Trap: is where by the OS determines if the error or exception condition is fatal.

monolithic kernel and microkernel:


monolithickernel: OS functionality is provided in these large kernels, including scheduling, file
system, networking, device drivers, memory management, and more.
Microkernel: architecture assigns only a few essential functions to the kernel, including address
spaces, interprocesscommunication (IPC), and basic scheduling.

8. three objectives of an OS design:(3 marks)


convenience, efficiency, and ability to evolve.

9. list 4 characteristics of a suspended process(4 marks)


1. The process is not immediately available for execution.
2. The process may or may not be waiting on an event. If it is, this blocked condition is
independent of the suspend condition, and occurrence of the blocking event does not enable
the process to be executed immediately.
3. The process was placed in a suspended state by an agent: either itself, a parent process, or
the OS, for the purpose of preventing its execution.
4. The process may not be removed from this state until the agent explicitly orders the removal.

10. list 8 elements that uniquely characterize a process and a process control block:(8 marks)
Identifier: A unique identifier associated with this process, to distinguish it from all other
processes.

State:If the process is currently executing, it is in the running state.

Priority:Priority level relative to other processes.


Program counter:The address of the next instruction in the program to be executed.
Memory pointers:Include pointers to the program code and data associated with this process,
plus any memory blocks shared with other processes.

Context data: These are data that are present in registers in the processor while the
process is executing.

I/O status information:Includes outstanding I/O requests, I/O devices (e.g., disk drives) assigned
to this process, a list of files in use by the process, and so on.
Accounting information:May include the amount of processor time and clock time used, time
limits, account numbers, and so on.

11. what resources are typically shared by all of the threads of a process:(4 marks)

12. illustrate Five state process model:(10 marks)


13. list 3 advantages of ULTs over KLTs: (3 marks)

1. Thread switching does not require kernel mode privileges because all of the thread
management data structures are within the user address space of a single process.
Therefore, the process does not switch to the kernel mode to do thread management. This
saves the overhead of two mode switches (user to kernel; kernel back to user).

2. Scheduling can be application specific. One application may benefit most from a simple
round-robin scheduling algorithm, while another might benefit from a priority-based
scheduling algorithm. The scheduling algorithm can be tailored to the application without
disturbing the underlying OS scheduler.

3. ULTs can run on any OS. No changes are required to the underlying kernel to support ULTs.
The threads library is a set of application-level functions shared by all applications.

14. list two disadvantages of ULTs compared to KLTs: (4 marks)


1. In a typical OS, many system calls are blocking. As a result, when a ULT executes a system
call, not only is that thread blocked, but also all of the threads within the process are
blocked.

2. In a pure ULT strategy, a multithreaded application cannot take advantage of


multiprocessing. A kernel assigns one process to only one processor at a time. Therefore, only a
single thread within a process can execute at a time.
Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\STUDENT.student-PC.001>pwd

'pwd' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\STUDENT.student-PC.001>mkdir mookho

C:\Users\STUDENT.student-PC.001>cd users

The system cannot find the path specified.

C:\Users\STUDENT.student-PC.001>cd mookho

C:\Users\STUDENT.student-PC.001\mookho>ls

'ls' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\STUDENT.student-PC.001\mookho>dir

Volume in drive C has no label.

Volume Serial Number is D804-9C0E

Directory of C:\Users\STUDENT.student-PC.001\mookho

01/07/2000 08:15 PM <DIR> .


01/07/2000 08:15 PM <DIR> ..

0 File(s) 0 bytes

2 Dir(s) 127,439,380,480 bytes free

C:\Users\STUDENT.student-PC.001\mookho>cd

C:\Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho>xcopy \Users\STDENT.student-PC.001\mookho

\User\STUDENT.student-PC.001\MUSIC

File not found - mookho

0 File(s) copied

C:\Users\STUDENT.student-PC.001\mookho>move pictures music

The system cannot find the file specified.

C:\Users\STUDENT.student-PC.001\mookho>move mookho \Users\STUDENT.student-PC.001

\MUSIC

The system cannot find the file specified.

C:\Users\STUDENT.student-PC.001\mookho>cd STUDENT.student-PC.001

The system cannot find the path specified.

C:\Users\STUDENT.student-PC.001\mookho>pwd

'pwd' is not recognized as an internal or external command,

operable program or batch file.


C:\Users\STUDENT.student-PC.001\mookho>cd \Users\STUDENT.student-PC.001

C:\Users\STUDENT.student-PC.001>delete mookho

'delete' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\STUDENT.student-PC.001>del/mookho

Invalid switch - "mookho".

C:\Users\STUDENT.student-PC.001>cd \Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho>del/mookho

Invalid switch - "mookho".

C:\Users\STUDENT.student-PC.001\mookho>del -d mookho

Could Not Find C:\Users\STUDENT.student-PC.001\mookho\-d

C:\Users\STUDENT.student-PC.001\mookho>del \Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho\*, Are you sure (Y/N)? y

C:\Users\STUDENT.student-PC.001\mookho>del \Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho\*, Are you sure (Y/N)? Y

C:\Users\STUDENT.student-PC.001\mookho>cd \Users\STUDENT.student-PC.001
C:\Users\STUDENT.student-PC.001>del \Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho\*, Are you sure (Y/N)? Y

C:\Users\STUDENT.student-PC.001>cd \Users\STUDENT.student-PC.001\mookho

C:\Users\STUDENT.student-PC.001\mookho>close

'close' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\STUDENT.student-PC.001\mookho>diskpart

Access is denied.

C:\Users\STUDENT.student-PC.001\mookho>show disk

'show' is not recognized as an internal or external command,

operable program or batch file.

C:\Users\STUDENT.student-PC.001\mookho>cd \Users\STUDENT.student-PC.001

C:\Users\STUDENT.student-PC.001>mkdir rapelang

C:\Users\STUDENT.student-PC.001>cd \Users\STUDENT.student-PC.001\rapelang

C:\Users\STUDENT.student-PC.001\rapelang>

You might also like