Tag Archives: char driver

What is Character Driver?

A character device driver is one that transfers data directly to and from a user process. This is the most common type of device driver and there are plenty of simple examples in the source tree. Character device drivers may … Continue reading

Posted in Character Driver | Tagged , , , , | Leave a comment

Add the 20 devices and initialise the user defined structure dev in b/w cdev_init and cdev_add

RCS file: header.h,v Working file: header.h head: 1.6 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 6; selected revisions: 6 description: —————————- revision 1.6 date: 2015/04/28 15:54:10; author: root; state: Exp; lines: +16 -0 define the … Continue reading

Posted in Character Driver, Device Drivers | Tagged , | Leave a comment

Initializing a driver using alloc_chrdev_region()

RCS file: header.h,v Working file: header.h head: 1.10 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 10; selected revisions: 10 description: this is header file here various header files are included such as module param.h init.h … Continue reading

Posted in Character Driver, Device Drivers | Tagged | Leave a comment

Project 05: Character Device Driver

Makefile for a basic kernel module

obj-m += hello-1.o

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean Continue reading

Posted in Character Driver | Tagged , , , , , | 14 Comments

ioctl..

In the ioctl function at driver level…….., the switch(cmd) statement have ‘cmd’ as the argument but we can see cmd is of ‘unsigned int’ type… i want to ask how the switch function perform case matching…. switch(cmd) { case IOSQSET: … Continue reading

Posted in Character Driver, Uncategorized | Tagged | 1 Comment