RCS file: header.h,vDECELERATIONS File
Working file: header.h
head: 1.6
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
This si the base header file
----------------------------
revision 1.6
date: 2014/11/16 08:56:59; author: root; state: Exp; lines: +1 -0
Included moduleparam.h
for module_param() macro.
----------------------------
revision 1.5
date: 2014/11/16 08:11:22; author: root; state: Exp; lines: +2 -0
Includec cdev.h and slab.h for struct cdev and kmalloc()
----------------------------
revision 1.4
date: 2014/11/16 07:54:24; author: root; state: Exp; lines: +8 -0
Defined the macros for MINORNO and NOD.
----------------------------
revision 1.3
date: 2014/11/09 10:26:03; author: root; state: Exp; lines: +8 -0
Defined the Macreos
MAJORNO and DEVNAME
----------------------------
revision 1.2
date: 2014/11/09 10:01:54; author: root; state: Exp; lines: +1 -0
Included fs.h
----------------------------
revision 1.1
date: 2014/11/09 09:36:05; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.7
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 7; selected revisions: 7
description:
This file would contsin all the decleration for our driver.
----------------------------
revision 1.7
date: 2014/11/16 09:06:43; author: root; state: Exp; lines: +1 -1
declared new_dev for using with multiple devices.
----------------------------
revision 1.6
date: 2014/11/16 08:44:44; author: root; state: Exp; lines: +1 -1
defined struct file_operations
----------------------------
revision 1.5
date: 2014/11/16 08:12:09; author: root; state: Exp; lines: +13 -0
Gave the decleration for struct ScullDev and struct ScullQset.
----------------------------
revision 1.4
date: 2014/11/16 07:55:39; author: root; state: Exp; lines: +4 -2
declared variables minorno, nod, dev.
removed the decleration of struct file_operations
----------------------------
revision 1.3
date: 2014/11/09 10:26:54; author: root; state: Exp; lines: +3 -0
gave the prototype for initialization().
----------------------------
revision 1.2
date: 2014/11/09 10:17:58; author: root; state: Exp; lines: +1 -1
declared exters struct file_operations
----------------------------
revision 1.1
date: 2014/11/09 10:10:26; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: init.c,v
Working file: init.c
head: 1.17
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 17; selected revisions: 17
description:
Initialization function.
----------------------------
revision 1.17
date: 2014/11/16 09:09:35; author: root; state: Exp; lines: +2 -2
*** empty log message ***
----------------------------
revision 1.16
date: 2014/11/16 09:08:31; author: root; state: Exp; lines: +1 -1
declared lv.
----------------------------
revision 1.15
date: 2014/11/16 09:07:07; author: root; state: Exp; lines: +20 -15
Multiple devices.
registering, allocating, initializing and adding for all devices.
----------------------------
revision 1.14
date: 2014/11/16 08:58:47; author: root; state: Exp; lines: +1 -0
Diaplaying nod.
----------------------------
revision 1.13
date: 2014/11/16 08:57:27; author: root; state: Exp; lines: +4 -2
using macro module_param() for accepting module parameters.
accepting nod here.
----------------------------
revision 1.12
date: 2014/11/16 08:32:08; author: root; state: Exp; lines: +6 -4
testing our driver using cdev.
fetching device id from cdev.
----------------------------
revision 1.11
date: 2014/11/16 08:25:40; author: root; state: Exp; lines: +9 -0
initialized the device specific structure cdev.
also added it to the device table.
----------------------------
revision 1.10
date: 2014/11/16 08:13:07; author: root; state: Exp; lines: +1 -0
defined ScullDev.
----------------------------
revision 1.9
date: 2014/11/16 08:11:39; author: root; state: Exp; lines: +9 -2
Allocated space on the scull device for IO.
----------------------------
revision 1.8
date: 2014/11/16 07:54:46; author: root; state: Exp; lines: +12 -4
registered the driver usig alloc_chrdev_region()
Fetched the majorno and minorno using macros MAJOR and MINOR respectively.
----------------------------
revision 1.7
date: 2014/11/09 10:27:38; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.6
date: 2014/11/09 10:26:21; author: root; state: Exp; lines: +7 -3
Implemented initialization() that initializes all the variables to default values from Macros.
----------------------------
revision 1.5
date: 2014/11/09 10:17:46; author: root; state: Exp; lines: +1 -2
Declared struct file_operations.
----------------------------
revision 1.4
date: 2014/11/09 10:09:05; author: root; state: Exp; lines: +2 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2014/11/09 10:03:49; author: root; state: Exp; lines: +1 -0
Printing maojr no.
----------------------------
revision 1.2
date: 2014/11/09 10:02:06; author: root; state: Exp; lines: +13 -0
Registering the driver with the kernel using register_chrdev().
Obtaining major no.
----------------------------
revision 1.1
date: 2014/11/09 09:36:05; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.10
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
This is the cleanup function.
----------------------------
revision 1.10
date: 2014/11/16 09:08:56; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.9
date: 2014/11/16 09:07:33; author: root; state: Exp; lines: +4 -2
using cdev_del() for deleting device mapping foe all devices.
----------------------------
revision 1.8
date: 2014/11/16 08:26:38; author: root; state: Exp; lines: +1 -0
deleting the device definition from device table using cdev_del()
----------------------------
revision 1.7
date: 2014/11/16 08:11:53; author: root; state: Exp; lines: +1 -0
freeing memory using kfree()
----------------------------
revision 1.6
date: 2014/11/16 07:55:24; author: root; state: Exp; lines: +1 -1
Unregistered tghe driver using unregister_chrdev_region()
----------------------------
revision 1.5
date: 2014/11/09 10:26:51; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/11/09 10:11:58; author: root; state: Exp; lines: +3 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2014/11/09 10:11:06; author: root; state: Exp; lines: +1 -0
Declered majorno.
----------------------------
revision 1.2
date: 2014/11/09 10:09:11; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.1
date: 2014/11/09 09:36:05; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: header.h,v
Working file: header.h
head: 1.11
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 11; selected revisions: 11
description:
This is the base header file for our Characrer driver.
All the headers and Mocros will be put here.
----------------------------
revision 1.11
date: 2015/02/07 05:04:59; author: root; state: Exp; lines: +0 -13
*** empty log message ***
----------------------------
revision 1.10
date: 2015/02/05 09:08:58; author: root; state: Exp; lines: +1 -0
Included uaccess.h
----------------------------
revision 1.9
date: 2015/02/02 08:03:04; author: root; state: Exp; lines: +1 -0
included kernel.h
----------------------------
revision 1.8
date: 2015/01/29 08:35:52; author: root; state: Exp; lines: +2 -2
*** empty log message ***
----------------------------
revision 1.7
date: 2015/01/29 08:33:59; author: root; state: Exp; lines: +17 -0
Difuned macros
DEVIE_SIZE, DATA_SIZE, QSET_SIZE, QUANTUM_SIZE
----------------------------
revision 1.6
date: 2015/01/29 08:17:49; author: root; state: Exp; lines: +1 -0
Included moduleparam.h
----------------------------
revision 1.5
date: 2015/01/29 07:54:59; author: root; state: Exp; lines: +1 -0
Included cdev.h
----------------------------
revision 1.4
date: 2015/01/27 11:25:35; author: root; state: Exp; lines: +1 -0
Included linux/slab.h for kmalloc() and kfree()
----------------------------
revision 1.3
date: 2015/01/27 10:57:07; author: root; state: Exp; lines: +8 -0
Defined macros
MINORNO and NOD
----------------------------
revision 1.2
date: 2015/01/25 06:56:36; author: root; state: Exp; lines: +9 -0
Included fs.h
Gave macros
MAJORNO, DEVNAME
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.11
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 11; selected revisions: 11
description:
This header file would contain all the declerations and function prototypes.
----------------------------
revision 1.11
date: 2015/02/07 04:50:37; author: root; state: Exp; lines: +1 -0
Gave the prototype for dev_trim()
----------------------------
revision 1.10
date: 2015/02/01 07:59:25; author: root; state: Exp; lines: +1 -0
gave prototype for dev_release()
----------------------------
revision 1.9
date: 2015/02/01 07:56:52; author: root; state: Exp; lines: +1 -0
gave the prototype for dev_open()
----------------------------
revision 1.8
date: 2015/02/01 06:45:26; author: root; state: Exp; lines: +1 -1
declared newdev
----------------------------
revision 1.7
date: 2015/01/31 05:10:12; author: root; state: Exp; lines: +1 -0
Declared struct cdev inside struct Dev.
----------------------------
revision 1.6
date: 2015/01/31 04:44:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2015/01/31 04:40:37; author: root; state: Exp; lines: +13 -1
gave the decleration for struct Dev and Struct Qset
Declared extern pointers for these.
----------------------------
revision 1.4
date: 2015/01/31 04:26:36; author: root; state: Exp; lines: +2 -4
Declared variables minorno, nod.
Removed decleration for file_operations
----------------------------
revision 1.3
date: 2015/01/25 07:02:31; author: root; state: Exp; lines: +2 -2
Removed the definition of struct file_operations.
----------------------------
revision 1.2
date: 2015/01/25 07:01:54; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2015/01/25 07:01:09; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: file_opr.h,v
Working file: file_opr.h
head:
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 0
description:
Containssystem call mappings to driver routines.
mapped open and release.
=============================================================================
RCS file: init.c,v
Working file: init.c
head: 1.12
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 12; selected revisions: 12
description:
This is the Initialization function for the Character Driver.
This will initilaize, register the driver with the kernel and the kernel table.
This will also initializa the devices.
----------------------------
revision 1.12
date: 2015/02/01 07:01:40; author: root; state: Exp; lines: +2 -2
Cross check for adding device attributes to device table.
by fetching device if from struct cdev.
----------------------------
revision 1.11
date: 2015/02/01 06:49:00; author: root; state: Exp; lines: +4 -0
*** empty log message ***
----------------------------
revision 1.10
date: 2015/02/01 06:47:25; author: root; state: Exp; lines: +2 -2
Declared the loop variable
----------------------------
revision 1.9
date: 2015/02/01 06:45:36; author: root; state: Exp; lines: +20 -13
Initialized for nod number of devices.
nod value is accepted as module parameter using macro module_param()
----------------------------
revision 1.8
date: 2015/01/31 05:10:34; author: root; state: Exp; lines: +13 -0
Initialized the device specific structure struct cdev using cdev_init()
mapped owner and ops fields.
add this to the device table using cdev_add().
----------------------------
revision 1.7
date: 2015/01/31 04:41:19; author: root; state: Exp; lines: +19 -4
allocated space on the device according to struct Dev using kmalloc()
----------------------------
revision 1.6
date: 2015/01/31 04:27:01; author: root; state: Exp; lines: +12 -5
Registering driver using alloc_chrdev_region()
----------------------------
revision 1.5
date: 2015/01/25 07:07:04; author: root; state: Exp; lines: +3 -3
Printing major no.
----------------------------
revision 1.4
date: 2015/01/25 07:05:28; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2015/01/25 07:04:22; author: root; state: Exp; lines: +1 -0
Declared fops.
----------------------------
revision 1.2
date: 2015/01/25 06:56:59; author: root; state: Exp; lines: +29 -1
Trying to register the driver using register_chrdev()
and obtain the najor no.
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: exit.c,v
Working file: exit.c
head: 1.8
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
This is the cleanup function.
This will unregister and deinitialize our device
It will remove the driver from the kernel.
----------------------------
revision 1.8
date: 2015/02/01 06:46:06; author: root; state: Exp; lines: +4 -1
deleting nod number of devices.
----------------------------
revision 1.7
date: 2015/01/31 05:11:22; author: root; state: Exp; lines: +2 -1
remeve the device description from the device table.
using cdev_del()
----------------------------
revision 1.6
date: 2015/01/31 04:44:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2015/01/31 04:41:43; author: root; state: Exp; lines: +1 -0
freed allocated space using kfree()
----------------------------
revision 1.4
date: 2015/01/31 04:27:14; author: root; state: Exp; lines: +1 -1
Unregistering using unregister_chrdev_region()
----------------------------
revision 1.3
date: 2015/01/25 07:03:30; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2015/01/25 06:57:22; author: root; state: Exp; lines: +2 -0
unregistering the driver using unregister_chrdev().
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: dev_open.c,v
Working file: dev_open.c
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
This is the driver routing for opening the device.
Just checking for the mappings right now.
----------------------------
revision 1.5
date: 2015/02/07 05:00:01; author: root; state: Exp; lines: +10 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2015/02/07 04:49:32; author: root; state: Exp; lines: +37 -1
Checking , if the device is being opened in the wroteonly mode , then trimming it.
Implementing dev_trim()
----------------------------
revision 1.3
date: 2015/02/07 04:39:51; author: root; state: Exp; lines: +1 -0
Included declerations.h
----------------------------
revision 1.2
date: 2015/02/07 04:38:48; author: root; state: Exp; lines: +26 -1
Implementing open
----------------------------
revision 1.1
date: 2015/02/01 07:57:03; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: dev_release.c,v
Working file: dev_release.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
This is the driver routing for closing the device.
----------------------------
revision 1.1
date: 2015/02/01 08:01:22; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: header.h,v
Working file: header.h
head: 1.14
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 14; selected revisions: 14
description:
This is the base header file for our Characrer driver.
All the headers and Mocros will be put here.
----------------------------
revision 1.14
date: 2015/02/08 10:22:39; author: root; state: Exp; lines: +1 -0
Included uaccess.h
----------------------------
revision 1.13
date: 2015/02/08 08:26:51; author: root; state: Exp; lines: +6 -0
Defined Macros
QUANTUM_SIZE, QSET_SIZE
----------------------------
revision 1.12
date: 2015/02/08 07:21:51; author: root; state: Exp; lines: +0 -3
Included string.h
----------------------------
revision 1.11
date: 2015/02/07 05:04:59; author: root; state: Exp; lines: +0 -13
*** empty log message ***
----------------------------
revision 1.10
date: 2015/02/05 09:08:58; author: root; state: Exp; lines: +1 -0
Included uaccess.h
----------------------------
revision 1.9
date: 2015/02/02 08:03:04; author: root; state: Exp; lines: +1 -0
included kernel.h
----------------------------
revision 1.8
date: 2015/01/29 08:35:52; author: root; state: Exp; lines: +2 -2
*** empty log message ***
----------------------------
revision 1.7
date: 2015/01/29 08:33:59; author: root; state: Exp; lines: +17 -0
Difuned macros
DEVIE_SIZE, DATA_SIZE, QSET_SIZE, QUANTUM_SIZE
----------------------------
revision 1.6
date: 2015/01/29 08:17:49; author: root; state: Exp; lines: +1 -0
Included moduleparam.h
----------------------------
revision 1.5
date: 2015/01/29 07:54:59; author: root; state: Exp; lines: +1 -0
Included cdev.h
----------------------------
revision 1.4
date: 2015/01/27 11:25:35; author: root; state: Exp; lines: +1 -0
Included linux/slab.h for kmalloc() and kfree()
----------------------------
revision 1.3
date: 2015/01/27 10:57:07; author: root; state: Exp; lines: +8 -0
Defined macros
MINORNO and NOD
----------------------------
revision 1.2
date: 2015/01/25 06:56:36; author: root; state: Exp; lines: +9 -0
Included fs.h
Gave macros
MAJORNO, DEVNAME
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
This header file would contain all the declerations and function prototypes.
----------------------------
revision 1.15
date: 2015/02/08 10:05:54; author: root; state: Exp; lines: +1 -0
Gave the prototype for creat_quantums()
----------------------------
revision 1.14
date: 2015/02/08 09:48:14; author: root; state: Exp; lines: +1 -0
Gave the prototype for creat_qste();
----------------------------
revision 1.13
date: 2015/02/08 08:28:52; author: root; state: Exp; lines: +4 -0
gave the definition for quantum_size, qset_size.
----------------------------
revision 1.12
date: 2015/02/08 07:22:23; author: root; state: Exp; lines: +1 -0
gave the prototype for write routine.
----------------------------
revision 1.11
date: 2015/02/07 04:50:37; author: root; state: Exp; lines: +1 -0
Gave the prototype for dev_trim()
----------------------------
revision 1.10
date: 2015/02/01 07:59:25; author: root; state: Exp; lines: +1 -0
gave prototype for dev_release()
----------------------------
revision 1.9
date: 2015/02/01 07:56:52; author: root; state: Exp; lines: +1 -0
gave the prototype for dev_open()
----------------------------
revision 1.8
date: 2015/02/01 06:45:26; author: root; state: Exp; lines: +1 -1
declared newdev
----------------------------
revision 1.7
date: 2015/01/31 05:10:12; author: root; state: Exp; lines: +1 -0
Declared struct cdev inside struct Dev.
----------------------------
revision 1.6
date: 2015/01/31 04:44:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2015/01/31 04:40:37; author: root; state: Exp; lines: +13 -1
gave the decleration for struct Dev and Struct Qset
Declared extern pointers for these.
----------------------------
revision 1.4
date: 2015/01/31 04:26:36; author: root; state: Exp; lines: +2 -4
Declared variables minorno, nod.
Removed decleration for file_operations
----------------------------
revision 1.3
date: 2015/01/25 07:02:31; author: root; state: Exp; lines: +2 -2
Removed the definition of struct file_operations.
----------------------------
revision 1.2
date: 2015/01/25 07:01:54; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2015/01/25 07:01:09; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
This header file would contain all the declerations and function prototypes.
----------------------------
revision 1.15
date: 2015/02/08 10:05:54; author: root; state: Exp; lines: +1 -0
Gave the prototype for creat_quantums()
----------------------------
revision 1.14
date: 2015/02/08 09:48:14; author: root; state: Exp; lines: +1 -0
Gave the prototype for creat_qste();
----------------------------
revision 1.13
date: 2015/02/08 08:28:52; author: root; state: Exp; lines: +4 -0
gave the definition for quantum_size, qset_size.
----------------------------
revision 1.12
date: 2015/02/08 07:22:23; author: root; state: Exp; lines: +1 -0
gave the prototype for write routine.
----------------------------
revision 1.11
date: 2015/02/07 04:50:37; author: root; state: Exp; lines: +1 -0
Gave the prototype for dev_trim()
----------------------------
revision 1.10
date: 2015/02/01 07:59:25; author: root; state: Exp; lines: +1 -0
gave prototype for dev_release()
----------------------------
revision 1.9
date: 2015/02/01 07:56:52; author: root; state: Exp; lines: +1 -0
gave the prototype for dev_open()
----------------------------
revision 1.8
date: 2015/02/01 06:45:26; author: root; state: Exp; lines: +1 -1
declared newdev
----------------------------
revision 1.7
date: 2015/01/31 05:10:12; author: root; state: Exp; lines: +1 -0
Declared struct cdev inside struct Dev.
----------------------------
revision 1.6
date: 2015/01/31 04:44:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2015/01/31 04:40:37; author: root; state: Exp; lines: +13 -1
gave the decleration for struct Dev and Struct Qset
Declared extern pointers for these.
----------------------------
revision 1.4
date: 2015/01/31 04:26:36; author: root; state: Exp; lines: +2 -4
Declared variables minorno, nod.
Removed decleration for file_operations
----------------------------
revision 1.3
date: 2015/01/25 07:02:31; author: root; state: Exp; lines: +2 -2
Removed the definition of struct file_operations.
----------------------------
revision 1.2
date: 2015/01/25 07:01:54; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2015/01/25 07:01:09; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: file_opr.h,v
Working file: file_opr.h
head:
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 0
description:
Containssystem call mappings to driver routines.
mapped open and release.
=============================================================================
RCS file: init.c,v
Working file: init.c
head: 1.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
This is the Initialization function for the Character Driver.
This will initilaize, register the driver with the kernel and the kernel table.
This will also initializa the devices.
----------------------------
revision 1.15
date: 2015/02/08 08:29:50; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.14
date: 2015/02/08 08:29:11; author: root; state: Exp; lines: +1 -0
Defined quantum_size, qset_size.
----------------------------
revision 1.13
date: 2015/02/08 08:27:25; author: root; state: Exp; lines: +5 -1
INitialized quantum_size and Qset_size
----------------------------
revision 1.12
date: 2015/02/01 07:01:40; author: root; state: Exp; lines: +2 -2
Cross check for adding device attributes to device table.
by fetching device if from struct cdev.
----------------------------
revision 1.11
date: 2015/02/01 06:49:00; author: root; state: Exp; lines: +4 -0
*** empty log message ***
----------------------------
revision 1.10
date: 2015/02/01 06:47:25; author: root; state: Exp; lines: +2 -2
Declared the loop variable
----------------------------
revision 1.9
date: 2015/02/01 06:45:36; author: root; state: Exp; lines: +20 -13
Initialized for nod number of devices.
nod value is accepted as module parameter using macro module_param()
----------------------------
revision 1.8
date: 2015/01/31 05:10:34; author: root; state: Exp; lines: +13 -0
Initialized the device specific structure struct cdev using cdev_init()
mapped owner and ops fields.
add this to the device table using cdev_add().
----------------------------
revision 1.7
date: 2015/01/31 04:41:19; author: root; state: Exp; lines: +19 -4
allocated space on the device according to struct Dev using kmalloc()
----------------------------
revision 1.6
date: 2015/01/31 04:27:01; author: root; state: Exp; lines: +12 -5
Registering driver using alloc_chrdev_region()
----------------------------
revision 1.5
date: 2015/01/25 07:07:04; author: root; state: Exp; lines: +3 -3
Printing major no.
----------------------------
revision 1.4
date: 2015/01/25 07:05:28; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2015/01/25 07:04:22; author: root; state: Exp; lines: +1 -0
Declared fops.
----------------------------
revision 1.2
date: 2015/01/25 06:56:59; author: root; state: Exp; lines: +29 -1
Trying to register the driver using register_chrdev()
and obtain the najor no.
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: exit.c,v
Working file: exit.c
head: 1.8
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
This is the cleanup function.
This will unregister and deinitialize our device
It will remove the driver from the kernel.
----------------------------
revision 1.8
date: 2015/02/01 06:46:06; author: root; state: Exp; lines: +4 -1
deleting nod number of devices.
----------------------------
revision 1.7
date: 2015/01/31 05:11:22; author: root; state: Exp; lines: +2 -1
remeve the device description from the device table.
using cdev_del()
----------------------------
revision 1.6
date: 2015/01/31 04:44:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2015/01/31 04:41:43; author: root; state: Exp; lines: +1 -0
freed allocated space using kfree()
----------------------------
revision 1.4
date: 2015/01/31 04:27:14; author: root; state: Exp; lines: +1 -1
Unregistering using unregister_chrdev_region()
----------------------------
revision 1.3
date: 2015/01/25 07:03:30; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2015/01/25 06:57:22; author: root; state: Exp; lines: +2 -0
unregistering the driver using unregister_chrdev().
----------------------------
revision 1.1
date: 2015/01/25 06:08:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: dev_open.c,v
Working file: dev_open.c
head: 1.5
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
This is the driver routing for opening the device.
Just checking for the mappings right now.
----------------------------
revision 1.5
date: 2015/02/07 05:00:01; author: root; state: Exp; lines: +10 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2015/02/07 04:49:32; author: root; state: Exp; lines: +37 -1
Checking , if the device is being opened in the wroteonly mode , then trimming it.
Implementing dev_trim()
----------------------------
revision 1.3
date: 2015/02/07 04:39:51; author: root; state: Exp; lines: +1 -0
Included declerations.h
----------------------------
revision 1.2
date: 2015/02/07 04:38:48; author: root; state: Exp; lines: +26 -1
Implementing open
----------------------------
revision 1.1
date: 2015/02/01 07:57:03; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: dev_release.c,v
Working file: dev_release.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
This is the driver routing for closing the device.
----------------------------
revision 1.1
date: 2015/02/01 08:01:22; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: dev_write.c,v
Working file: dev_write.c
head: 1.14
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 14; selected revisions: 14
description:
Implementing this driver routine for the purpose of writing.
Just checking mappings for now.
----------------------------
revision 1.14
date: 2015/02/08 10:23:59; author: root; state: Exp; lines: +3 -0
*** empty log message ***
----------------------------
revision 1.13
date: 2015/02/08 10:21:57; author: root; state: Exp; lines: +7 -1
Created quantums.
Implemented writing in 1 quantum
----------------------------
revision 1.12
date: 2015/02/08 10:06:04; author: root; state: Exp; lines: +51 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2015/02/08 09:49:44; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2015/02/08 09:49:20; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.9
date: 2015/02/08 09:48:27; author: root; state: Exp; lines: +38 -1
Created Qset arrays.
----------------------------
revision 1.8
date: 2015/02/08 08:46:09; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2015/02/08 08:45:36; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2015/02/08 08:44:18; author: root; state: Exp; lines: +16 -10
*** empty log message ***
----------------------------
revision 1.5
date: 2015/02/08 08:33:08; author: root; state: Exp; lines: +7 -0
*** empty log message ***
----------------------------
revision 1.4
date: 2015/02/08 08:31:09; author: root; state: Exp; lines: +6 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2015/02/08 08:27:42; author: root; state: Exp; lines: +53 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2015/02/08 07:23:34; author: root; state: Exp; lines: +0 -2
*** empty log message ***
----------------------------
revision 1.1
date: 2015/02/08 07:22:50; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: writer.c,v
Working file: writer.c
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
This is an application for testing our driver.
This application will open the device for writing..
----------------------------
revision 1.4
date: 2015/02/08 07:24:48; author: root; state: Exp; lines: +1 -1
Declared count.
----------------------------
revision 1.3
date: 2015/02/08 07:22:36; author: root; state: Exp; lines: +7 -2
Application is now writing into the device.
----------------------------
revision 1.2
date: 2015/02/01 07:27:01; author: root; state: Exp; lines: +1 -0
Included fcntl.h
----------------------------
revision 1.1
date: 2015/02/01 07:26:00; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Base header for the driver.
Included init.h and module.h
Described module license.
----------------------------
revision 1.2 locked by: root;
date: 2015/06/06 11:44:14; author: root; state: Exp; lines: +1 -0
included fs.h
----------------------------
revision 1.1
date: 2015/06/06 11:05:10; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
This header file contains all the declerations
----------------------------
revision 1.2 locked by: root;
date: 2015/06/06 11:57:45; author: root; state: Exp; lines: +1 -1
devlared dev
----------------------------
revision 1.1
date: 2015/06/06 11:44:29; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: init.c,v
Working file: init.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
Just Inserted module
----------------------------
revision 1.3 locked by: root;
date: 2015/06/06 11:57:53; author: root; state: Exp; lines: +6 -6
registering the driver using alloc_chrdev_region()
----------------------------
revision 1.2
date: 2015/06/06 11:44:29; author: root; state: Exp; lines: +12 -0
registered the driver using register_chrdev()
\.
----------------------------
revision 1.1
date: 2015/06/06 11:05:10; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
Just identifying the cleanup function
----------------------------
revision 1.3 locked by: root;
date: 2015/06/06 11:58:08; author: root; state: Exp; lines: +1 -1
unregister using unregister_chrdev_region()
----------------------------
revision 1.2
date: 2015/06/06 11:44:43; author: root; state: Exp; lines: +2 -0
unregister_chrdev()
----------------------------
revision 1.1
date: 2015/06/06 11:05:10; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: header.h,v
Working file: header.h
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
This is the base header file.
Included init.h, module.h and
declared Licence.
----------------------------
revision 1.5 locked by: root;
date: 2015/09/12 05:32:28; author: root; state: Exp; lines: +1 -0
Included slab.h
----------------------------
revision 1.4
date: 2015/09/12 05:04:30; author: root; state: Exp; lines: +12 -0
Declared macros
MINORNO
NOD
----------------------------
revision 1.3
date: 2015/09/12 04:44:43; author: root; state: Exp; lines: +1 -0
Included fs.h
----------------------------
revision 1.2
date: 2015/09/12 04:43:07; author: root; state: Exp; lines: +9 -0
Declared macros DEVNAME and MAJORNO
----------------------------
revision 1.1
date: 2015/09/05 05:32:58; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: operations.h,v
Working file: operations.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
Declared file operations
----------------------------
revision 1.1 locked by: root;
date: 2015/09/12 04:43:21; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
This header file would contain all declerations and prototypes
----------------------------
revision 1.3 locked by: root;
date: 2015/09/12 05:32:01; author: root; state: Exp; lines: +11 -0
Defined and declared the device structure Dev
----------------------------
revision 1.2
date: 2015/09/12 05:04:16; author: root; state: Exp; lines: +2 -1
Declared minorno and nod.
----------------------------
revision 1.1
date: 2015/09/12 04:42:40; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: init.c,v
Working file: init.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
Initialization Function.
Checking for mapping.
Saying Hello to kernel.
----------------------------
revision 1.10 locked by: root;
date: 2015/09/12 05:32:56; author: root; state: Exp; lines: +12 -1
allocating memory for device using kmalloc()
----------------------------
revision 1.9
date: 2015/09/12 05:17:50; author: root; state: Exp; lines: +2 -0
Accepting module parameters using module_param()
----------------------------
revision 1.8
date: 2015/09/12 05:11:12; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.7
date: 2015/09/12 05:10:46; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2015/09/12 05:09:58; author: root; state: Exp; lines: +3 -0
Printing major and minor numbers.
----------------------------
revision 1.5
date: 2015/09/12 05:04:58; author: root; state: Exp; lines: +13 -3
Registering the driver using alloc_chrdev_region()
----------------------------
revision 1.4
date: 2015/09/12 04:45:42; author: root; state: Exp; lines: +1 -0
Included declerations.h
----------------------------
revision 1.3
date: 2015/09/12 04:43:45; author: root; state: Exp; lines: +11 -1
Registering the driver using register_chrdev()
----------------------------
revision 1.2
date: 2015/09/05 05:35:19; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2015/09/05 05:32:58; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: clean.c,v
Working file: clean.c
head: 1.7
branch:
locks: strict
root: 1.7
access list:
symbolic names:
keyword substitution: kv
total revisions: 7; selected revisions: 7
description:
This is the cleanup function.
Checking for mapping.
----------------------------
revision 1.7 locked by: root;
date: 2015/09/12 05:32:35; author: root; state: Exp; lines: +1 -0
freeing the space using kfree()
----------------------------
revision 1.6
date: 2015/09/12 05:06:13; author: root; state: Exp; lines: +1 -0
*** empty log message ***
----------------------------
revision 1.5
date: 2015/09/12 05:05:50; author: root; state: Exp; lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2015/09/12 05:04:40; author: root; state: Exp; lines: +3 -2
unregistering the driver using unregister_chrdev_region()
----------------------------
revision 1.3
date: 2015/09/12 04:46:35; author: root; state: Exp; lines: +1 -0
Included declerations.h
----------------------------
revision 1.2
date: 2015/09/12 04:43:30; author: root; state: Exp; lines: +1 -0
Unregistering the driver using unregister_chrdev()
----------------------------
revision 1.1
date: 2015/09/05 05:32:58; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: declerations.h,v
Working file: declerations.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
declared constants
MINORNO, NOD and DEVNAME . these will be used as default values.
declared extern devid for identifying device driver and device
declared minorno and nod . for internal bookkeeping by the driver.
----------------------------
revision 1.1 locked by: root;
date: 2019/10/05 09:20:12; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: headers.h,v
Working file: headers.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
included linux/init.h and linux/modules.h for printk()
----------------------------
revision 1.2 locked by: root;
date: 2019/10/05 09:25:33; author: root; state: Exp; lines: +2 -1
Included fs.h for alloc......
----------------------------
revision 1.1
date: 2019/10/05 07:06:04; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
static void __exit cleanup(void)
return type is static void as there is no one to capture drivers exit code after the driver would be pulled out
__exit
1: Identifies this as cleaup function
2: it could not be invoked from within the driver
3: it runs once in the lifetime of device
4: releases all resources used immediately
....
module_exit(cleanup);
module_exit() is a macro that will run upon driver exit.
it will be invoked when rmmod command will be given
ITs argument id a function called cleanup #:wq
----------------------------
revision 1.1 locked by: root;
date: 2019/10/05 09:21:54; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: initFunc.c,v
Working file: initFunc.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
static: scope is local
returns int
// __init:
// 1 - this is the initialization function
// 2 - it could not be invoked from within the kernel
// 3 - it will run only once in the lifeting of the device
// 4 - it will release all resources including memory when it will finish
----------------------------
revision 1.6 locked by: root;
date: 2019/10/05 09:21:54; author: root; state: Exp; lines: +13 -7
Registered driver using alloc_chrdev_region()
declared devid and nod as globals.
assigned these vars from conctants. This needs to be done as these values will keep changing but we need to mantain the default values also for reset operastions.
Must check the return value from alloc..... and report error if needed.
----------------------------
revision 1.5
date: 2019/10/05 09:00:23; author: root; state: Exp; lines: +9 -1
Trying to register device usinf alloc_chrdev_region()
----------------------------
revision 1.4
date: 2019/10/05 08:52:56; author: root; state: Exp; lines: +5 -4
We need to do device driver registration into the kernel devic table
----------------------------
revision 1.3
date: 2019/10/05 06:45:08; author: root; state: Exp; lines: +3 -5
module_init(initFunc);//is a macro, it is entry point for the driver.
//The argument to module_init() is the initialization function
//When the driver is inserted into kernel, This is always the first function to run
----------------------------
revision 1.2
date: 2019/10/05 06:40:41; author: root; state: Exp; lines: +4 -8
// Symbol Table:
// exported symbols which work as globals in the kernel
// one of the symbol placed ion the symbol table is printk()
----------------------------
revision 1.1
date: 2019/10/05 06:37:43; author: root; state: Exp;
Initial revision
=============================================================================
#! /bin/bash
for file in $(ls *.h) $(ls *.c)
do
ci $file
done
for file in $(ls *.h,v) $(ls *.c,v)
do
co $file
done
removecdd()
{
read -n1 -p "Do you want to remove driver(y/n)?" resp
if [ $resp = 'y' ]
then
rmmod mycdd
lsmod
read
dmesg
read
fi
}
insertcdd()
{
read -n1 -p "Do you want to insert driver(y/n)?" resp
if [ $resp = 'y' ]
then
insmod ./modules/mycdd.ko
lsmod
read
dmesg
read
fi
}
echo
read -n1 -p "Do you want to build driver(y/n)?" resp
if [ $resp = 'y' ]
then
if ( make )
then
insertcdd
removecdd
else
echo "make Failed."
read
fi
else
echo "Fine Chill"
fi
read -n1 -p "Do you want to edit driver further(y/n)?" resp
if [ $resp = 'y' ]
then
for file in $(ls *.h,v) $(ls *.c,v)
do
co -l $file
done
fi
insertcdd()
{
read -n1 -p "Do you want to insert driver(y/n)?" resp
if [ $resp = 'y' ]
then
insmod ./modules/mycdd.ko
lsmod
read
dmesg
read
cat /proc/devices
fi
}
RCS file: ./initFunc.c,v
Working file: ./initFunc.c
head: 1.8
branch:
locks: strict
root: 1.8
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
static: scope is local
returns int
// __init:
// 1 - this is the initialization function
// 2 - it could not be invoked from within the kernel
// 3 - it will run only once in the lifeting of the device
// 4 - it will release all resources including memory when it will finish
----------------------------
revision 1.8 locked by: root;
date: 2019/10/05 11:03:12; author: root; state: Exp; lines: +7 -7
declared global pointer for Dev
allocated space for Dev using kmalloc()
Checked for arrors
----------------------------
revision 1.7
date: 2019/10/05 10:44:15; author: root; state: Exp; lines: +9 -0
//Allocate some space for our simulated device in kernel space
// static __always_inline void *kmalloc(
// size_t size,: no of bytes to allocate
// gfp_t flags): this is an enforcing flag.
// ensures that the memory be allocated in kernel space
// and in page alogned
----------------------------
revision 1.6
date: 2019/10/05 09:21:54; author: root; state: Exp; lines: +13 -7
Registered driver using alloc_chrdev_region()
declared devid and nod as globals.
assigned these vars from conctants. This needs to be done as these values will keep changing but we need to mantain the default values also for reset operastions.
Must check the return value from alloc..... and report error if needed.
----------------------------
revision 1.5
date: 2019/10/05 09:00:23; author: root; state: Exp; lines: +9 -1
Trying to register device usinf alloc_chrdev_region()
----------------------------
revision 1.4
date: 2019/10/05 08:52:56; author: root; state: Exp; lines: +5 -4
We need to do device driver registration into the kernel devic table
----------------------------
revision 1.3
date: 2019/10/05 06:45:08; author: root; state: Exp; lines: +3 -5
module_init(initFunc);//is a macro, it is entry point for the driver.
//The argument to module_init() is the initialization function
//When the driver is inserted into kernel, This is always the first function to run
----------------------------
revision 1.2
date: 2019/10/05 06:40:41; author: root; state: Exp; lines: +4 -8
// Symbol Table:
// exported symbols which work as globals in the kernel
// one of the symbol placed ion the symbol table is printk()
----------------------------
revision 1.1
date: 2019/10/05 06:37:43; author: root; state: Exp;
Initial revision
=============================================================================
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+#define container_of(ptr, type, member) ({ \
+ void *__mptr = (void *)(ptr); \
+ BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
+ !__same_type(*(ptr), void), \
+ "pointer type mismatch in container_of()"); \
+ ((type *)(__mptr - offsetof(type, member))); })
It looks like you're new here. If you want to get involved, click one of these buttons!