Are there implications between block/character device and random/sequential access?

Operating System Concepts says:

Devices vary on many dimensions, as illustrated in Figure 13.7.

• Character-stream or block. A character-stream device transfers bytes
one by one, whereas a block device transfers a block of bytes as a
unit.

• Sequential or random access. A sequential device transfers data in a
fixed order determined by the device, whereas the user of a
random-access device can instruct the device to seek to any of the
available data storage locations

Are there implications between block/character device and random/sequential access?

Does block device imply random access?

Does random access imply block device?

Does character device imply sequential access?

Does sequential access imply character device?

Thanks.

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Does block device imply random access?

No, e.g. rewind-only tape with block structure.

Does random access imply block device?

No, though I can’t think of an existing character-stream device with random access. But SSDs and Flash-ROMs in general allow character-specific reading and writing, though only block-specific erasing (which shows that devices can vary in even more dimensions).

Does character device imply sequential access?

That’s equivalent to the second implication (by contraposition).

Does sequential access imply character device?

This is equivalent to the first implication.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply