Skip to content

Instantly share code, notes, and snippets.

@LukaAntoljak
Forked from 6TELOIV/.README.md
Last active April 17, 2020 00:30
Show Gist options
  • Save LukaAntoljak/93b48b96241f8556a18ffa69168655d2 to your computer and use it in GitHub Desktop.
Save LukaAntoljak/93b48b96241f8556a18ffa69168655d2 to your computer and use it in GitHub Desktop.
OS Quiz Questions and answers

Understanding the file format

Each file contains the questions and answers for one quiz. Unanswered questions are bolded. Questions have the following format:

- What is the color of the sky?
  - Blue

Don't include wrong answers, except for choose all that apply, in that case, incorrect and correct answers should be listed, with [ ] for incorrect answers and [X] for correct ones. The question should be followed by (Check all). Example:

- Which classes at UF make me want to die? (Check all)
  - [X] OS
  - [ ] All other classes
  - [ ] Like, literally all of them

Also, lines should be broken approximately every 64 characters, so that they can be read in non-line wrapping text editors/viewers.

Quiz 9 Files

  • When is the refference count in an i-node increase? (Check all)

    • When a process with the file open forks
    • When a process writes to the file
    • When a process reads from the file
    • When a directory entry is linked to the file
  • Which of the following types of file is most likely to exhibit strong locality of access? (Check all)

    • Database
    • Digital Movie
    • Audio File
    • Electronic Novel
    • Spanish-English Dictionary
  • How many disk accesses are needed to bring byte i of a file into memory when the file is stored using contiguous allocation Assume only the file's FCB is in memory, block pointers require 32 bits, and that blocks hold 4096 bytes each.

    • 1 access
  • How many disk accesses are needed to bring byte i of a file into memory when the file is stored using double indirect indexed allocation? Assume only the file's FCB is in memory, block pointers require 32 bits, and that blocks hold 4096 bytes each.

    • 3 accesses
  • How many disk accesses are needed to bring byte i of a file into memory when the file is stored using indexed allocation? Assume only the file's FCB is in memory, block pointers require 32 bits, and that blocks hold 4096 bytes each.

    • 2 accesses
  • What is the largest file size that can be allocated if blocks hold 4096 bytes, block pointers are 32 bits, and files are stored using indexed allocation?

    • 4MB
  • What is the largest file size that can be allocated if blocks hold 4096 bytes, block pointers are 32 bits, and files are stored using double indexed allocation?

    • 4GB
  • What is the largest file size that can be allocated if blocks hold 4096 bytes, block pointers are 32 bits, and files are stored using linked allocation?

    • 16TB

Quiz 10 Disk

  • A disk takes 1ms per track seek time, and the head is currently on track 70. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, track) in order of arrival. How much time does it take to service all the requests if the elevator algorithm is used an the current direction is down? Requests: (A,80)(B,75)(C,82)(D,90)(E,45)

    • 95 ms
  • A disk takes 1ms per track seek time, and the head is currently on track 70. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, track) in order of arrival. What is the order in which requests are serviced if the policy is SSF (aka SSTF)? Requests: (A,55)(B,53)(C,40)(D,48)(E,45)

    • DECBA
  • A disk takes 1ms per track seek time, and the head is currently on track 70. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, track) in order of arrival. How much time does it take to service all the requests if the policy is SSF (aka SSTF)? Requests: (A,55)(B,53)(C,40)(D,48)(E,45)

    • 50ms
  • A disk takes 1ms per track seek time, and the head is currently on track 70. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, track) in order of arrival. What is the order in which the requests are serviced if the Elevator algorithm is used and the current direction is down? Requests: (A,80)(B,75)(C,82)(D,90)(E,45)

    • EBACD
  • A disk takes 1ms per track seek time, and the head is currently on track 50. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, arrival time in ms, track). When is the last request finished if the policy is SSF (aka SSTF)? Requests: (A,3,55)(B,4,53)(C,8,40)(D,10,48)(E,32,45)

    • 53 ms
  • A disk takes 1ms per track seek time, and the head is currently on track 50. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, arrival time in ms, track). What is the order in which the requests are serviced if the policy is SSF (aka SSTF)? Requests: (A,3,55)(B,4,53)(C,8,40)(D,10,48)(E,32,45)

    • ABDCE
  • A disk takes 1ms per track seek time, and the head is currently on track 50. Assume it takes 5ms to service a request once the head is at the right track. The following set of requests are pending, given as (ID, arrival time in ms, track). What is the order in which the requests are serviced if the Elevator algorithm is used an the current direction is down? Requests: (A,0,80)(B,4,75)(C,12,82)(D,20,90)(E,32,45)

    • ACDBE

    Added answer '53 ms' to #5

Quiz 11 IO

  • Suppose you have a harddrive that spins at 9000 RPM, and has 80 sectors of 512 bytes each on a particular track. If the head is already in position when a request for a single sector of that track is serviced, what is the expected effective data rate to get the data into the controller's buffer? Give the answer in BPS with 3 significant digits.

    • 150,000
  • The IBM 1402 Card Reader could read 800 cards per minute. Each card had 80 columns, each of which could hold one byte in EBCDIC. What was the approximate data rate of this machine in bytes/second (round to the nearest integer)

    • 1,067
  • A typical US Keyboard has a total of 104 keys. If CTL, ALT, ALT2, and SHIFT may be used in any combination to modify any of the remaining keys, how many character codes can be generated, asssuming there is no distinction between left and right bersions of these four modifier keys (they all habe two versions) but there is a distinction between all other keys (e.g., the key labeled 1 above the Q key and the 1 key on the numeric keypad are not different)?

    • 1,536
  • In Linux and Unix, the type of disk is determined by the _____ device number, while the particular volume is identified by the _____ device number.

    • major, minor
  • The _____ codes passed from the keyboard to the driver are converted to character codes using a _____.

    • scan
    • keymap

Added answers '150,000', '1,536' and 'scan' to unanswered parts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment