Device classes: Which of the following is a block device (transferring data in fixed-size blocks rather than character streams)?

Difficulty: Easy

Correct Answer: disk

Explanation:


Introduction / Context:
Operating systems distinguish between character devices (stream-oriented) and block devices (random-access, block-oriented). This affects buffering, caching, and I/O interfaces.



Given Data / Assumptions:

  • Character devices send/receive byte streams (e.g., keyboards, serial ports).
  • Block devices read/write blocks with addressing (e.g., disks).
  • We must choose which listed device is block-oriented.


Concept / Approach:

Disks are canonical block devices: the OS issues reads/writes for blocks identified by logical block numbers, enabling caching and random access. Peripherals like mice, printers, and terminals handle streams of characters or events and are treated as character devices.



Step-by-Step Solution:

Identify device characteristics of each option.Mouse/printer/terminal use streams or lines (character devices).Disk uses fixed-size blocks with random access.Select “disk.”


Verification / Alternative check:

UNIX device taxonomy (e.g., /dev/sdX as block, /dev/tty as character) exemplifies this distinction.



Why Other Options Are Wrong:

  • Mouse, printer, terminals: no block-addressable storage; stream-oriented.


Common Pitfalls:

Confusing printer spool files (which are stored on disks) with the printer device itself; thinking a terminal emulator’s scrollback implies block I/O—it does not.


Final Answer:

disk

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion