Friday, January 15, 2010

Preliminary Exam-OS

Angel Lee V. Bongcac                                                                                                     BSIT  - 1V

I.                    Concept Questions

 

1.       Name the five key concepts an Operating System that you think a user needs to know and understand.

Answers:

v  User Command Interface

This is the interface from which the user issues commands to the operating system. Also called the “shell” (container inside which the entire user interface is presented), this is the visible interface with which users interact. For most users, the User Interface is the operating system.

v  Device Manager

This component monitors all devices, channels, and control units. The DeviceManager must select the most efficient method for allocation of a system’s devices, printers, terminals, disk drives, and other hardware. This is based on a pre-determined scheduling policy, and the Device Manager makes allocations, starts operations, and ultimately deallocates devices.

v  Processor Manager

This component is responsible for allocating the central processing unit (CPU). The status of each process must be tracked, and the Processor Manager handles matters such as process prioritization and multithreading. The tasks of the Processor Manager can be divided into two main categories: accepting or rejecting incoming jobs (handled by the Job Scheduler) and determining which process is given access to the CPU and for how long (handled by the Process Scheduler).

v  Memory Manager

This component controls main memory. It evaluates the validity of each memory request, and allocates memory space (as needed and available). For multi-user systems, the Memory Manager maintains a log of what memory resources are in use by which users. When items stored in main memory are no longer needed, the Memory Manager handles memory deallocation.

v  File Manager

This component tracks every file in the system. These files include data files, assemblers, compilers, and applications. The File Manager can use predetermined access policies to enforce restrictions on file access. It also handles all other file permissions. The File Manager allocates file resources by opening a particular file and deallocates resources by closing the file.

 

 

 

 

 

 

 

2.       List three tangible (physical) resources of a computer system and explain how it works.

Answers:

v  Interrupt Request (IRQ)

Short for Interrupt request, IRQ is a signal that has a direct line to the computer processor, allowing it to stop the processor momentarily and decide what to do next. Every IBM compatible computer has a maximum of 15 IRQs and are prioritized in the computer according to the importance of the device. See IRQ Listing for a list of IRQs, which may be available or are currently used.

v  Input/output (I/O)

Input Output (I/O) represents the locations in memory that are designated by use of various devices to exchange information amongst themselves and the rest of the PC. See IRQ Listing for a list of IRQs and I/O ranges.

v  Direct memory access (DMA)

DMA, or Direct Memory Access, are pathways provided by the hardware to allow the hardware direct access to the computer's memory. See DMA Listing for listing of DMA channels.

3.       Explain the following:

Answers:

a.       Internal fragmentation. How does it occur?

Internal fragmentation is the space wasted inside of allocated memory blocks because of restriction on the allowed sizes of allocated blocks. Allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used

b.      External fragmentation. How does it occur?

External Fragmentation happens when a dynamic memory allocation algorithm allocates some memory and a small piece is left over that cannot be effectively used. If too much external fragmentation occurs, the amount of usable memory is drastically reduced. Total memory space exists to satisfy a request, but it is not contiguous.

c.       Compaction. Why is it needed?

Compaction attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes. Aside from the obvious cost of all that copying, there is an important limitation to compaction: Any pointers to a block need to be updated when the block is moved. Unless it is possible to find all such pointers, compaction is not possible. Pointers can stored in the allocated blocks themselves as well as other places in the client of the memory manager. In some situations, pointers can point not only to the start of blocks but also into their bodies. For example, if a block contains executable code, a branch instruction might be a pointer to another location in the same block. Compaction is performed in three phases. First, the new location of each block is calculated to determine the distance the block will be moved. Then each pointer is updated by adding to it the amount that the block it is pointing (in) to will be moved. Finally, the data is actually moved. There are various clever tricks possible to combine these operations.

 

4.       Cache memory how it works?

Answers:

Cache memory is random access memory (RAM) that a computer microprocessor can access more quickly than it can access regular RAM. As the microprocessor processes data, it looks first in the cache memory and if it finds the data there (from a previous reading of data), it does not have to do the more time-consuming reading of data from larger memory. Without the cache memory every time the CPU requested data it would send a request to the main memory which would then be sent back across the memory bus to the CPU. This is a slow process in computing terms. The idea of the cache is that this extremely fast memory would store and data that is frequently accessed and also if possible the data that is around it. This is to achieve the quickest possible response time to the CPU. Its based on playing the percentages. If a certain piece of data has been requested 5 times before, its likely that this specific piece of data will be required again and so is stored in the cache memory.

 

5.       Which is the fastest cache’s L1, L2, or L3? Why?

          Answers:

L1 cache is a small, fast memory cache that is built in to a CPU and helps speed access to important and frequently-used data. Level 1 cache is implemented using Static RAM (SRAM) and until recently was traditionally 16KB in size. SRAM uses two transistors per bit and can hold data without external assistance, for as long as power is supplied to the circuit. The second transistor controls the output of the first: a circuit known as a "flip-flop" - so-called because it has two stable states which it can flip between.

 

I.                    Memory Utilization Problem

1.       Given the following information:

Table 1A

Job Number

Memory Requested

J1

700KB

J2

500KB

J3

740KB

J4

850KB

J5

610KB

 

Memory Block

Size

1132

700

1003

720

1114

800

2310

750

1755

610

 

a.       Use the best – fit algorithm to allocate the memory blocks to the five arriving jobs.

 

Memory Block

Memory Block Size

Job Number

Memory Requested

Status

Internal Fragmentation

1132

700

J1

700KB

Busy

OKB

1003

720

J5

610KB

Busy

110KB

1114

800

 

 

 

 

2310

750

J3

740KB

 

60KB

1755

610

J2

500KB

Busy

110KB

Total

Available:

3580

Total Used:

2550KB

 

280KB

 

b.      Use the first – fit algorithm to allocate the memory blocks to the arriving jobs.

 

Memory Block

Memory Block Size

Job Number

Memory Requested

Status

Internal Fragmentation

1132

700

J1

700KB

 

OKB

1003

720

J2

500KB

 

220KB

1114

800

J3

740KB

 

60KB

2310

750

 

850KB

 

140KB

1755

610

J5

610KB

 

 

Total

Available:

3580

Total Used:

2550KB

 

280KB

 

 

c.       Use the next – fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory Block

Memory Block Size

Job Number

Memory Requested

Status

Internal Fragmentation

1132

700

 

 

 

 

1003

720

J5

610KB

 

140KB

1114

800

J3

740KB

 

60KB

2310

750

J1

700KB

 

50KB

1755

610

J2

500KB

 

110KB

Total

Available:

3580

Total Used:

2550KB

 

360KB

 

 

 

d.       

e.       

f.         



d. Use the worst –fit algorithm to allocate the memory blocks to the five arriving jobs.

 

Memory Block

Memory Block Size

Job Number

Memory Requested

Status

Internal Fragmentation

1132

700

 

 

 

 

1003

720

J5

610KB

 

110KB

1114

800

J1

700KB

 

100KB

2310

750

J2

500KB

 

250KB

1755

610

 

 

 

110KB

Total

Available:

3580

Total Used:

2550KB

 

460KB

 

2.       Given the following information:

TABLE 2A                                                             TABLE 2B

Job Number

Memory Requested

J1

700KB

J2

500KB

J3

740KB

J4

850KB

J5

610KB

ORIGINAL STATE OF MAIN MEMORY

 

 

100KB (P1)

 

25KB (P2)

25KB (P3)

50KB (P4)

30KB (P5)

                               

 

 

 

 

 

 

 

 

 

 

 

 

 

a.       Create a memory layout for the fixed partition after job entry based on the given information (Table 2A and Table 2B)

b.      Before Job 6(30KB) and Job 7(45KB) arrives, there are three jobs done ready for processing which J2, J3, J4. Create an initial memory layout for the dynamic partition based on the given information (TABLE 2A).

 

3.       Illustrate and find the page number with the displacement of a given program line: Job 1 is 1600 lines long.

 

Answers:                                       

L     LNTBL divided by PS and the result is the Page Number and the remainder is the displacement

  

54       542 ÷ 200=2 the remainder is 142

           Therefore the displacement is 142

 

 

 

No comments:

Post a Comment