Lanugan, Ruby M. Jan. 9 2010
Concept Question.
1. Name the five key concepts about an operating system that you think a user needs to know and understand.
Ans.
1. 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.
2. Device Manager- This component monitors all devices, channels, and control units. The Device Manager 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.
3. 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
4. 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
5. File Manager- 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.
Ans.
3. Explain the following:
a. Internal fragmentation. How does it occur?
Internal Fragmentation: 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?
Answer: 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?
4. Cache memory how it works?
Answer. A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations. As long as most memory accesses are cached memory locations, the average latency of memory accesses will be closer to the cache latency than to the latency of main memory.
5. Which is the fastest cache’s L1, L2 or L3? Why?
Answer: L1 cache is the smallest and the fastest, the smaller each transistor is, the more of them will fit in your CPU, allowing for faster CPUs with more stuff crammed in. Smaller transistors also switch faster, allowing higher clock speeds, and use less power..
II. Memory Utilization Problem.
1. Given the following information:
Table 1A
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
J4 | 850KB |
J5 | 610KB |
a. Use the best-fit algorithm to allocate the memory blocks to the five arriving jobs.
b. Use the first-fit algorithm to allocate the memory blocks to the five arriving jobs.
c. Use the next-fit algorithm to allocate the memory blocks to the five arriving jobs.
d. Use the worst-fit algorithm to allocate the memory blocks to the five arriving jobs.
2. Given the following information.
Table 2A
Job Number | Memory Requested |
J1 | 30KB |
J2 | 50KB |
J3 | 30KB |
J4 | 25KB |
J5 | 35KB |
ORIGINAL STATEOF MAIN MEMORY |
1000KB(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:
Job1 is 1600 lines long PS=200 and LNTBL=542
Best-fit algorithm
Memory Block | Memory Size | JOB Number | JOB Size | Status | Internal Fragmentation |
1132 | 700 | J1 | 700KB | Busy | 0 |
1003 | 720 | J5 | 610KB | Busy | 110 |
1114 | 800 | J3 | 740KB | Busy | 60 |
2310 | 750 | - | - | Free | |
1755 | 610 | J2 | 500KB | Busy | 110 |
First-fit algorithm
Memory Block | Memory Size | JOB Number | JOB Size | Status | Internal Fragmentation |
1132 | 700 | J1 | 700 | Busy | 0 |
1003 | 720 | J2 | 500 | Busy | 220 |
1114 | 800 | J3 | 740 | Busy | 60 |
2310 | 750 | J5 | 610 | Busy | 140 |
1755 | 610 | - | - | Free | |
Next-fit algorithm
Memory Block | Memory Size | JOB Number | JOB Size | Status | Internal Fragmentation |
1132 | 700 | - | - | Free | |
1003 | 720 | J5 | 610 | Busy | 110 |
1114 | 800 | J3 | 740 | Busy | 60 |
2310 | 750 | J1 | 700 | Busy | 50 |
1755 | 610 | J2 | 500 | Busy | 110 |
Worst-fit algorithm
Memory Block | Memory Size | JOB Number | JOB Size | Status | Internal Fragmentation |
1132 | 700 | - | - | Free | |
1003 | 720 | J5 | 610 | Busy | 110 |
1114 | 800 | J1 | 700 | Busy | 100 |
2310 | 750 | J2 | 500 | Busy | 250 |
1755 | 610 | - | - | Free | |