Osy Model
Osy Model
(Autonomous)
                                     (ISO/IEC - 27001 - 2013 Certified)
            Applications:
            1. Flight Control System
             2. Simulations
            3. Industrial control
            4. Military applications
                                                                                          1|26
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
      4.File system manipulation: Programs may need to read and write data
      from and to the files and directories. Operating system manages the
      secondary storage. Operating system makes it easier for user programs
      to accomplish their task such as opening a file, saving a file and deleting
      a file from the storage disk.
                                                                                    2|26
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
      4.Waiting time: It is the sum of time periods spent in the ready queue
      by a process. When a process is selected from job pool, it is loaded into
      the main memory (ready queue). A process waits in ready queue till
      CPU is allocated to it. Once the CPU is allocated to the process, it starts
      its execution and if required request for resources. When the resources
      are not available that process goes into waiting state and when I/O
      request completes, it goes back to ready queue. In ready queue again it
      waits for CPU allocation.
                                                                                    3|26
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
    a process. In the system, a process can Produce some output fairly early
    and can continue computing new results while previous results are being
    output to the user.
 e  Define virtual memory                                                       2M
Ans Virtual memory is a memory management capability of an operating 2 marks for
    system (OS) that uses hardware and software to allow a computer to           any
    compensate for physical memory shortages by temporarily transferring      relevant
    data from random access memory (RAM) to disk storage.                    definition
    OR
    Virtual memory is the separation of user logical memory from physical
    memory. This separation allows an extremely large virtual memory to
    be provided for programmers when only a smaller physical memory is
    available. Virtual memory makes the task of programming much easier,
    because the programmer no longer needs to worry about the amount of
    physical memory available, or about what code can be placed in
    overlays, but can concentrate instead on the problem to be programmed.
 f  Write syntax for following commands: i)Sleep ii)Kill                        2M
Ans i)sleep                                                                    1 mark
    Syntax:                                                                   each for
    sleep NUMBER[SUFFIX]…                                                      correct
    sleep OPTION                                                               syntax
    ii) kill
    Syntax: kill pid
 g  Describe any four file attributes                                                  2M
Ans File attributes:                                                                Any four
          Name: The symbolic file name is the only information kept in            attributes:
             human readable form.                                                   ½ mark
          Identifier: File system gives a unique tag or number that                  each
             identifies file within file system and which is used to refer files
             internally.
          Type: This information is needed for those systems that support
             different types.
          Location: This information is a pointer to a device and to the
             location of the file on that device.
          Size: The current size of the file (in bytes, words or blocks) and
             possibly the maximum allowed size are included in this attribute.
          Protection: Access control information determines that who can
             do reading, writing, executing and so on.
          Time, Date and User Identification: This information may be
             kept for creation, Last modification and last use. These data can
             be useful for protection, security and usage monitoring.
                                                                                   4|26
                         MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                            (Autonomous)
                                  (ISO/IEC - 27001 - 2013 Certified)
           Multiprogramming:
              In multiprogramming, more than one program lies in the
                 memory.
              The scheduler selects the jobs to be placed in ready queue from a
                 number of programs.
              The ready queue is placed in memory and the existence of more
                 than one program in main memory is known as
                 multiprogramming.
              Since there is only one processor, there multiple programs
                 cannot be executed at a time.
              Instead the operating system executes part of one program, then
                 the part of another and so on.
              Example of multiprogramming: user can open word, excel,
                 access and other applications in a system.
                                                                                   5|26
                     MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                        (Autonomous)
                              (ISO/IEC - 27001 - 2013 Certified)
                                                                                6|26
               MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                 (Autonomous)
                       (ISO/IEC - 27001 - 2013 Certified)
- 2 marks
                                                                          7|26
                    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                       (Autonomous)
                             (ISO/IEC - 27001 - 2013 Certified)
                                                                             8|26
                           MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                               (Autonomous)
                                     (ISO/IEC - 27001 - 2013 Certified)
           Each line in the output shows PID, the terminal with which the process
           is associated, the cumulative processor time that has been consumed
           since the process has been started and the process name.
           Options:
           -f : It is used to display full listing of attributes of a process. It includes
           UID (user ID),PPID(Parent ID),C(amount of CPU time consumed by
           the process) and STIME(chronological time that has elapsed since the
           process started).
           Example: $ ps -f
                                                                                             9|26
                       MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                          (Autonomous)
                                (ISO/IEC - 27001 - 2013 Certified)
      Example: Consider a system with three disk drives and three processes. When
      each process request one disk drive, system allocates one disk drive to each
      process. Now there is no more drive available in the system. If all three
      processes request for one more disk drive, then all three processes will go into
      the waiting state and system will go in deadlock state. Because any one process
      from the three can execute only when one of them will release the disk drive
      allocated to it.
      Necessary Conditions:
      1. Mutual exclusion: At least one resource must be held in a non-
      sharable mode; that is, only one process at a time can use the resource.
      2. Hold and Wait: A process must be holding at least one resource and
      waiting to acquire additional resources that are currently being held by
                                                                                          10 | 2 6
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
other processes.
OR
                                                                                    11 | 2 6
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
                                                                                     12 | 2 6
                          MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                              (Autonomous)
                                    (ISO/IEC - 27001 - 2013 Certified)
                                                                                        13 | 2 6
               MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                   (Autonomous)
                         (ISO/IEC - 27001 - 2013 Certified)
                                                                                14 | 2 6
                     MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                        (Autonomous)
                              (ISO/IEC - 27001 - 2013 Certified)
                                                                                  15 | 2 6
                        MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                              (Autonomous)
                                  (ISO/IEC - 27001 - 2013 Certified)
      Example:
      Process     Burst Time
      P1             24
      P2             3
      P3             3
      Time quantum: 4 ms
      The resulting RR schedule is as follows:
          P1       P2        P3          P1         P1            P1        P1        P1
      0        4         7          10         14            18        22        26        30
          A) User management:
              User management includes everything from creating a user to
                deleting a user on your system. User management can be done
                in three ways on a Linux system.
              Command line tools include commands like useradd, userdel,
                usermod, passwd, etc. These are mostly used by the server
                administrators.
          Useradd: With useradd commands you can add a user.
                                                                                       17 | 2 6
              MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                 (Autonomous)
                       (ISO/IEC - 27001 - 2013 Certified)
B) Device Management:
Device management is the process of managing the implementation,
operation and maintenance of a physical and/or virtual device.
All Linux device files are located in the /dev directory, which is an
integral part of the root (/) filesystem because these device files must
be available to the operating system during the boot process.
Example: ls –l /dev
Above example gives the list of device file from kernel.
Udev supplies a dynamic device directory containing only the nodes
for devices which are connected to the system. It creates or removes
the device node files in the /dev directory.
C) Performance Monitor:
It is very tough job for every system or network administrator to
monitor and debug Linux System Performance problems every day.
The commands discussed below are some of the most fundamental
commands when it comes to system analysis and debugging Linux
server issues such as:
1) vmstat: Virtual memory statistics
The vmstat command reports information about processes, memory,
paging,       block    IO,       traps, and      cpu      activity.
$ vmstat 3
                                                                           18 | 2 6
                    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                       (Autonomous)
                             (ISO/IEC - 27001 - 2013 Certified)
      Many-to-One Model
         The many-to-one model maps many user-level threads to one
            kernel thread.
         Thread management is done by the thread library in user space,
            so it is efficient; but the entire process will block if a thread
            makes a blocking system call.
         Also, because only one thread can access the kernel at a time,
            multiple threads are unable to nm in parallel on
            multiprocessors.
         Example: Green threads- a thread library available for Solaris
                                                                                19 | 2 6
              MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                 (Autonomous)
                       (ISO/IEC - 27001 - 2013 Certified)
Advantages:
    More concurrency because of multiple threads can run in
      parallel on multiple CPUs.
    Less complication in the processing.
Disadvantages:
    Thread creation involves light-weight process creation.
    Kernel thread is an overhead.
    Limiting the number of total threads.
One-to-One Model
   The one-to-one model maps each user thread to a kernel thread.
   It provides more concurrency than the many-to-one model by
      allowing another thread to run when a thread makes a blocking
      system call; it also allows multiple threads to run in parallel on
      multiprocessors.
   The only drawback to this model is that creating a user thread
      requires creating the corresponding kernel thread.
   Because the overhead of creating kernel threads can burden the
      performance of an application, most implementations of this
      model restrict the number of threads supported by the system.
   Linux, along with the family of Windows operating systems,
      implement the one-to-one model.
Advantages:
   Mainly used in language system, portable libraries.
   One kernel thread controls multiple user thread.
Disadvantages:
    Parallelism is not supported by this model.
    One block can blocks all user threads.
Many-to-Many Model
   The many-to-many model multiplexes many user-level threads
      to a smaller or equal number of kernel threads.
   The number of kernel threads may be specific to either a
      particular application or a particular machine (an application
      may be allocated more kernel threads on a multiprocessor than
      on a uniprocessor).
                                                                           20 | 2 6
                   MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                      (Autonomous)
                            (ISO/IEC - 27001 - 2013 Certified)
      Advantages:
           Many threads can be created as per user’s requirement.
           Multiple kernel or equal to user threads can be created.
      Disadvantages:
           True concurrency cannot be achieved.
           Multiple threads of kernel is an overhead for operating system
 c    Explain LRU page replacement algorithm for following reference               6M
      string. 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
      Calculate the page fault.
Ans   LRU:                                                                     LRU
           The Least Recently Used (LRU) page replacement policy              explanation
              replaces the page that has not been used for the longest         =2M
              period of time.                                                  Calculation
           LRU replacement associates with each page the time of that         =4 M
              page's last use.
           When a page must be replaced, LRU chooses the page that has
              not been used for the longest period of time.
           The LRU policy is often used as a page-replacement algorithm
              and is considered to be good.
           An LRU page-replacement algorithm may require substantial
              hardware assistance.
                                                                               21 | 2 6
                      MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                        (Autonomous)
                              (ISO/IEC - 27001 - 2013 Certified)
        Counters:
            In the simplest case, we associate with each page-table entry a
              time-of-use field and add to the CPU a logical clock or counter.
            The clock is incremented for every memory reference.
            Whenever a reference to a page is made, the contents of the
              clock register are copied to the time-of-use field in the page-
              table entry for that page.
            In this way, we always have the "time" of the last reference to
              each page. We replace the page with the smallest time value.
        Stack:
            Another approach to implementing LRU replacement is to keep
               a stack of page numbers.
            Whenever a page is referenced, it is removed from the stack
               and put on the top.
            In this way, the most recently used page is always at the top of
               the stack and the least recently used page is always at the
               bottom.
        Reference String: 7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
        (Frame size have not mentioned in question so assume frame size as 3
        or 4)
        LRU: Assume frame size=3
                    7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1
                    7 7 7 2   2   4 4 4 0     1   1 * 1   *
                      0 0 0 * 0 * 0 0 3 3 *   3   0   0 *
                        1 1     3    3 2 2 2        * 2 * 2        7
        Page Fault=12
        Assume frame size=4
                    7 0 1   2 0 3 0 4 2 3 0 3 2        1 2 0 1 7 0 1
                    7 7 7   7   3   3   *   *          3       7
                      0 0   0 * 0 * 0     *            0   *   0 *
                        1   1   1   4                  1     * 1   *
                            2   2   2 *       *        2 *     2
        Page fault=08
                                                                                 22 | 2 6
                    MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                           (Autonomous)
                                 (ISO/IEC - 27001 - 2013 Certified)
         i)      SJF
         ii)     FCFS
         Also find average waiting time using Gantt chart.
Ans   SJF:                                                                                  Note:
      Non-Preemptive SJF
      Gantt Chart:
       P1          P2         P4          P5          P3
      0         7           11          17          25                          35
OR
      Preemptive SJF
      Gantt Chart:
       P1       P2               P1           P4            P5             P3
      0       1              5               11            17         25             35
                                                                                          23 | 2 6
                     MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                            (Autonomous)
                                 (ISO/IEC - 27001 - 2013 Certified)
      ii) FCFS
      Gantt chart:
        P1         P2         P3                P4           P5
      0         7            11            21              27              35
                                 0=Free block
                                 1= Allocated block
      The main advantage of this approach is its relative simplicity and its
      efficiency in finding the first free block or n consecutive free blocks on
      the disk.
                                                                                          24 | 2 6
                     MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                         (Autonomous)
                               (ISO/IEC - 27001 - 2013 Certified)
      Linked List
          In this approach, the free disk blocks are linked together i.e. a
            free block contains a pointer to the next free block.
          The block number of the very first disk block is stored at a
            separate location on disk and is also cached in memory.
          In this approach, link all the disk blocks together, keeping a
            pointer to the first free block.
          This block contains a pointer to the next free disk block, and so
            on.
                                                                                        25 | 2 6
              MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                 (Autonomous)
                       (ISO/IEC - 27001 - 2013 Certified)
       access.
   •   For direct access to block ‘i’ of a file, which starts at block ‘b’,
       we can immediately access block b+i. The difficulty with
       contiguous allocation is finding space for a new file.
   •   For direct access to block ‘i’ of a file, which starts at block ‘b’,
       we can immediately access block b+i.
   •   The difficulty with contiguous allocation is finding space for a
       new file.
   •   If file to be created are ‘n’ blocks long, we must search free
       space list for ‘n’ free contiguous blocks.
                                                                              26 | 2 6
               MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                    (Autonomous)
                       (ISO/IEC - 27001 - 2005 Certified)
                                                                                          Page 1 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                     Page 2 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                        Page 3 / 21
               MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                    (Autonomous)
                       (ISO/IEC - 27001 - 2005 Certified)
               ii) sleep
               Syntax: sleep NUMBER[SUFFIX]…
               sleep OPTION
       g)      List any four file operations.                                                  2M
      Ans.            Creating a file
                      Writing a file:                                                       Any four
                                                                                            operations
                      Reading a file:                                                       ½ M each
                      Repositioning within a file
                      Deleting a file
                      Appending new information to the end of the file
                      Renaming an existing file.
                      Creating copy of a file, copy file to another I/O device such as
                     printer or display
      
2.             Attempt any THREE of the following:                                             12
       a)      Explain Time sharing O.S.                                                       4M
      Ans.     In time sharing system, the CPU executes multiple jobs by switching
               among them. The switches occur so frequently that the users can
               interact with each program while it is running. It includes an
                                                                                          Page 4 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             In above figure, the user 5 is active but user 1, user 2, user 3, and user
             4 are in waiting state whereas user 6 is in ready status.
       b)    Describe any two components of O.S.                                               4M
      Ans.   List of System Components:
             1. Process management                                                         Description
             2. Main memory management                                                      of any two
                                                                                           components
             3. File management                                                               of OS
             4. I/O system management                                                        2M each
             5. Secondary storage management
             1.Process Management:
             A program is a set of instructions. When CPU is allocated to a
             program, it can start its execution. A program in execution is a
             process. A word processing program run by a user on a PC is a
             process. A process needs various system resources including CPU
             time, memory, files and I/O devices to complete the job execution.
             These resources can be given to the process when it is created or
             allocated to it while it is running.
                                                                                          Page 5 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                       Page 6 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             5. Secondary-Storage Management
             The computer system provides secondary storage to back up main
             memory. Secondary storage is required because main memory is too
             small to accommodate all data and programs, and the data that it
             holds is lost when power is lost. Most of the programs including
             compilers, assemblers, word processors, editors, and formatters are
             stored on a disk until loaded into memory. Secondary storage consists
             of tapes drives, disk drives, and other media.
             The operating system is responsible for the following activities in
             connection with disk management:
              Free space management
              Storage allocation
              Disk scheduling.
                                                                                           Page 7 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
