Differentiate between block-oriented and character-oriented devices in UNIX


The major differences between block-oriented and character oriented devices are as follows −

Block Oriented Device

Block devices are storage devices that can provide data operations in fixed-size blocks for both reading and writing.

Hard drives, floppy disks, and optical drives, such as DVD-ROMs and CD-ROMs, are some examples of such machines.

Usually, blocking devices read or write the entire block at a time. Most of the file schemes are also based on block computers.

The benefit of block devices is that it provides fewer pins to access data; however, it includes the implementation of a buffering mechanism to speed up access during access to read and write.

Block systems may also only accept input and output in blocks (based on the specifications of the system, the size of such blocks varies).

Advantages −

  • Block oriented devices provides fewer pins to access data.

  • To speed up the access during read and write operations it requires a buffering mechanism.

  • Accepts input and output in blocks .

Disadvantages −

  • At a time the storage is dedicated to one server.

  • Blocks and filesystems have limited metadata

  • Even though we are not using we have to pay for all the block storage that allocates.

  • It requires more hands-on work and setup .

Character oriented devices

Character (Stream) devices can use a few bytes for their operations and it does not requires buffering; the response time and processing speed are faster than the block devices.

On the other hand, memory access is required for file access in the blocking devices, where files need to be mapped in memory, and the speed difference between memory and block devices can cause performance issues.

The provision of kernel caching is one solution to this problem.

This implementation of caching renders the block-devices almost unusable and leads to increased processing of I/O.

The key advantage of character devices

  • In character oriented the I/O can be performed directly between the system and the user and as such, saves the kernel from the copying process and the buffering mechanisms overhead.

  • Direct Memory Access (DMA) can be used to perform such a procedure.

  • However because DMA is limited to 64K, this advantage is almost impossible to achieve.

  • Streaming devices often used less memory than block devices, as the streaming devices needed fewer data to be processed at a time, while block devices required access to a data block at a time.

Updated on: 01-Dec-2021

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements