I. Concept Questions
1. Name the five key concepts about an operating system that you thinks a user needs to know and understand.
Answer: For me the five key concept of Operating System that a user needs to know and understand are the following.
I. The major components of operating system, which are: Memory manager, Device Manager, File Manager, Processor Manager, and User command Interface.
II. How operating system handle the resource allocation and access the protection of the hardware.
III. How operating system allocates jobs in memory blocks.
IV. The importance of operating system.
V. How operating system involves in program execution.
2. List the tangible(physical) resources of the computer system and explain how it works.
a. Tower or Desktop The "box" or case that holds the parts that make up a computer: CPU, hard disk drive, floppy drive, memory chips, power supply, interface cards, etc.
b. Monitor An output display device (looks similar to a TV) in a computer system. You see information on the monitor's screen.
c.Speakers Output device that produces sound and music when connected to the computer. Speakers come in different shapes and may even be in the monitor's case.
d.Keyboard Input device - choose letters, symbols, and actions by pressing keys
3. Explain the following:
a. internal fragmentation. How does it occur?
b. External Fragmentation. How does it occur?
c. Compaction. Why it is needed?
Answers:
a. Internal fragmentation is the unused space, it occurs when storage is allocated without ever intending to use it. This space is wasted. While this seems foolish, it is often accepted in return for increased efficiency or simplicity. The term "internal" refers to the fact that the unusable storage is inside the allocated region but is not being used. source: http://en.wikipedia.org/wiki/Fragmentation_(computer)
b. External fragmentation is the phenomenon in which free storage becomes divided into many small pieces over time. It is a weakness of certain storage allocation algorithms, occurring when an application allocates and deallocates ("frees") regions of storage of varying sizes, and the allocation algorithm responds by leaving the allocated and deallocated regions interspersed. The result is that although free storage is available, it is effectively unusable because it is divided into pieces that are too small to satisfy the demands of the application. The term "external" refers to the fact that the unusable storage is outside the allocated regions. Source: http://en.wikipedia.org/wiki/Fragmentation_(computer)
c. 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. source: http://www1bpt.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/memory.htm#compaction
4.Cache memory how it works?
Ans: A cache (pronounced /kæʃ/, kash) is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data is expensive to fetch (owing to longer access time) or to compute, compared to the cost of reading the cache. In other words, a cache operates as a temporary storage area where frequently accessed data can be stored for rapid access. Once the data is stored in the cache, it can be used in the future by accessing the cached
copy rather than re-fetching or recomputing the original data. source: http://en.wikipedia.org/wiki/Cache
5.Which is the fastest cache's L1, L2, or L3? Why?
Ans: The fastest cache is the L1-cache because the L1 cache typically ranges in size from 8KB to 64KB and uses the high-speed SRAM (static RAM) instead of the slower and cheaper DRAM (dynamic RAM) used for main memory. source: http://www.experts123.com/q/what-is-l1-cache-l2-and-l3-what-do-these-do.html
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 |
Memory Block | Size |
1132 | 700KB |
1003 | 720KB |
1114 | 800KB |
2310 | 750KB |
1755 | 610KB |
a. a.Use the best-fit algorithm to allocate the memory blocks to the five arriving jobs.
b. b.Use the first-fit algorithm to allocate the memory blocks to the five arriving jobs.
c. c.Use the next-fit algorithm to allocate the memory blocks to the five arriving jobs.
d. d.Use the worst-fit algorithm to allocate the memory blocks to the five arriving jobs.
AA answer:
a. Best-fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
(*IDLE)
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J1 | 700KB | BUSY | 0 |
1003 | 720KB | J2 | 500KB | BUSY | 120KB |
1114 | 800KB | | | | |
2310 | 750KB | J3 | 740KB | BUSY | 10KB |
1755 | 610KB | J5 | 610KB | BUSY | 0 |
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J1 | 700KB | BUSY | 0 |
1003 | 720KB | J2 | 500KB | BUSY | 120KB |
1114 | 800KB | J3 | 740KB | BUSY | 60KB |
2310 | 750KB | J5 | 610KB | BUSY | 140KB |
1755 | 610KB | | | | |
c. Next-fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
(* IDLE)
Memory List
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | J2 | 500KB | BUSY | 200KB |
1003 | 720KB | J1 | 700KB | BUSY | 20KB |
1114 | 800KB | J5 | 610KB | BUSY | 190KB |
2310 | 750KB | J3 | 740KB | BUSY | 10KB |
1755 | 610KB | | | | |
d.Worst- fit algorithm
Job Number | Memory Requested |
J1 | 700KB |
J2 | 500KB |
*J3 | 740KB |
*J4 | 850KB |
J5 | 610KB |
a. (* IDLE)
Memory Block
Memory Location | Memory Size | Job Number | Job Size | Status | Internal Fragmentation |
1132 | 700KB | | | | |
1003 | 720KB | J5 | 610KB | BUSY | 110KB |
1114 | 800KB | J1 | 700KB | BUSY | 100KB |
2310 | 750KB | J2 | 500KB | BUSY | 250KB |
1755 | 610KB | | | | |
2. 2.Given the following information:
Table 2A
Job Number | Memory Requested |
J1 | 30KB |
J2 | 50KB |
J3 | 30KB |
J4 | 25KB |
J5 | 610KB |
Table 2B
ORIGINAL STATE OF MAIN MEMORY |
100KB(P1) |
25KB(P2) |
25KB(P3) |
50KB(P4) |
30KB(P5) |
a.
a. a.Create a memory layout for the fixed partition
After job entry based on the given information
(Table 2A and Table 2B)
b. 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 dynamic partition based on the given information
(Table 2A).Ans:
a. a.Fixed partition. J5 is idle.
AFTER JOB ENTRY |
30KB(J1) |
|
25KB(J4) |
50KB(J2) |
30KB(J3) |
a.
b.Dynamic Partition
Before New Job Entry |
3OKB(J1) |
|
25KB FREE |
50KB FREE |
30KB FREE |
After New Job Entry |
3OKB(J1) |
|
25KB FREE |
45KB(J7) |
30KB(J6) |
No comments:
Post a Comment