Shared memory
                                                                                    Page 8 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             New: When a process enters into the system, it is in new state. In this
             state a process is created. In new state the process is in job pool.
             Ready: When the process is loaded into the main memory, it is ready
             for execution. In this state the process is waiting for processor
             allocation.
                                                                                       Page 9 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Terminated State:
             When the process completes its execution, it goes into the terminated
             state. In this state the memory occupied by the process is released.
       b)    Describe conditions for deadlock prevention.                                   4M
      Ans.   By ensuring that at least one of below conditions cannot hold, we can
             prevent the occurrence of a deadlock.                                        Any four
                                                                                         conditions
                                                                                          1M each
             1.Mutual Exclusion:
             The mutual-exclusion condition must hold for non-sharable
             resources. Sharable resources do not require mutually exclusive
             access, thus cannot be involved in a deadlock.
             3.No Preemption:
             If a process that is holding some resources requests another resource
             that cannot be immediately allocated to it, then all resources currently
             being held are preempted. That is these resources are implicitly
                                                                                     Page 10 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             4.Circular Wait
             Circular-wait condition never holds is to impose a total ordering of all
             resource types, and to require that each process requests resources in
             an increasing order of enumeration.
             Let R = {R1, R2, ..., Rn} be the set of resource types. We assign to
             each resource type a unique integer number, which allows us to
             compare two resources and to determine whether one precedes
             another in our ordering. Formally, define a one-to-one function F: R
             _ N, where N is the set of natural numbers.
                                                                                        Page 11 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                The directory contains a pointer to the first and the last blocks of
                                                                                        Diagram
                 the file.                                                              Optional
                To create a new file, simply create a new entry in the directory.
                The following figure shows the linked allocation.
                                                                                    Page 12 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                   Page 13 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                               Page 14 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Waiting Time
             P1=0
             P2=9
             P3=16
             P4=19
             Average waiting time=Waiting time of all processes / Number of
             processes
                                     =(0+9+16+19) /4
                                         =44/4
                       =11 milli seconds (ms)
                                                                            Page 15 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             1 )Bit Vector:
             The free-space list is implemented as a bit map or bit vector.
             Each block is represented by 1 bit. If the block is free, the bit is 1; if
             the block is allocated, the bit is 0.
             For example, consider a disk where blocks 2, 3, 4, 5, 8, 9, 10, 11, 12,
             13 are free and the rest of the blocks are allocated.
             The free-space bit map would be : 0011110011111100
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
               0        0    1   1   1    1   0   0   1   1   1   1   1       1   0   0
             1=Free block
             0= Allocated block
             The main advantage of this approach is its relative simplicity and its
             efficiency in finding the first free block or n consecutive free blocks
             on the disk.
             2) Linked List
             In this approach, the free disk blocks are linked together i.e. a free
             block contains a pointer to the next free block. The block number of
             the very first disk block is stored at a separate location on disk and is
             also cached in memory. In this approach, link all the disk blocks
             together, keeping a pointer to the first free block. This block contains
             a pointer to the next free disk block, and so on.
                                                                                          Page 16 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                               Page 17 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             ii) LRU
              Ref     7 0     1   2   0   3   0   4   2   3   0   3   2   1   2   0   1   7   0   1
              F1      7 7     7   2   2   2   2   4   4   4   0   0   0   1   1   1   1   1   1   1
              F2          0
                          0 0 0           0 0     0 0 3 3 3           3   3 3     0 0     0 0     0
              F3          1 1 1           3 3     3 2 2 2 2           2   2 2     2 2     7 7     7
              Fault   F F F F             F       F F F F                 F       F       F
             Total page faults-12
                                                                                                      Page 18 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                        Page 19 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
      Ans.    First Fit: Allocate    Best Fit: Allocate     Worst fit: Allocate
              the first free block   the smallest free      the largest free
              to the new process     block that is big      block to the new
              P4.                    enough          to     process P4.
                                     accommodate new
                                     process P4.
                    O. S.                    O. S.               O. S.
                     P1                       P1                   P1
                   P4 6KB              <FREE> 12 KB          <FREE> 12 KB
                <FREE> 6KB                    P2                   P2
                     P2                <FREE> 19 KB             P4 6 KB
                <FREE> 19 KB                  P3             <FREE> 13 KB
                     P3                   P4 6 KB                  P3
                <FREE> 7 KB             <FREE> 1 KB           <FREE> 7 KB
                                                                                  Page 20 / 21
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
              When we create a file for a user, operating system searches only that
             user’s UFD to find whether same name file already present in the
             directory. For deleting a file again operating system checks the file
             name in the user’ UFD only.
             2. Tree structure:-
              In this directory structure user can create their own sub-directories
             and organize their files. The tree has a root directory and every file
             has a unique path name. A directory contains a set of files or
             subdirectories. All directories have the same internal format. One bit
             in each directory entry defines the entry as a file (0) or as a
             subdirectory (1). Each process has a current directory. Current
             directory contains files that are currently required by the process.
             When reference is made to a file, the current directory is searched. If
             a file needed that is not in the current directory, then the user usually
             must either specify a path name or change the current directory.
                                                                                     Page 21 / 21
                                                  lOMoARcPSD|38558715
Page 1 / 27
Page 2 / 27
      Ans.
                                                                                                Correct
                                                                                                diagram
                                                                                                   2M
