What is a character device?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
7
down vote

favorite
1












I was trying to make a partition on my USB drive when I came across some files/entities in /dev/ which seemed unfamiliar (such as hidraw2). When I opened /dev in file manager and looked into their properties, it says that they are character devices. While searching about them, I came across posts that explain what 'block devices' are, but no such post for character devices so far.



I would like to know what a character device is and what it does. Also I wonder about why they are called devices.










share|improve this question

















  • 1




    Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
    – AbraCadaver
    Apr 2 at 20:30















up vote
7
down vote

favorite
1












I was trying to make a partition on my USB drive when I came across some files/entities in /dev/ which seemed unfamiliar (such as hidraw2). When I opened /dev in file manager and looked into their properties, it says that they are character devices. While searching about them, I came across posts that explain what 'block devices' are, but no such post for character devices so far.



I would like to know what a character device is and what it does. Also I wonder about why they are called devices.










share|improve this question

















  • 1




    Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
    – AbraCadaver
    Apr 2 at 20:30













up vote
7
down vote

favorite
1









up vote
7
down vote

favorite
1






1





I was trying to make a partition on my USB drive when I came across some files/entities in /dev/ which seemed unfamiliar (such as hidraw2). When I opened /dev in file manager and looked into their properties, it says that they are character devices. While searching about them, I came across posts that explain what 'block devices' are, but no such post for character devices so far.



I would like to know what a character device is and what it does. Also I wonder about why they are called devices.










share|improve this question













I was trying to make a partition on my USB drive when I came across some files/entities in /dev/ which seemed unfamiliar (such as hidraw2). When I opened /dev in file manager and looked into their properties, it says that they are character devices. While searching about them, I came across posts that explain what 'block devices' are, but no such post for character devices so far.



I would like to know what a character device is and what it does. Also I wonder about why they are called devices.







usb files filesystem






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 2 at 18:44









NurShomik

515




515







  • 1




    Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
    – AbraCadaver
    Apr 2 at 20:30













  • 1




    Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
    – AbraCadaver
    Apr 2 at 20:30








1




1




Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
– AbraCadaver
Apr 2 at 20:30





Also, The hidraw driver provides a raw interface to USB and Bluetooth Human Interface Devices (HIDs).
– AbraCadaver
Apr 2 at 20:30











1 Answer
1






active

oldest

votes

















up vote
10
down vote



accepted










This is a simple explanation:




  • A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, octets).

  • A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.

  • Examples for Character Devices: serial ports, parallel ports, sounds cards.

  • Examples for Block Devices: hard disks, USB cameras, Disk-On-Key.

  • For the user, the type of the Device (block or character) does not matter - you just care that this is a hard disk partition or a sound card.

  • Driver programmers, however, do care.



Here is more:




16.1.4.2 Block and Character Devices
A block device is one that is designed to operate in terms of the block I/O supported by Digital UNIX. It is accessed through the buffer cache. A block device has an associated block device driver that performs I/O by using file system block-sized buffers from a buffer cache supplied by the kernel. Block device drivers are particularly well-suited for disk drives, the most common block devices.



A character device is any device that can have streams of characters read from or written to it. A character device has a character device driver associated with it that can be used for a device such as a line printer that handles one character at a time. However, character drivers are not limited to performing I/O a single character at a time (despite the name ``character'' driver). For example, tape drivers frequently perform I/O in 10K chunks. A character device driver can also be used where it is necessary to copy data directly to or from a user process. Because of their flexibility in handling I/O, many drivers are character drivers. Line printers, interactive terminals, and graphics displays are examples of devices that require character device drivers.




Sources:



http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html



https://arstechnica.com/civis/viewtopic.php?t=787631






share|improve this answer






















  • Thanks for response. This clearly explains both block and character devices.
    – NurShomik
    Apr 2 at 19:59










  • Your welcome @NurShomik!
    – George Udosen
    Apr 2 at 20:11










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1021394%2fwhat-is-a-character-device%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
10
down vote



accepted










This is a simple explanation:




  • A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, octets).

  • A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.

  • Examples for Character Devices: serial ports, parallel ports, sounds cards.

  • Examples for Block Devices: hard disks, USB cameras, Disk-On-Key.

  • For the user, the type of the Device (block or character) does not matter - you just care that this is a hard disk partition or a sound card.

  • Driver programmers, however, do care.



Here is more:




16.1.4.2 Block and Character Devices
A block device is one that is designed to operate in terms of the block I/O supported by Digital UNIX. It is accessed through the buffer cache. A block device has an associated block device driver that performs I/O by using file system block-sized buffers from a buffer cache supplied by the kernel. Block device drivers are particularly well-suited for disk drives, the most common block devices.



A character device is any device that can have streams of characters read from or written to it. A character device has a character device driver associated with it that can be used for a device such as a line printer that handles one character at a time. However, character drivers are not limited to performing I/O a single character at a time (despite the name ``character'' driver). For example, tape drivers frequently perform I/O in 10K chunks. A character device driver can also be used where it is necessary to copy data directly to or from a user process. Because of their flexibility in handling I/O, many drivers are character drivers. Line printers, interactive terminals, and graphics displays are examples of devices that require character device drivers.




Sources:



http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html



https://arstechnica.com/civis/viewtopic.php?t=787631






share|improve this answer






















  • Thanks for response. This clearly explains both block and character devices.
    – NurShomik
    Apr 2 at 19:59










  • Your welcome @NurShomik!
    – George Udosen
    Apr 2 at 20:11














up vote
10
down vote



accepted










This is a simple explanation:




  • A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, octets).

  • A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.

  • Examples for Character Devices: serial ports, parallel ports, sounds cards.

  • Examples for Block Devices: hard disks, USB cameras, Disk-On-Key.

  • For the user, the type of the Device (block or character) does not matter - you just care that this is a hard disk partition or a sound card.

  • Driver programmers, however, do care.



Here is more:




16.1.4.2 Block and Character Devices
A block device is one that is designed to operate in terms of the block I/O supported by Digital UNIX. It is accessed through the buffer cache. A block device has an associated block device driver that performs I/O by using file system block-sized buffers from a buffer cache supplied by the kernel. Block device drivers are particularly well-suited for disk drives, the most common block devices.



A character device is any device that can have streams of characters read from or written to it. A character device has a character device driver associated with it that can be used for a device such as a line printer that handles one character at a time. However, character drivers are not limited to performing I/O a single character at a time (despite the name ``character'' driver). For example, tape drivers frequently perform I/O in 10K chunks. A character device driver can also be used where it is necessary to copy data directly to or from a user process. Because of their flexibility in handling I/O, many drivers are character drivers. Line printers, interactive terminals, and graphics displays are examples of devices that require character device drivers.




Sources:



http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html



https://arstechnica.com/civis/viewtopic.php?t=787631






share|improve this answer






















  • Thanks for response. This clearly explains both block and character devices.
    – NurShomik
    Apr 2 at 19:59










  • Your welcome @NurShomik!
    – George Udosen
    Apr 2 at 20:11












up vote
10
down vote



accepted







up vote
10
down vote



accepted






This is a simple explanation:




  • A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, octets).

  • A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.

  • Examples for Character Devices: serial ports, parallel ports, sounds cards.

  • Examples for Block Devices: hard disks, USB cameras, Disk-On-Key.

  • For the user, the type of the Device (block or character) does not matter - you just care that this is a hard disk partition or a sound card.

  • Driver programmers, however, do care.



Here is more:




16.1.4.2 Block and Character Devices
A block device is one that is designed to operate in terms of the block I/O supported by Digital UNIX. It is accessed through the buffer cache. A block device has an associated block device driver that performs I/O by using file system block-sized buffers from a buffer cache supplied by the kernel. Block device drivers are particularly well-suited for disk drives, the most common block devices.



A character device is any device that can have streams of characters read from or written to it. A character device has a character device driver associated with it that can be used for a device such as a line printer that handles one character at a time. However, character drivers are not limited to performing I/O a single character at a time (despite the name ``character'' driver). For example, tape drivers frequently perform I/O in 10K chunks. A character device driver can also be used where it is necessary to copy data directly to or from a user process. Because of their flexibility in handling I/O, many drivers are character drivers. Line printers, interactive terminals, and graphics displays are examples of devices that require character device drivers.




Sources:



http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html



https://arstechnica.com/civis/viewtopic.php?t=787631






share|improve this answer














This is a simple explanation:




  • A Character ('c') Device is one with which the Driver communicates by sending and receiving single characters (bytes, octets).

  • A Block ('b') Device is one with which the Driver communicates by sending entire blocks of data.

  • Examples for Character Devices: serial ports, parallel ports, sounds cards.

  • Examples for Block Devices: hard disks, USB cameras, Disk-On-Key.

  • For the user, the type of the Device (block or character) does not matter - you just care that this is a hard disk partition or a sound card.

  • Driver programmers, however, do care.



Here is more:




16.1.4.2 Block and Character Devices
A block device is one that is designed to operate in terms of the block I/O supported by Digital UNIX. It is accessed through the buffer cache. A block device has an associated block device driver that performs I/O by using file system block-sized buffers from a buffer cache supplied by the kernel. Block device drivers are particularly well-suited for disk drives, the most common block devices.



A character device is any device that can have streams of characters read from or written to it. A character device has a character device driver associated with it that can be used for a device such as a line printer that handles one character at a time. However, character drivers are not limited to performing I/O a single character at a time (despite the name ``character'' driver). For example, tape drivers frequently perform I/O in 10K chunks. A character device driver can also be used where it is necessary to copy data directly to or from a user process. Because of their flexibility in handling I/O, many drivers are character drivers. Line printers, interactive terminals, and graphics displays are examples of devices that require character device drivers.




Sources:



http://haifux.org/lectures/86-sil/kernel-modules-drivers/node10.html



https://arstechnica.com/civis/viewtopic.php?t=787631







share|improve this answer














share|improve this answer



share|improve this answer








edited Apr 2 at 19:37









wjandrea

7,18342255




7,18342255










answered Apr 2 at 19:01









George Udosen

17.2k93761




17.2k93761











  • Thanks for response. This clearly explains both block and character devices.
    – NurShomik
    Apr 2 at 19:59










  • Your welcome @NurShomik!
    – George Udosen
    Apr 2 at 20:11
















  • Thanks for response. This clearly explains both block and character devices.
    – NurShomik
    Apr 2 at 19:59










  • Your welcome @NurShomik!
    – George Udosen
    Apr 2 at 20:11















Thanks for response. This clearly explains both block and character devices.
– NurShomik
Apr 2 at 19:59




Thanks for response. This clearly explains both block and character devices.
– NurShomik
Apr 2 at 19:59












Your welcome @NurShomik!
– George Udosen
Apr 2 at 20:11




Your welcome @NurShomik!
– George Udosen
Apr 2 at 20:11

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1021394%2fwhat-is-a-character-device%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

pylint3 and pip3 broken

Missing snmpget and snmpwalk

How to enroll fingerprints to Ubuntu 17.10 with VFS491