Friday, January 8, 2010

Prelim Examination

I.Concept Question

  1.  Name the five key concepts about an operating system that you thinks a user needs to know and understand.
  • there are  5 key concepts about an operating system that user should know and understand.Users would be greatly benefited by an understanding of these main properties of operating systems:

             1. User Command Interface or GUI
                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. 


            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. 


            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 prioritize and multi-threading. 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
           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.

  • Printer

    Printers are still accessories, for now at least. They perform a process, transferring information onto paper, that is truly external to the other functions of the computer. On a home computer, the printer is usually wired directly to the computer, but it is common to find printers in businesses where the printer is off away from the computer and performing printing operations for several computers, rather than just one.
  • Monitor

    The monitor is the part that looks a lot like a TV set. You look at it and see pictures and words. When you type things on the keyboard, the letters and numbers show up on the monitor, or at least you hope they will. The monitor is also called the Display Monitor, or just the Display, or sometimes the Video Display, or maybe just The Screen. The important thing to know about the monitor is that it is not really the computer, it's just the part that makes pictures for you to see. 
  • Random Access Memory, RAM, also known as main memory or system memory, is a term commonly used to describe the memory within a computer. It is consider as primary storage device, it is where data are being stored.

3.Explain the following:

         a. Internal fragmentation 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.

For example, in many file systems, each file always starts at the beginning of a cluster, because this simplifies organization and makes it easier to grow files. Any space left over between the last byte of the file and the first byte of the next cluster is a form of internal fragmentation called file slack or slack space.

          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.

For example, in dynamic memory allocation, a block of 1000 bytes might be requested, but the largest contiguous block of free space has only 300 bytes. Even if there are ten blocks of 300 bytes of free space, separated by allocated regions, one still cannot allocate the requested block of 1000 bytes, and the allocation request will fail.

External fragmentation also occurs in file systems as many files of different sizes are created, change size, and are deleted. The effect is even worse if a file which is divided into many small pieces is deleted, because this leaves similarly small regions of free spaces.

          c. Compaction is a process in which empty blocks or wasted memory are being gathered to make it one block of memory large enough to accommodate jobs that are waiting to be process. Compaction attacks the problem of fragmentation by moving all the allocated blocks to one end of memory, thus combining all the holes. 

4. Cache memory how it works?

  • 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.

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

  •  L1 cache is special,very fast memory built into the central processing unit (CPU) to help facilitate computer performance.By loading frequently used bits of data into L1 cache, the computer can process requests faster. Most computers also have L2 and L3 cache, which are slower than L1 cache but faster than Random Access Memory (RAM).

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.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J1

700KB

BUSY

NONE

1003

720KB

J2

500KB

BUSY

220KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

FREE

1755

610KB

J5

610KB

BUSY

NONE

 *J4-IDLE

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

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J1

700KB

BUSY

NONE

1003

720KB

J5

500KB

BUSY

220KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J5

610KB

BUSY

140KB

1755

610KB

FREE

 *J4-IDLE

C. Use the next-fit algorithm to allocate the memory blocks to the five arriving jobs.

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

FREE

1003

720KB

J5

610KB

BUSY

110KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J1

700KB

BUSY

50KB

1755

610KB

J2

500KB

BUSY

110KB

*J4-IDLE

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

Memory location

Memory block size

Job number

Job size

Status

Internal fragmentation

1132

700KB

J2

500KB

BUSY

200KB

1003

720KB

J5

610KB

BUSY

110KB

1114

800KB

J3

740KB

BUSY

60KB

2310

750KB

J1

700KB

BUSY

50KB

1755

610KB

FREE

 *J4-IDLE

2. Given the following information:

Table 2A.

Job Number

Memory Requested

J1

30KB

J2

50KB

J3

30KB

J4

25KB

J5

35KB

A.fixed partition

ORIGINAL STATE


OF MAIN MEMORY



100KB
25KB
25KB
50KB
30KB

 

AFTER JOB ENTRY

J1


(P1)

J4


(P2)


J3


(P3)


J2


(P4)


30KB



*J5-IDLE

B. Dynamic Partition


NOT INCLUDED




Original State of Main Memory




J1

30KB


J2

50KB



J3

30KB





J5

35KB




initial job entry memory allocation

Original State of Main Memory



J1

30KB



J6

45KB



J5

35KB





after job 2, job 3 and job 4 have finished

Original State of Main Memory

J1

30KB

J7

45KB

J5

35KB

after job 7 have entered and job 6 is waiting

*J6-IDLE

3. Illustrate and find the page number with the displacement of a given program line:          

  •  page size divided by the line number to be located

                                                       200/542=2(quotient)

                                                                          142(remainder)

  •  the quotient (2) is the page number, and the remainder (142) is the displacement. So the line is located on Page 2, 143 lines (Line 142) from the top of the page. 





No comments:

Post a Comment