Page 3 / 27
Page 4 / 27
MEMORY PERIPHERALS
OR
Page 5 / 27
               Deciding which processes (or parts thereof) and data to move into
                and out of memory.
              Allocating and deallocating memory space as needed.
              Managing swap spaces, which store inactive pages of memory.
              Implementing policies for memory allocation.
             File Management:
              The creation and deletion of files.
              The creation and deletion of directory
              The support of primitives for manipulating files and directions.
              The mapping of files onto secondary storage.
              The backup of files on stable storage media.
              Adding and editing the data in files.
              Moving files from one location to another.
              Store, arrange, or accessing files on a disk or other storage
                 locations.
       c)    Explain shared memory method of IPC using neat labelled            4M
             diagram
      Ans.   Inter-process communication: Cooperating processes require an Explanatio
             Inter- process communication (IPC) mechanism that will allow them   n
             to exchange data and information.                                  3M,
                                                                                              diagram
                                                                                                 1M
Page 6 / 27
Page 7 / 27
                                                                                          Explanatio
             ii)Sleep                                                                       n½M
             Syntax: sleep NUMBER[SUFFIX]
             The sleep command pauses the execution for specified time in
             command.
             iii)Wait
             Syntax: wait [pid]
             Wait command waits for running process to complete and return the
             exit status.
             iv) Exit
             Syntax: exit
             used to quit the shell
             (OR)
             Syntax: exit[n]
             The terminal window will close and return a status of n
       b)    What is deadlock? Discuss any one method of deadlock                              4M
             prevention
      Ans.   A deadlock is a situation where a set of processes are blocked
             because each process is holding a resource and waiting for another           Deadlock
             resource acquired by some other process.                                     definition
             Methods for deadlock prevention (Any 1)                                         1M
             1. Eliminate Mutual Exclusion:
             The mutual-exclusion condition must hold for non-sharable                        Any 1
                                                                                              method
             resources.
                                                                                               3M
             Mutual section from the resource point of view is the fact that a
             resource can never be used by more than one process simultaneously
             which is fair enough but that is the main reason behind the deadlock.
             If a resource could have been used by more than one process at the
             same time then the process would have never been waiting for any
             resource.Read-only files are a good example of a sharable resource. If
             several processes attempt to open a read-only file at the same time,
             they can be granted simultaneous access to the file.
Page 8 / 27
             3. Eliminate No Preemption:
             If a process that is holding some resources requests another resource
             that cannot be immediately allocated to it, then all resources currently
             being held are preempted. That is this resources are implicitly
             released. The preempted resources are added to the list of resources
             for which the process is waiting. Process will be restarted only when
             all the resources i.e. its old resources, as well as the new ones that it is
             requesting will be available.Preemption ensures that resources are
             efficiently utilized and prevents deadlocks caused by the hold and
             wait condition.
Page 9 / 27
0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 0
             The main advantage of this approach is its relative simplicity and its
             efficiency in findingthe first free block or n consecutive free blocks
             on the disk.
       d)    Draw the diagram of linked file allocation method and explain it.                                         4M
             Linked Allocation:
      Ans.   This allocation is on the basis of an individual block. Each block
             contains a pointer to the next block in the chain.                                                       Correct
                                                                                                                      Diagram
              In this scheme, each file is a linked list of disk blocks which need                                     2M
                not be contiguous. The disk blocks can be scattered anywhere on
                the disk.                                                                                         Explanatio
                                                                                                                    n 2M
              The directory contains a pointer to the first and the last blocks of
               the file.
Page 10 / 27
              Space is required for the pointers, 1.5% of disk is used for the
               pointers and not for information. If a pointer is lost or damaged or
               bug occurs in operating system or disk hardware failure occur, it
               may result in picking up the wrong pointer.
Page 11 / 27
      Ans.                                                                                               Any 4
                                     COMMAND LINE                         GRAPHIC USER                 points 1M
                                     INTERFACE (CLI)                      INTERFACE (GUI)                 each
Page 12 / 27
Page 13 / 27
Page 14 / 27
             Gantt Chart
      Ans.
                                                                                              Gantt
                                                                                              chart
                                                                                               2M,
             FCFS
             Waiting time                                                                  Average
             P0=0                                                                           waiting
             P1= (10-1) = 9                                                                  time
             P2= (39-2) = 37                                                              calculation
             P3= (42-3) = 39                                                                  1M,
             P4= (49-4) = 45
             Average Waiting time = Waiting time of all processes / Number of
             processes                                                                     Average
                                 = (0+9+37+39+45)/5 = 26 ms                               turnaroun
             Turnaround Time                                                                d time
                                                                                          calculation
             P0=10
                                                                                              1M
             P1=39-1=38
             P2=42-2=40
             P3=49-3=46
             P4=61-4=57
             Average Turnaround time = Turnaround time of all processes /
             Number of processes
                                 = (10+38+40+46+57)/5
                                 = 191/5
                                 = 38.2 ms
Page 15 / 27
              First Fit: Allocate the   Best Fit: Allocate the           Worst fit: Allocate
      Ans.    first free block to the   smallest free block              the largest free block           Any
              new process               that is big enough to            to the new process             Correct
                                        accommodate new                                               representat
                        OS              process                                    OS                   ion 4M
                       4 KB                         OS                            4 KB
                    <FREE> 1                       4 KB                           9 KB
                       KB                          9 KB                         <FREE>
                      8 KB                        20 KB                          12 KB
                                                  16 KB                           8 KB
                       20 KB
                       16 KB                   <FREE> 0                           16 KB
                        8 KB                      KB                               8 KB
                        2 KB                     8 KB                             2 KB
                        6 KB                            2 KB                       6 KB
                                                        6 KB
             OR
              First Fit: Allocate the   Best Fit: Allocate the           Worst fit: Allocate
              first free block to the   smallest free block              the largest free block
              new process               that is big enough to            to the new process
                                        accommodate new
                                        process
                       OS                          OS                              OS
                      4 KB                        4 KB                            4 KB
                      9 KB                        9 KB                            9 KB
                      20 KB                      20 KB                           20 KB
                      16 KB                      16 KB                           16 KB
                      8 KB                        8 KB                            8 KB
                      2 KB                        2 KB                            2 KB
                      6 KB                        6 KB                            6 KB
Page 16 / 27
             - Use Secure SSH: Telnet and rlogin protocols uses plain text, not
             encrypted format which is the security breaches. SSH is a secure
             protocol that use encryption technology during communication with
             server. Never login directly as root unless necessary. Use “sudo” to
             execute commands.
             $ vi /etc/ssh/sshd_config
             $ PermitRootLogin no #disable root login
             $AllowUsers username # Allow only specific users
             $ Protocol 2 #use SSH protocol 2 version
             Turn Off IPv6: If you are not using a IPv6 protocol, then you should
             disable it because most of the applications or policies not required
             IPv6 protocol and currently it doesn’t required on the server. Go to
             network configuration file and add followings lines to disable it.
             # vi /etc/sysconfig/network
             NETWORKING_IPV6=no
             IPV6INIT=no
Page 17 / 27
Page 18 / 27
Page 19 / 27
             Resource sharing:
             Processes may only share resources through techniques such as
             shared memory or message passing. Such techniques must be
             explicitly arranged by the programmer. However, threads share the
             memory and the resources of the process to which they belong by
             default. The benefit of sharing code and data is that it allows an
             application to have several different threads of activity within the
             same address space.
             Economy:
             Allocating memory and resources for process creation is costly.
             Because threads share the resources of the process to which they
             belong, it is more economical to create and context-switch threads.
             Empirically gauging the difference in overhead can be difficult, but in
             general it is much more time consuming to create and manage
             processes than threads. In Solaris, for example, creating a process is
             about thirty times slower than is creating a thread, and context
             switching is about five times slower.
             Scalability:
             The benefits of multithreading can be greatly increased in a
             multiprocessor architecture, where threads may be running in parallel
             on different processors. A single-threaded process can only run on
             one processor, regardless how many are available. Multithreading on
             a multi-CPU machine increases parallelism.
Page 20 / 27
      Ans.   i) LRU:
             Considering frame size is 3:                                                      LRU
                                                                                               3M
             ii) Optimal:
             Considering Frame size is 3:
                                                                                              Optimal
                                                                                                3M
                                                                                              Reason
                                                                                               2M
                                                                                               Pre-
             Following are the reason, why pre-emptive scheduling is better                   emptive
      Ans.   than non pre-emptive scheduling:                                                  SJF
              Preemptive scheduling is quite flexible because critical processes               2M
                 are allowed to access the CPU because they come in the ready
                 queue and no matter which process is currently running. Non-                 NonPre-
                 preemptive scheduling is tough because if an essential process is            emptive
                 assigned to the ready queue, the CPU process is not be                        SJF
                                                                                                2M
                 interrupted.
Page 21 / 27
Page 22 / 27
             We can find the free block number from the bit vector using the
             following method-
             Block number = (Number of bits per word )* (number of 0-value
             words) + (offset of first bit)
             We will now find the first free block number in the above example.
             The first group of 8 bits (00111100) constitutes a non-zero word since
             all bits are not 0. After finding the non-zero word, we will look for
             the first 1 bit. This is the third character of the non-zero word. Hence,
             offset = 3.
             Therefore, the first free block number = 8 * 0 + 3 = 3.
             Linked List:
             Another method of doing free space management in operating
             systems is a linked list. In this method, all the free blocks existing in
             the disk are linked together in a linked list. The address of the first
Page 23 / 27
Page 24 / 27
Page 25 / 27
             Two-level directory:
             As we have seen, a single level directory often leads to confusion of
             files names among different users. The solution to this problem is to
             create a separate directory for each user.
             In the two-level directory structure, each user has their own user
             files directory (UFD). The UFDs have similar structures, but each
             lists only the files of a single user. System’s master file directory
             (MFD) is searched whenever a new user id is created.
              Searching is very easy.
              There can be two files with the same name in two different user
                 directories. Since they are not in the same directory, the same
                 name can be used.
              Grouping is easier.
              A user cannot enter another user’s directory without permission.
              Implementation is easy.
              It does not allow users to create subdirectories.
Page 26 / 27
             A user do not have access to the root directory data and cannot
             modify it. And, even in this directory the user do not have access to
             other user’s directories. The structure of tree directory is given
             below which shows how there are files and subdirectories in each
             user’s directory.
             •The root directory is highly secured, and only the system
             administrator can access it. We can see how there can be
             subdirectories inside the user directories. A user cannot modify the
             root directory data. Also, a user cannot access another user's
             directory.
             •Allows subdirectories inside a directory.
             •Searching is easy.
             •Allows grouping.
             •Segregation of important and unimportant files is easy.
             •As one user cannot enter another user’s directory, this restricts
             sharing of files.
             •Too many subdirectories may make the search complicated.
             •Users cannot modify the root directory’s data.
