Character devices and block devices in Linux __linux

Source: Internet
Author: User
I/O devices in Linux fall into two categories: character devices and block devices. The two devices themselves are not strictly restricted, but are categorized based on different functions.
(1) Character devices: Provide continuous data flow, applications can be read sequentially, and usually do not support random access. Instead, this type of device supports reading and writing data by byte/character. For example, keyboards, serial ports, modems are typical character devices.
(2) Block devices: Applications can randomly access device data, the program can determine its own location to read data. hard disks, floppy disks, CD-ROM drives, and flash memory are typical block devices that an application can address anywhere on a disk and read data from it. In addition, data can be read and written only in multiples of blocks (usually 512B). Unlike character devices, block devices do not support character-based addressing.
To sum up, the fundamental difference between the two types of devices is whether they can be accessed randomly. Character devices can only be read sequentially, and block devices are randomly read.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.