From: Thadeu Lima de Souza Cascardo Date: Tue, 1 Dec 2009 10:53:05 +0000 (-0200) Subject: Device types and char device registering. X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;ds=sidebyside;h=464a89f04248ac8385e14c2d581008a125c0a2a2;p=cascardo%2Fkernel%2Fold_slides%2F.git Device types and char device registering. --- diff --git a/_ldd.xml b/_ldd.xml index e26b90a..4930ffc 100644 --- a/_ldd.xml +++ b/_ldd.xml @@ -203,4 +203,24 @@ boolean, integers or strings, are given by the user. + +Device types and numbers + +Linux devices may be of different types, including character devices, +block devices or network devices. Both character and block devices have +identifying numbers, a major and a minor number. + + +In Linux, major and minor numbers have to be requested or allocated. The +calls to do that are: + + +int register\_chrdev\_region (dev\_t first, unsigned int count, char +*name); +int alloc\_chrdev\_region (dev\_t *dev, unsigned int firstminor, +unsigned int count, char *name); +void unregister\_chrdev\_region (dev\_t dev, unsigned int count); + + +