Page 27 / 27
                                                                                          Page 1 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             ii. Fragmentation:
             When processes are loaded and removed from memory, the free
             memory space is broken into little pieces which is known as
             fragmentation.
                                                                                   Page 2 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
       f)    Write syntax of PWD command and explain its use with the help            2M
             of suitable example.
      Ans.   Syntax: $ pwd
             PWD command is used to print (display) current working directory.     Syntax 1M
                                                                                     Use &
             Example: $ pwd                                                      example 1M
             Above example displays absolute pathname.
             Output: /home/poly
       g)    List any four file operations.                                          2M
      Ans.     Creating a file
               Writing a file                                                     Any four
                                                                                  operations
               Reading a file                                                    1/2M each
               Repositioning within a file
               Deleting a file
               Appending new information to the end of the file
               Renaming an existing file.
               Truncating a file
               Creating copy of a file, copy file to another I/O device such as
                  printer or display
2.           Attempt any THREE of the following:                                      12
       a)    Explain Resource management of an operating system.                     4M
      Ans.    Resource Management in Operating System is the process to
                manage all the resources efficiently like CPU, memory,               Any
                                                                                   relevant
                input/output devices, and other hardware resources among the explanation
                various programs and processes running in the computer.              4M
              Computer's resources are limited and several users or programs
                may need to utilize the same resources—such as memory and
                CPU—at the same time.
              Operating system has to manage and ensure that all processes get
                the resources they need to execute, without any problems like
                deadlocks.
              Operating systems use various scheduling algorithms to ensure
                that each process gets its fair share of CPU time.
              Operating systems use virtual memory techniques to manage
                memory efficiently.
              Operating systems use file system management techniques to
                manage disk space efficiently.
              File system management allows the operating system to create,
                                                                                 Page 3 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             1.Process Management:
             A program is a set of instructions. When CPU is allocated to a
             program, it can start its execution. A program in execution is a
             process. A word processing program run by a user on a PC is a
             process. A process needs various system resources including CPU
             time, memory, files and I/O devices to complete the job execution.
             These resources can be given to the process when it is created or
             allocated to it while it is running.
             The operating system responsible for the following activities in
             connection with process management:
              Creation and deletion of user and system processes.
              Suspension and resumption of processes.
              A mechanism for process synchronization.
              A mechanism for process communication.
              A mechanism for deadlock handling.
             2. Main-Memory Management
             Main memory is a large array of words or bytes, ranging in size from
             hundreds of thousands to billions. Each word or byte has its own
             address. Main memory is a repository of quickly accessible data
             shared by the CPU and I/O devices. The central processor reads
             instructions from main memory during the instruction fetch cycle and
             both reads and writes data from main memory during the data fetch
             cycle. The main memory is generally the only large storage device
             that the CPU is able to address and access directly.
             The operating system responsible for the following activities in
             connection with main memory s management:
                                                                                    Page 4 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             3. File Management
             A file is a collected of related information defined by its creator.
             Computer can store files on the disk (secondary storage), which
             provide long term storage. Some examples of storage media are
             magnetic tape, magnetic disk and optical disk. Each of these media
             has its own properties like speed, capacity, and data transfer rate and
             access methods. A file system normally organized into directories to
             ease their use. These directories may contain files and other
             directions.
             The operating system responsible for the following activities in
             connection with file management:
              The creation and deletion of files.
              The creation and deletion of directions.
              The support of primitives for manipulating files and directions.
              The mapping of files onto secondary storage.
              The backup of files on stable storage media.
                                                                                           Page 5 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             5. Secondary-Storage Management
             The computer system provides secondary storage to back up main
             memory. Secondary storage is required because main memory is too
             small to accommodate all data and programs, and the data that it
             holds is lost when power is lost. Most of the programs including
             compilers, assemblers, word processors, editors, and formatters are
             stored on a disk until loaded into memory. Secondary storage consists
             of tapes drives, disk drives, and other media.
             The operating system is responsible for the following activities in
             connection with disk management:
              Free space management
              Storage allocation
              Disk scheduling.
       c)    Describe message passing system of interprocess communication             4M
             (IPC)
      Ans.   Message Passing: In this model, communication takes place by            Relevant
                                                                                   explanation
             exchanging messages between cooperating processes. It allows
                                                                                       3M
             processes to communicate and synchronize their action without
             sharing the same address space. It is particularly useful in a          Correct
             distributed environment when communication process may reside on      diagram 1M
             a different computer connected by a network. Communication
             requires sending and receiving messages through the kernel.
             The processes that want to communicate with each other must have a
             communication link between them. Between each pair of processes
             exactly one communication link exists.
                                                                                  Page 6 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                                  Any 4
                                                                                                blocks of
                                                                                              information
                                                                                                 in PCB
                                                                                                   2M
                                                                                             Page 7 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                      Page 8 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Hold and Wait: There must exist a process that is holding at least
             one resource and is waiting to acquire additional resources that are
             currently being held by another process. Process currently holding
             resources granted earlier can request new resources.
                                                                                      Page 9 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Circular Wait: There exist a set (P0, P1, ----- Pn) of waiting
             processes such that P0 is waiting for a resource which is held by P1,
             P1 is waiting for a resource which is held by P2. Pn-1 is waiting for
             resources which are held by Pn and Pn is waiting for a resource which
             is held by P0. Thus there must be a circular chain of two or more
             processes, each of which is waiting for a resource held by the next
             member of the chain.
             ii) Swapping
             Swapping is mechanism in which a process can be swapped
             temporarily out of main memory (or move) to secondary storage
             (disk) and make that memory available to other processes. At some
             later time, the system swaps back the process from the secondary
             storage to main memory.
                                                                                   Page 10 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                  Page 11 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                     Page 12 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             2.File Management
              We can identify several common system calls dealing with files.
                 We first need to be able to create and delete files such a system
                 call requires the name of the file and perhaps some of its
                 attributes.
              Once, the file is created, we need to open it and use it. We may
                 also read, write and reposition. Finally we need to close the file,
                 indicating that we are no longer using it.
             Example of file related system call:
               a. Create file, Delete file
               b. Open a file, Close a file.
               c. Create directory.
               d. Read, Write, Reposition.
               e. Get file attributes, Set file attributes.
               f. Create a link.
               g. Change working directory.
             3.Device Management
              Files can be thought of as abstract or virtual devices. Thus many
                of the system calls for files are also needed for devices.
              If there are multiple users of the system however we must first
                request the device to ensure that we have exclusive use of it. After
                we are finished with the device, we must release it. These
                functions are similar to the open/close system calls for files.
              Once, the device has been requested we can read, write and
                reposition the device just as with files.
                                                                                   Page 13 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             4. Information Maintenance
              Many system calls exist simply for the purpose of transferring
                 information between the user program and the operating system.
                 For example most systems have a system call to return the current
                 time and date.
              Other system calls may return information about the system such
                 as the number of current users, the version number of the
                 operating system, the amount of free memory or disk space and so
                 on.
              In addition the operating system keeps information about all of its
                 jobs and processes and there are system calls to access this
                 information. Generally, there are also calls to reset it. (get process
                 attributes and set process attributes).
             Information Maintenance related system call:
               a. Get Time or Date, Set Time or Date.
               b. Get system Data, Set system Data.
               c. Get process, File or Device attributes.
               d. Set process, File or Device attributes.
             5. Communication
              There are two models of inter-process communication, the
                 message-passing model and the shared memory model.
              Message-passing uses a common mailbox to pass messages
                 between processes
              Shared memory use certain system calls to create and gain access
                 to regions of memory owned by other processes
             Communication related system calls:
               a. Establish a connection.
               b. Send, receive messages.
               c. Terminate a connection
                                                                                      Page 14 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                     Page 15 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                  Page 16 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                  Page 17 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                   Page 18 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Disadvantages:
             1. Kernel threads are generally slower to create and manage than the
             user threads.
             2. Transfer of control from one thread to another within same process
             requires a mode switch to the Kernel.
                                                                                 Page 19 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
OR
OR
                                                                                  Page 20 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
P1 P3 P2
0 8 9 13
                                                                                   Page 21 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
P1 P2 P3 P1 P2 P1 P1
0 2 4 5 7 9 11 13
P1 P2 P3 P1 P2 P1
0 3 6 7 10 11 13
                                                                                      Page 22 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                            Any 1
                                                                                         Disadvantag
              0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                                         e 1M
0 0 1 1 1 1 0 0 1 1 1 1 1 1 0 0
             2) Linked List
             In this approach, the free disk blocks are linked together i.e. a free
             block contains a pointer to the next free block. The block number of
             the very first disk block is stored at a separate location on disk and is
             also cache in memory. In this approach, link all the disk blocks
             together, keeping a pointer to the first free block. This block contains
             a pointer to the next free disk block, and so on.
                                                                                     Page 23 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
                                                                                     Page 24 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Disadvantages
                 Not suitable for a large number of files and more than one
                                                                                          Any 1
                   user.                                                               disadvantag
                 Because of single directory files, files require unique file             e 1M
                   names.
                 Difficult to remember names of all the files as the number of         Two level
                   files increases. MS-DOS OS allows only 11 character file             directory
                                                                                        structure
                   name where as UNIX allows 255 character.                            explanation
                                                                                           1M
                                                                                         Any 1
                                                                                       Advantage
                                                                                          1M
                                                                                          Any 1
                                                                                       disadvantag
                                                                                           e 1M
             When a user refers to a particular file, only his own UFD is searched.
             Different users can have files with the same name, as long as all the
             file names within each UFD are unique.
             When we create a file for a user, operating system searches only that
             user’s UFD to find whether same name file already present in the
             directory. For deleting a file again operating system checks the file
             name in the user’ UFD only.
                                                                                   Page 25 / 26
             MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
                                  (Autonomous)
                     (ISO/IEC - 27001 - 2005 Certified)
             Advantages:
                 It solves isolation. i.e. data of one user is separated from other
                   user.
                 Searching is also efficient in this type of structure.
                 Every user accesses his own directory and files.
                 There is no problem of files with same names in different
                   directories.
             Disadvantages:
                 Two users can not share data or communicate with each other.
                 It is difficult to search the files with same names in different
                   directories.
Page 26 / 26