EmbLogic's Blog

Character Driver

CHARACTER DRIVER:- I have been working on device driver(character driver) since almost last three weeks. FIrst of all in device driver,I need to know what is device driver and why we need device driver?Device driver is nothing what a piece of code(called module) as a part of kernel.The device driver can be classified into three basic categories.
1) Character driver 2) Block driver 3 ) Network or Pipe driver.
1)Character driver:- A character device is one that can be accessed as a stream of bytes i.e. character by character.
As we know that it is kernel which is directly interect with the hardware and if any application want to interect with the hardware then we need a driver in the kernel space. As we know that our applications are in the user space and hardware is place in the kernel space and no application can directly access the hardware in the kernel space.so we create a named pipe(called fifo) between user space and kernel space using mknod.
Device Driver Implementation:-
In device driver implementation, firstly I used two modules called module_init(initilization_func ) and module_exit(cleanup_func). The module_init is used to load the module into the kenel and module_exit is used to unload the module from the kernel.For module_init and module_exit we need two header files, which are and .After loading and unloading our module next step is to register our driver. The registration of driver is done in two ways i.e. dyanamic registration and static registration.The dyanamic registration is done by using alloc_chrdev_region.The alloc_chrdev_region(&dev,minorno,nod,dev_name) take four arguments,first argument is the pointer to dev ,second argument is the minor number ,third argument is the number of devices for which we have register our driver and fourth argument is our device name.we used dynamic registration so that the kernel provieded maximum available major no to our device.The static registration is done by using register_chrdev_region(dev,nod,dev_name);.it will return maximum available major no to our device. After the registration of our device we have to unregister our device using unregister_chrdev_region(dev,nod).for registe and unregister we used header file . After registeration and unregistration we need to prepare Scull memory for our device.For preparing scull memory we define struct Sculldev. Struct Sculldev contain scullqset which points to the next scullqset. The scullqset points to the qset and qset points to the quantums.After preparing the scull we have to initilize the scull by using cdev_init and cdev_add.
After preparing scull we perform file operations like open,close ,read and write.finally i have done my char driver with lseek operation.

Posted in Uncategorized | Tagged | Leave a comment

30.1.30: Jatinder Kumar

From last two weeks i am working on Character Driver.

What is device driver and need of driver?
From my knowledge device driver is nothing but piece of code that runs the device . Every device need that code to run ,without driver device is dead, to make device alive we have to provide that code.
This code is nothing but the driver.
When the driver sit in the hardware permanently that that driver is called firmware , when this driver set the rule how the system boot up then this driver know as BIOS.
So i can conclude that every device need a piece of software to run the device. Driver not also run the device but it also decide that what will do i the device is on ,running and shutdown. From booting of the device to shutdown device need the support of the driver.

Types of device driver:
1. Character driver
2. block driver
3. Network driver/pipe driver

In this article i will talk about character driver. Character-driven drivers are device drivers that operate on characters (bytes) as the basic unit of input and
output. They are accessed in a sequential, nonrandom manner.
We can access the device as the file and operation of file like read, write ,open close and lseek.

Linux kernel have feature that we can add functionality when the system is being running and similarly we can remove some functionality. We can add or remove functionality by mean of piece of code and that piece of code is nothing but the module. When the module is inserted then it works as the part of the Linux kernel.

In short we can add or remove the module. For adding the module i used insmod command and for removing it i used rmmod command.
By doing insmode we can see our module is inserted in the kernel to cross check i used lsmod command and i saw that my module was i the list. As soon as i do rmmod i saw that my module was not there.

Now question comes what is moudle?
As i already told that module in nothing but the piece of code. Every module as at-least two function initialization function and cleanup function.
When the module is inserted by insmode the initialization function does it work and this function is initialized by a macro module_init().
And when we do rmmode the cleanup function does its job and this function is invoked by the module_exit() function .
And one thing we should keep in mind that what we have did in the initialization function we have do remove that in revere order int the cleanup function.
After inserted the module in the kernel i register the my module first by older way register_chrdev(), this function takes three argument major no, driver_name, and a pointer to struct file operations . By giving major number as 0 we do let the kernel to choose the lowest available major number and for unregistering the module i used unregister_chrdev(). It takes two argumnet major number and same device_name.
This method is now obsolete. Now a days developer used new method for registration and unregistration. But if we dig out the code of the old driver we still found that this method is being used.

The newer function to registering the device is alloc_chrdev_region and register_chrdev_region.
The alloc_chardev_region register the module by taking three argument first one is a pointer of dev_t and first minor no which is always 0 third argument is integer number and fourth is the deive name. By using this function we let the kernel to choice available major number.
Same thing is done by register_chrdev_region function but in this we have to provide the major number. It is always advisable that not to choose the major number statically because that major may also be used by the some other driver so a good developer pick the major number dynamically by using alloc_chrdev_region() for very first time . I also used alloc_chredv_region() for the first time and when i get the major number i used that major number in the second function and the number of node (ie how many i want to register the device for that particular driver/module ). The second one also prevent the registration of the same module in the kernel .

Then i declared a user defined structure struct ScullDev{}; this structure has initially it has two member first is pointer to struct scullqset and a varible of type struct cdec.

And the struct ScullQset has the the various member like a void pointer , a pointer itself and lot more like device size,qset size ,quantum size. The void pointer has the that address where our data actually reside.

Next i used cdev_init() and cdev_add() functionn. By using cdev_intit function i initialized the chracter device and by using cdev_add() i inform the kernel.
Before going on this step i understand the some structure like file structure , inode structure, file_operations structure and relation between them.

Then i made a simple application for testing the driver. In which i simply used open ,write,read and close command.

In my driver i mapped the open command to my own open routine same i did for read,write ,close and lseek . And made nod by using mknod of type c and provide this mode major and minor number which i got for the alloc_chrdev_region. By doing this when i run my application using this node and when my application try to open the device it open the device according to my routine.

I made my open routine , close routine and read and write . In this routine i used my own algorithm to read and write and trim .
In write function and also used kmallc function to allocate the memory from kernel space which is physical memory and cop_from_user macro.

And in read routine i track the quantum which is created and used copy_to_user macro.

In open routine i used container_of macro .

Until now i successfully implemented open ,write,read,release ,lseek
and application open the device in write only mode it first to trim. And open the driver after writing some data it will trim all the data and also implemented the driver for other version of read in which it free that quantum that is read.

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

E 30:01:30 Vikram Sharma

Article on Character Driver:

I have been working upon Device Driver (Character Driver, to be specific) since last 20 days.Before start working, First of all I needed to know what really a device driver is? As we all know it is the kernel what is directly going to interact with the Hardware and if our application need to access the hardware we need a driver(Specific one for a class of devices)for that in kernel space. As the name suggest a Device Driver is a LKM(Loadable Kernel Module) which drives(runs) our device.Drivers are of two types, Static and Dynamic. One i am going to develop will be dynamic i.e it will be removed from kernel when not needed any more. The good thing about a Moduler kernel is a Module can be inserted and removed from the running kernel(using kernel utilities insmod and rmmod respectively). There are three types of devices i.e Character devices like printers, Block devices like Mass storage devices and Network devices like USB modem etc. Now a Character driver is a driver developed to handle character devices.
Now lets explain the basic arch. of a character driver. Memory of our system is divided in to two parts User space and kernel space. Our applications runs in the user space and our driver runs in kernel space. An application cant see anything in kernel space.Driver is just like a black box for the application developer. So if the application need to access the kernel space, it need a fifo in the VFS(Virtual File System) layer. We create this for the specific device using mknod. In kernel space a driver is identified by its unique 12bit major number and a device is identified by its unique 20bit minor number. This 32bit unique number is called dev id(device id). This 32bit no is obtained for a device using a kernel MACRO i.e alloc_chrdev_region(). This registration is to be done right after inserting our module in to the kernel and it should also be unregistered before removing the module.
There are four most important structures, knowing about those was very much needed. First one is struct cdev. This structure is the representation of a character device in the kernel. This one have a lot of hardware specific information of the device. its most important members are dev(for dev id),owner(owner of the device, the module itself) and *fops (pointer to the struct file_operations). Second one in struct file_operations which is a collection of function pointers, each of the function is routine for performing a specific operation over the device like read, write ,open, close etc. Another one is struct inode(for the device file). We all know everything in linux is treated as a file, some are regular files and some are special files. A character device is treated as a special file in our system. Attributes of a file are stored in the structure struct inode and struct inode i am talking about have attributes of that special character device file. Fourth one is struct file. struct file is a structure which contains the attributes of a stream. This stream is a stream created between our app and node in vfs, when we give an open call from app.
I have allocated some memory in the kernel space of my RAM in form of SCULL(Simple Character Utility for Loading Localities), which i am treating as a device. This memory is variable as i will be performing write and read, it will be allocated and deallocated accordingly. Starting node of this memory is ScullDev which will be loaded with the lot of info about the device like device_size, data_size, quantum_size, qset_size, write_count and the most important an object of struct cdev. We need to initialize and add this cdev object as our device in the kernel using two MACROS cdev_init() and cdev_add(). cdev_init will initialize our object for the set of operations and cdev_add will add this device in to the device table.
After all this, my device is ready to be worked upon i.e open,write,read,close. For this it was required to map my driver routines to the routines called by system as when a call is given from app my routines should run in the driver. This mapping is to be done in struct file_operations by giving the addresses of my_routines to corresponding function pointers in fops. In open i fetched the address of my ScullDev for the perticular cdev and stored it in private_data field of a system generated structure struct file pointed by *filep in open for the future use of this address in write and read.
Now i am able to write data to the multiple quantums, multiple scullqset in trunc as well as append mode. I am able to read from the same as well. lseek is also done, and i am testing my driver for multithreaded apps.

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

Article on Charecter Driver

Article on Character Driver

This Article describes you the process of writing a Character Driver module. The Linux kernel version used is -3.3.4-5. Character Driver operates on Bytes that is transferring data byte by byte or character by character. Serial port driver, key bord driver and mouse driver are some real time examples for character Driver. Character Driver is one of the mechanism of running the driver policy. Each Driver has similar policie with different mechanism. One among them is our discussion that is character driver which provides communication between application and hardware upon Inserting the module on demand and removing the module after the task completion. The module can be inserted using the command insmod and removed using rmmod.

The driver starts with device registration done using alloc_chrdev_region ( ), by which the device is registered at kernel and for every device registration a major and minor number is allocated for the device and is stored in a variable of type dev_t dev . Major number specifies the Driver and minor number specifies the devices connected (type of mechanism followed by that driver) and are independent of devices. Dev variable is of 32 bit of which first 12 bits represents major number and the next 20 bits represents the minor number. After allocation of major and minor numbers they can be extracted using predefined macros called MAJOR(dev) and MINOR(dev). Defining the way of opening the Device, writing, reading procedures and closing the device plays an important part in Implementing the mechanism of char driver.

SCULL(simple character utility for loading localities) defines the procedural mechanism of char driver and is apart from opening a normal low level file .The real flavor of character driver is defined in its SCULL, which describes the memory allocation strategies, way of performing the operations and procedure for loading localities. The SCULL contains blocks of memory called scull_qsets and each scull_qset contain qsets which handles array of pointers pointing to specific bytes of data called quantum. The scull_qset can handle upto maximum of data equal to product of qset_size and quantum size. Further each quantum can handle upto maximum of bytes equal to quantum_size defined by driver developer. Mathematically we can find the required number of scull_qsets and quantums required for accommodating given number of bytes and memory is allocated for scull_qset and quantum accordingly.
Number of Scull_qset =data_size/ (qset_size * quantum_size)
Number of quantum= data_size/quantum_size;
In order to reach data quantum we have to point from sculldev->scullqset->data[i].
Writing and reading data can be done only on quantum. cdev(charecter device) is an important member of sculldev which points to a structure containing file_operations specific to driver routines. The operations are mapped and specific sub routines are defined which defines the specified operations ( open,read,write and close). Ones the scull is prepared required size of memory is allocated using kmalloc. The scull structure is initialized through cdev cdev_init and is added to the kernel using cdev_add.

Now the main part is to define the file operation subroutines. Before performing writing and reading operations, the device has to be opened and from open mapping of SCULL on to device memory is done using predefined kernel facility container_of which contain starting address of scull as its return value. This value is preserved in private_data which is a member of struct file. The private data can be fetched before performing write and read operations. The write operation specifies writing data from application to kernel buffer which can be handled using kernel facility copy_from_user and reading specifies reading data from kernel buffer to user buffer at application which can be done using copy_to user.
Everything in linux is a file, whenever you connect a device it is treated as a file and an inode is created for that file. The communication between application and kernel is carried out using FIFO(named pipe) created using command mknod. So through FIFO, utilizing the mechanism of SCULL the communication between application and the kernel will be carried out.

Note:The article tries to describe the procedure for implementing the character driver and the syntax is not concentrated as of now. The further Implementations will be added on in the next article. Comments and doubts are welcome.

Thank you
Sampath Kumar Kotigari.

Posted in Uncategorized | Leave a comment

E 30.01.30 – Om Parkash

ARTICLE:

I am working on Character Driver on Linux from last few days.Device Driver is simply a piece of code as a part of kernel,dynamic (temporary) or static (permanent) required to make the hardware accessible to the application. Device Drivers can be classified into three basic types: Character driver, Block driver and Network driver. A character device is one that can be accessed as a stream of bytes i.e. character by character. And code needed make communication possible b/w a character device and application is character driver.
As there is a very good feature of Linux i.e. the ability to extend the set of features offered by the kernel at runtime. This means that we can add functionality to the kernel (and remove functionality as well) while the system is up and running. Each piece of code that can be added to the kernel at runtime is called a module. Different types (or classes) of modules,that can be inserted to the Linux kernel includes device drivers but not limited to this. Each module is made up of object code that can be dynamically linked to the running kernel by the insmod program and can be unlinked by the rmmod program. Whenever we do insmod, the macro ‘module_init’ invokes our initialization routine and module is inserted to the kernel if it is valid. And when rmmod is done our module gets removed from the kernel through the macro ‘module_exit’. Our initialization routine registers the driver for the devices and obtains major no. from the registration call( int register_chrdev_region(dev_t first, unsigned int count, char *name); or int alloc_chrdev_region(dev_t *dev, unsigned int firstminor, unsigned int count, char *name);) and sets up some basic parameters we’ll be using ahead e.g struct ScullDev’s elements. Also we have to initialize the resources that are going to be used.In module_exit the opposite of initialization procedure is performed in reverse order.All the resources allocated to the driver to be freed and this is done by exit routine.After our module gets inserted successfully to the kernel,it can be seen in ‘/proc/modules’ file.And if we are able to register our driver successfully, we can see the driver’s name in ‘/proc/devices’ file.
To implement our character driver we have used SCULL (Simple Character Utility for Loading Localities). Scull acts on a memory as though it were a device.The advantage of scull is that it isn’t hardware dependent. Scull just acts on some memory, allocated from the kernel. Anyone can compile and run scull.We have mapped the system calls to the routines written in our own driver i.e. we have defined the behaviour of the system calls for a particular device. We have used cdev_init and cdev_add functions to initialize the struct cdev and inform the kernel about the device. In our open routine,we are checking the mode,the device is trying to being opened. And depending on that mode flags we are performing some specific tasks e.g. if device is opened in write only mode then the device memory will get trimmed before going ahead.In trimming routine we just free all the memory allocated to the scull. Also in open routine we are mapping the scull to the device by using the macro ‘container_of’.In brief it simply maps the scull into the device and returns a pointer to the memory of device having scull mapped onto it.And we have stored this pointer into the void pointer ‘filep->private_data’ to preserve the starting address of device memory for further use. In our write routine we are writing the data from application to the device through the scull quantums by using ‘copy_from_user’.Write routine also checks for the offset value i.e. cursor position where application wants to write.In read routine we are copying data from the device through scull quantums using ‘copy_to_user’ function.Read routine also checks for the offset value from where application wants to read. We have also implemented lseek routine that sets the offset value as provided by the application in lseek system call.And finally in release routine we have just released the resources used after opening the device.

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

Avtar Singh E-30.01.30

INTRODUCTION:
Device driver is basically a module(piece of code) used to make possible the communication between hardware and application like VLC media player,firefox,USB devices etc.So device driver is used to drive the hardware according to the application.Different type of applications require different type of drivers like USB driver can’t work for VLC media player and vice-versa.
I think the need of using device drivers is to increase the functionality of kernel.We use the driver as LKM(Loadable Kernel Module) to make our kernel less bulky in size & also it is not essential to keep driver present in the kernel until system is power on.
I am working on Character Driver from last few days.In this article I am going to discuss what i know about character driver briefly.
Character driver sends the data byte by byte to the kernel buffer and user buffer when application give call of write and read respectively.
Now as I have to make my driver capable of directly handshake with the kernel so it was essential to work in kernel space instead of user space,so i have to use the kernel libraries(like kernel.h,init.h,fs.h etc..) instead of glibc libraries(like stdio.h,stdlib.h,fcntl.h etc…).

DEVICE DRIVER IMPLEMENTATION ROUTE MAP:
I firstly used two predefined macros named as module_init(entry_function) and module_exit(exit_function) as entrance point as main() in user space and exit point respectively.In this entry_function and exit_function is written by me.So after executing module_exit execution will start from my function where I have to specify the major number and name of our driver,capacity to handle maximum number of device at a time and maximun memory of the driver. I am firstly allocating major number to my driver which is basically a highest possible integer value between 0 to 255 by which our driver will be known in the kernel like other device drivers as stored in /proc/devices file.We can select major number for our driver from prevoiusly mentioned path but generally we privilege kernel to select major number because kernel will allocate it dynamically.This can be done with the register_chrdev_region() function call defined in fs.h kernel library.This will give the result of 32 bit(12 + 20 bit) at the address as give in first argument of call.Now later on i have used that the first 12 bit i.e major number but i specify my own minor number generally 0 to upward in MKDEV() macro defined in kdev_t.h.Now used the cdev_init() and cdev_add() to initialize and add the cdev structure for our device which will contains the device specifications.Now i initialize the sculldev structure(user defined structure that contain all information of the driver) to add the maximum memory of device and the partition of that memory like size of one quantum etc.
Now I have open,write,read,lseek and close file till now.So i have mapped these system calls in struct file_operations structure with my respective open,write,read,lseek and close functions according to prototype defined in <fs.h> kernel header file that will now handles the application calls instead of drivers of the OS.
But Before doing anything we have to map our allocated memory with the device memory this is done in the open function of driver with
container_of(ptr,type,member) in which first argument is pointer to i_cdev member of struct inode,2nd argument is user defined structure which contains pointer to struct cdev and third argument is pointer to struct cdev.Actually struct cdev is actual representation of the device.Now return of container_of will be starting address of mapped memory that we will use to read and write on device and i store this address in the private_data of the struct file structure defined in fs.h library.
After doing this now i have made my read,write and lseek function compatible with the almost all type of requests from application.In this write function will store the written data in own quantum  when write request comes and give back that data according to the read request of application.I have also handled the single multi threaded application.

Now to test this driver firstly compile and insert our module in running kernel dynamically.This is done with command insmod <lkm.ko> on shell here lkm is my name of c file of driver.Compilation of the file should be by Makefile. And to make communication possible between application application and device driver,we require node in Virtual File System(VFS). Node is created by the commend “mknod node_name c major no. minor no.”,here c is to specify that is making for character driver.
After testing we should have to remove the module from kernel with command “rmmod” like rmmod lkm to free the allocated major number.
That was all i have done with character driver.

THANK YOU!!!

Posted in Character Driver | Tagged | Leave a comment

30.01.30 : Taruna

Character-driven drivers are device drivers that operate on characters (bytes) as the basic unit of input and output. They are accessed in a sequential, non-random manner.

 

I started writing my first character driver by writing the simplest module – hello world module.

 

Character devices have to register themselves with the kernel and provide it with the information that enables the kernel to invoke the correct functions when applications wish to interact with the device. I registered my driver using alloc_chrdev_region() and register_chrdev_region(). When we register our driver for the first time , we use the former method and to prevent its re-registeration when a new device is connected , we use the latter… The older method of registering a driver i the kernel is : register_chrdev().

The syntax of these are as follows:

int alloc_chrdev_region(dev_t * , unsigned , unsigned , const char *);

 

int register_chrdev_region(dev_t , unsigned , const char *);

 

We also need to include the required libraries in our header file.These are <linux/init.h> , <linux/module.h> , <linux/fs.h> , and others will be mentioned as per requirement. In our module we require two functions : module_init and module_exit.

module_init is used for calling the initialization function while module_exit is needed for the cleanup function. I also used a special macro MODULE_LICENSE() to tell the kernel that my module bears a free license.

 

To unregister the driver we use unregister_chrdev_region() in our cleanup function. The syntax of unregister_chrdev_region is:

 

unregister_chrdev_region(dev_t , unsigned);

 

Loading and unloading the driver

 

To load and unload our driver we need special utilities / commands. These are insmod and rmmod.

To insert my driver into the kernel I used insmod and to unload it I used rmmod. Also we can pass parameters while doing insmode. For that we use macro: module_param and include the header file moduleparam.h.

module_param uses three parameters : name of the variable to be passed , its type and permissions. For eg: I used it as:

module_param(nod , int , S_IRUGO). Here nod stands for number of devices which is of integer type.

After inserting our driver , we can perform various tasks like open , read , write and close. Rmmod simply tells the kernel that the driver is not there and it cannot perform these tasks.

Getting memory for Scull Device

 

The very next thing we need to do is to create the scull.

This is done using kmalloc in the following manner:

kmalloc(size_t , gfp_t flags);

The flag that we used is GFP_KERNEL.

 

The header file for kmalloc is <linux/slab.h>. This is done in the initialization function.

In our cleanup function we need to undo everything we do in initialization function in the reverse order. So to free this allocated memory we use kfree().

Also its better to memset this allocated memory using memset.

 

Major and Minor numbers

 

We know that in linux everything is a file. Even the device is a file. The character devices are accessed through names in file system. We call them nodes.

The major number identifies the driver for the device while the minor number is used by the kernel to determine exactly which device is being referred to.

The device is internally referred by device numbers.dev_t is used to hold these device numbers. To get the major and minor numbers we use special macros:

MAJOR(dev_t);

MINOR(dev_t);

 

To convert the major and minor numbers into device numbers , we use MKNOD.

MKNOD(majorno , minorno);

So the device number is a 32 bit combination of major and minor numbers.

12 bits are for major number and 20 bits for minor number.

 

The alloc_chrdev_region() and register_chrdev_region() are used by the kernel to allocate device numbers for our driver.

 

 

Initializing the cdev structure

 

The cdev structure is used to represent our char device internally.

I used cdev_init () to initialize the struct cdev. In this function , I initialized all the members of this structure:

set cdev.owner to THIS_MODULE

set cdev.dev to dev

set fileoperations to fops.

After these initializations we need to tell the kernel about the cdev structure . To do so , I used cdev_add(). In my cleanup function I used cdev_del() .

The syntax of these functios are as follows:

 

void cdev_init(struct cdev *, const struct file_operations *);

 

int cdev_add(struct cdev *, dev_t, unsigned);

 

void cdev_del(struct cdev *);

 

Initializing the struct ScullDev

 

The struct ScullDev is a user defined structure to represent the device.

We need to initialize the members of struct ScullDev also.

The members are : qset size , quantum size , device size and data size.

I used my own function init_scull() to make these initializations.

 

After doing upto this , our device is ready to be opened and we can perform read write operations on it. These operations are performed through an application that uses system calls: open , write , read and close.

We then map these system calls to our own routines and use struct file_operations to do the mapping.

 

I made an application and made it to interact with my driver to perform the read write and open close operations through a script.

Apart from this we need to trim our device when we open it in write only mode. For this i made a scull_trim() function.

I am able to perform writing and reading and also lseek.

 

 

Posted in Character Driver | Tagged | Leave a comment

Pointers.

#include<stdio.h>
#include<stdlib.h>

int main()
{
void *ptr;

char i;

ptr = malloc(sizeof(int ) * 5);

for(i = 0; i<(sizeof(int) * 5); i++)
{
*(int *)(ptr + i) = i;
printf(” ptr + %d = %p\t %d\n”, i, (ptr + i – 1), *(int *)(ptr + i – 1));
}
return 0;
}

Posted in Data Structures with C | Tagged , | Leave a comment

Avtar Singh E 30.01.30

RCS file: new_lkm.c,v
Working file: new_lkm.c
head: 1.19
branch:
locks: strict
root: 1.19
access list:
symbolic names:
keyword substitution: kv
total revisions: 20;    selected revisions: 20
description:
in this i register many no. of devices that we can provide at the time of insmod as command line argument.
use setup_struct_cdev() function i.e user defined to setup of the struct cdev,in this we use cdev_init() & cdev_add().
in cleanup we use cdev_del to delete the cdev setup for all devices.
also used kmalloc() & kfree() to allocate & deallocate the memory to scull_dev (pointer of struct Sculldev).
—————————-
revision 1.19    locked by: root;
date: 2013/07/19 11:07:56;  author: root;  state: Exp;  lines: +115 -8
implemented scull_trim function properly.
when we open same file in the write mode again then it trim all the data.
means in this i deallocated the memory of quantums,qsets & scullqsets.
it is working successfully.
—————————-
revision 1.18
date: 2013/07/17 13:59:24;  author: root;  state: Exp;  lines: +0 -3
three waste lines deleted .
checked also to add many scullqsets with the previously allocated memory,that was less to write the new request by application.
working successfully.
—————————-
revision 1.17
date: 2013/07/17 13:05:14;  author: root;  state: Exp;  lines: +54 -7
successfully adding some memory when application gives more no. of characters than previously write call after g some positions.
can add some quantums in the previously allocated memory.
till now wprking successfully.
—————————-
revision 1.16
date: 2013/07/16 13:54:00;  author: root;  state: Exp;  lines: +2 -2
working for lseek of more than one quantums also .
till now driver can lseek before write after write .
results are comming correct.
—————————-
revision 1.15
date: 2013/07/16 13:03:18;  author: root;  state: Exp;  lines: +29 -25
working for write ,then again write some data after 5 positions.
reading the whole data after two write operations .
checked only for less than 8 bytes to append.
working successfully till now.
—————————-
revision 1.14
date: 2013/07/16 11:21:28;  author: root;  state: Exp;  lines: +72 -14
performing lseek by any no. of positions successfully.
written only for SEEK_SET.
performed lseek before write & at the time of read operations.
till now it is working properly.
—————————-
revision 1.13
date: 2013/07/16 05:17:19;  author: root;  state: Exp;  lines: +52 -25
implemented lseek when we read after writing to the quantums.
only SEEK_SET implemented in the scull_lseek.
it can seek within the quantum , inter quantum & inter scullqset.
till now it is working correctly.
—————————-
revision 1.12
date: 2013/07/15 07:39:03;  author: root;  state: Exp;  lines: +23 -4
coming in different case in scull_lseek according to the request of application.
defined variable new_position to return the value to application & to store the new position after lseek operation in scull_lseek.
—————————-
revision 1.11
date: 2013/07/15 06:28:03;  author: root;  state: Exp;  lines: +34 -15
add scull_lseek() to seek the cursor position according to the lseek call in the app.c.
printing offset position & offset type correctly.
working successfully till now.
—————————-
revision 1.10
date: 2013/07/11 15:05:36;  author: root;  state: Exp;  lines: +36 -8
gave response to read call of application.
scull_read() function is taking request of read call.
use copy_to_user() function to copy no. of bytes requested by application from kernel space i.e quantums to the user buffer.
rbuff is our user buffer in our case.
successfully jumping from one scullqset to another when one scullqset fills.
overall successfully writing to user buffer is performing.
—————————-
revision 1.9
date: 2013/07/11 12:09:24;  author: root;  state: Exp;  lines: +40 -2
to read call driver is comming in scull
scull_read().
here copy_to_user() is working properly only to write first quantum from kernel space to user buffer i.e rbuff in my case.
it is successfully writing upto this.
—————————-
revision 1.8
date: 2013/07/11 10:48:47;  author: root;  state: Exp;  lines: +47 -8
in scull_write(),use copy_from_user() to copy data from user buffer i.e wbuff in our case to the quantums that was allocated.
also after copying data from ubuff to kernel buffer i.e quantums i link the fscullqset with the scullqset of the sculldev that was stored in the filep->private_data .
till now it is successfully working.
it can also move from one scullqset to next when all the quantums of the present scullqset fills.
—————————-
revision 1.7
date: 2013/07/10 10:20:09;  author: root;  state: Exp;  lines: +11 -8
in create_scullqset(),make fscullqset->next = NULL.
sometimes without doing this result in kernel crash in create_quantum().
—————————-
revision 1.6
date: 2013/07/10 07:40:20;  author: root;  state: Exp;  lines: +215 -3
declaire variable noq & nosqs for no. of quantum & no. of scullqset respectively.
from the given info. in header ,found the value of noq & nosqs.
now to create nosqs called function create_scullqset(), &to create no. of qsets i called function create_qset() .
at last i called create_quantum() to create requirted no. of quantums.
value in size comes from application app.c ,i.e 3rd argument of write.
till now working successfully.
—————————-
revision 1.5
date: 2013/07/08 11:15:20;  author: emblogic;  state: Exp;  lines: +97 -18
defined read & write function for reading & writing to & from the kernel buffer to user space buffer.
only control is going to read & write when called by application .
noting is performing in the read & write function.
—————————-
revision 1.4
date: 2013/07/08 11:14:01;  author: emblogic;  state: Exp;  lines: +0 -3
2 lines deleted.
—————————-
revision 1.3
date: 2013/07/08 11:12:58;  author: emblogic;  state: Exp;  lines: +2 -0
2 lines added.
—————————-
revision 1.2
date: 2013/07/02 12:25:03;  author: root;  state: Exp;  lines: +57 -7
branches:  1.2.1;
driver comming in the open_file function after receiving the open call from the application ,app.c.
initialize struct Sculldev elements like qset_size,quantum_size,device_size & data_size.
added open_file() & close_file() function to give response yo the open & close call of app.c program.
in script ,we make node to interface b/w US & KS by using mknod command.
—————————-
revision 1.1
date: 2013/07/02 08:50:13;  author: root;  state: Exp;
Initial revision
—————————-
revision 1.2.1.1
date: 2013/07/05 06:49:09;  author: emblogic;  state: Exp;  lines: +48 -17
in open_file function i use container_of() function to map the machine memory & device memory.
this function return address of that mapped memory whis i am storing in the lsculldev i.e pointer to struct Sculldev.
now this address is put in the private data of struct file .
now i check the requested permission by anding the f_flags member of struct file with O_ACCMODE .
now accordingly control goes to the scull_trim function.
=============================================================================

Posted in Character Driver | Tagged | Leave a comment

Char Driver log file

RCS file: basicregister.c,v
Working file: basicregister.c
head: 1.24
branch:
locks: strict
sampath: 1.22
sampath: 1.24
access list:
symbolic names:
keyword substitution: kv
total revisions: 24; selected revisions: 24
description:
Base program for driver
Registering the driver into the kernel using register_chrdev
inserting the module using insmod
unregistering using unregister_chrdev
removing the module using rmmod
—————————-
revision 1.24 locked by: sampath;
date: 2013/07/19 07:23:36; author: sampath; state: Exp; lines: +35 -75
Sucessfully tested driver using 3 multithreaded applications one at a time
Able to write and read data sucessfully
Trying to synchronize multiple applications running at ones
—————————-
revision 1.23
date: 2013/07/17 05:19:21; author: sampath; state: Exp; lines: +75 -28
Defined llseek function mapped from function call
Able to read data from application according to lseek offset in application
done with read operation using lseek
—————————-
revision 1.22 locked by: sampath;
date: 2013/07/13 11:04:51; author: sampath; state: Exp; lines: +15 -54
done with read and write operations for multiple scullqsets
—————————-
revision 1.21
date: 2013/07/13 10:43:24; author: sampath; state: Exp; lines: +1 -1
added ubuff+tnobsr in copy_to_user for cursor position
able to read data at the application
—————————-
revision 1.20
date: 2013/07/13 10:17:59; author: sampath; state: Exp; lines: +35 -26
sucessfully Implemented reading operation for 98 bytes of data
able to read tnobsr in application
—————————-
revision 1.19
date: 2013/07/13 07:17:49; author: sampath; state: Exp; lines: +20 -13
new
—————————-
revision 1.18
date: 2013/07/13 04:52:08; author: sampath; state: Exp; lines: +49 -36
Able to read 63 bytes of data from kernel to user buffer.
verification done by returning tnobsr to user application.
—————————-
revision 1.17
date: 2013/07/12 08:12:41; author: sampath; state: Exp; lines: +80 -11
Implemented read operation trying to read from kernel to user buffer using copy_to_user
Able to read only 8bytes of data
tryin g to implement for complete read operation for reading 100bytes
—————————-
revision 1.16
date: 2013/07/11 20:56:23; author: sampath; state: Exp; lines: +5 -10
Able to return 0 from read operation of kernel buffer to application
—————————-
revision 1.15
date: 2013/07/11 20:10:35; author: sampath; state: Exp; lines: +34 -25
Sucessfully implemented for multiple qsets
Tested writing operation for 100 bytes of data
no of scull qset are 2 and no of quantums created are 13
—————————-
revision 1.14
date: 2013/07/11 11:12:47; author: sampath; state: Exp; lines: +33 -10
sucessfully implemented write operation for multiple quantums
able to automate correct no of quantums
—————————-
revision 1.13
date: 2013/07/11 07:57:21; author: sampath; state: Exp; lines: +24 -7
Sucessfully implemented write operation
using kernel facility copy_from_user
testing for only 4bytes of data for which one quantum is enough
—————————-
revision 1.12
date: 2013/07/10 11:43:26; author: sampath; state: Exp; lines: +75 -21
Implementation of scullqset, qset and quantum done
automated number of scullqsets and quantums wrt the application
—————————-
revision 1.11
date: 2013/07/10 03:53:40; author: sampath; state: Exp; lines: +120 -34
Implemeenting write operation
fetched private->data to sculldev
Implemented auto calculation for number of scull_qset and number of quantums
allocated memory for scull_qset qset and quantum calling their functions separately and trying to link them
—————————-
revision 1.10
date: 2013/07/09 07:28:58; author: sampath; state: Exp; lines: +22 -0
Implemented basic write and read operations
—————————-
revision 1.9
date: 2013/07/08 07:27:12; author: sampath; state: Exp; lines: +39 -41
Implementation of scull_trim for future use
—————————-
revision 1.8
date: 2013/07/05 04:53:38; author: sampath; state: Exp; lines: +1 -1
Initialised cdev_del after completing the usage of cdev
—————————-
revision 1.7
date: 2013/07/05 04:51:02; author: sampath; state: Exp; lines: +9 -8
Added ret_cdev to check the return value of cdev_add
—————————-
revision 1.6
date: 2013/07/04 13:07:35; author: sampath; state: Exp; lines: +17 -7
Initialising multiple devices
assining dev using MKDEV
—————————-
revision 1.5
date: 2013/07/04 11:03:31; author: sampath; state: Exp; lines: +23 -10
memory mapping through container_of
pointing scull through inode
—————————-
revision 1.4
date: 2013/07/03 10:49:38; author: sampath; state: Exp; lines: +19 -2
Assigning values to members of sculldev in scullinit and printing
—————————-
revision 1.3
date: 2013/07/02 13:40:19; author: sampath; state: Exp; lines: +17 -2
Initialised function for scull_open
and scull close
calling open function from application
communicating from user spaceapplication to kernelspace driver
—————————-
revision 1.2
date: 2013/07/02 10:34:24; author: sampath; state: Exp; lines: +44 -4
Implemented struct scull
registering the device in device table
Initialized cdev_init
pointing to dev through cdev
—————————-
revision 1.1
date: 2013/07/01 07:16:06; author: sampath; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

DEVICE DRIVER

MULTI THREAD(open,write,read,close)

amit.c

RCS file: amit.c,v
Working file: amit.c
head: 1.13
branch:
locks: strict
amitdalal: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13; selected revisions: 13
description:
added function of copy from user
printk the no of byte writen successfully for one quantum
—————————-
revision 1.13 locked by: amitdalal;
date: 2013/07/17 00:08:24; author: amitdalal; state: Exp; lines: +0 -1
added some variable for write using llseek
added bpos for position update in copy from user
define bpos flag
—————————-
revision 1.12
date: 2013/07/17 00:07:11; author: amitdalal; state: Exp; lines: +0 -1
added variable bpos for position
use flag and j
—————————-
revision 1.11
date: 2013/07/17 00:02:29; author: amitdalal; state: Exp; lines: +0 -2
added some variable for reading using llseek
fix the problem related with left out of some first character
—————————-
revision 1.10
date: 2013/07/16 23:37:14; author: amitdalal; state: Exp; lines: +244 -194
give call to llseek
define function llseek
—————————-
revision 1.9
date: 2013/07/15 21:52:06; author: amitdalal; state: Exp; lines: +67 -41
added loff_t function to .c file
use f_pos for storing the value of pos
—————————-
revision 1.8
date: 2013/07/11 17:37:19; author: amitdalal; state: Exp; lines: +53 -38
modified code for write to get required no of qset
add lnoq variable
—————————-
revision 1.7
date: 2013/07/11 06:05:24; author: amitdalal; state: Exp; lines: +0 -1
add loop variable in loop for reading
remove some bug in reading loop
—————————-
revision 1.6
date: 2013/07/11 05:37:03; author: amitdalal; state: Exp; lines: +4 -4
remove some bug from write function
added loop variable to specify no of quantum in 2nd qset
—————————-
revision 1.5
date: 2013/07/11 05:18:10; author: amitdalal; state: Exp; lines: +76 -16
creating read function
use copy to user function
modifing the copy to user function
—————————-
revision 1.4
date: 2013/07/11 00:41:53; author: amitdalal; state: Exp; lines: +1 -0
debbuging problem causing kernel crash
—————————-
revision 1.3
date: 2013/07/11 00:19:58; author: amitdalal; state: Exp; lines: +11 -7
added variable loop
use while loop for creating multiple qset
—————————-
revision 1.2
date: 2013/07/11 00:00:36; author: amitdalal; state: Exp; lines: +25 -4
added the function of quantum written for 8 byte
debugging the problem related to writting of data not 8 byte
fix problem successfully related to written
—————————-
revision 1.1
date: 2013/07/10 21:22:34; author: amitdalal; state: Exp;
Initial revision
=============================================================================

app.c

RCS file: app.c,v
Working file: app.c
head: 1.8
branch:
locks: strict
amitdalal: 1.8
access list:
symbolic names:
keyword substitution: kv
total revisions: 8; selected revisions: 8
description:
extended the message in buff
—————————-
revision 1.8 locked by: amitdalal;
date: 2013/07/19 21:16:18; author: amitdalal; state: Exp; lines: +0 -1
added pthread join function
added pthread exit
—————————-
revision 1.7
date: 2013/07/19 21:08:19; author: amitdalal; state: Exp; lines: +94 -41
define the function for open
4 thread created
define the function for write
lssek function after write
define function for read
define function for close
—————————-
revision 1.6
date: 2013/07/18 21:37:34; author: amitdalal; state: Exp; lines: +8 -5
added variable len0,count0 for lseek after write
added lseek after write
again use the write function to append
—————————-
revision 1.5
date: 2013/07/17 00:11:50; author: amitdalal; state: Exp; lines: +0 -1
added variable
use lseek
update write
printk offset value
—————————-
revision 1.4
date: 2013/07/16 23:40:05; author: amitdalal; state: Exp; lines: +71 -68
include header file for lseek
set the offset
printf the value of offset
—————————-
revision 1.3
date: 2013/07/15 21:56:21; author: amitdalal; state: Exp; lines: +52 -15
added lseek for f_pos
printf the newpos
—————————-
revision 1.2
date: 2013/07/11 00:32:38; author: amitdalal; state: Exp; lines: +1 -1
extended the message to check whether my multiple qset is working or not for above 64 byte
—————————-
revision 1.1
date: 2013/07/11 00:04:48; author: amitdalal; state: Exp;
Initial revision
=============================================================================

script

RCS file: dd1,v
Working file: dd1
head: 1.4
branch:
locks: strict
amitdalal: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
adding compilation command for reading in script
gcc
./app1
—————————-
revision 1.4 locked by: amitdalal;
date: 2013/07/19 21:17:28; author: amitdalal; state: Exp; lines: +1 -1
added -lpthread for compilation
—————————-
revision 1.3
date: 2013/07/15 21:55:17; author: amitdalal; state: Exp; lines: +4 -3
add unlink node
—————————-
revision 1.2
date: 2013/07/11 06:00:23; author: amitdalal; state: Exp; lines: +2 -2
make another node for reading
—————————-
revision 1.1
date: 2013/07/11 05:16:48; author: amitdalal; state: Exp;
Initial revision
=============================================================================

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

Avtar Singh E-30.01.30

RCS file: new_lkm.c,v
Working file: new_lkm.c
head: 1.18
branch:
locks: strict
root: 1.18
access list:
symbolic names:
keyword substitution: kv
total revisions: 19;    selected revisions: 19
description:
in this i register many no. of devices that we can provide at the time of insmod as command line argument.
use setup_struct_cdev() function i.e user defined to setup of the struct cdev,in this we use cdev_init() & cdev_add().
in cleanup we use cdev_del to delete the cdev setup for all devices.
also used kmalloc() & kfree() to allocate & deallocate the memory to scull_dev (pointer of struct Sculldev).
—————————-
revision 1.18    locked by: root;
date: 2013/07/17 13:59:24;  author: root;  state: Exp;  lines: +0 -3
three waste lines deleted .
checked also to add many scullqsets with the previously allocated memory,that was less to write the new request by application.
working successfully.
—————————-
revision 1.17
date: 2013/07/17 13:05:14;  author: root;  state: Exp;  lines: +54 -7
successfully adding some memory when application gives more no. of characters than previously write call after g some positions.
can add some quantums in the previously allocated memory.
till now wprking successfully.
—————————-
revision 1.16
date: 2013/07/16 13:54:00;  author: root;  state: Exp;  lines: +2 -2
working for lseek of more than one quantums also .
till now driver can lseek before write after write .
results are comming correct.
—————————-
revision 1.15
date: 2013/07/16 13:03:18;  author: root;  state: Exp;  lines: +29 -25
working for write ,then again write some data after 5 positions.
reading the whole data after two write operations .
checked only for less than 8 bytes to append.
working successfully till now.
—————————-
revision 1.14
date: 2013/07/16 11:21:28;  author: root;  state: Exp;  lines: +72 -14
performing lseek by any no. of positions successfully.
written only for SEEK_SET.
performed lseek before write & at the time of read operations.
till now it is working properly.
—————————-
revision 1.13
date: 2013/07/16 05:17:19;  author: root;  state: Exp;  lines: +52 -25
implemented lseek when we read after writing to the quantums.
only SEEK_SET implemented in the scull_lseek.
it can seek within the quantum , inter quantum & inter scullqset.
till now it is working correctly.
—————————-
revision 1.12
date: 2013/07/15 07:39:03;  author: root;  state: Exp;  lines: +23 -4
coming in different case in scull_lseek according to the request of application.
defined variable new_position to return the value to application & to store the new position after lseek operation in scull_lseek.
—————————-
revision 1.11
date: 2013/07/15 06:28:03;  author: root;  state: Exp;  lines: +34 -15
add scull_lseek() to seek the cursor position according to the lseek call in the app.c.
printing offset position & offset type correctly.
working successfully till now.
—————————-
revision 1.10
date: 2013/07/11 15:05:36;  author: root;  state: Exp;  lines: +36 -8
gave response to read call of application.
scull_read() function is taking request of read call.
use copy_to_user() function to copy no. of bytes requested by application from kernel space i.e quantums to the user buffer.
rbuff is our user buffer in our case.
successfully jumping from one scullqset to another when one scullqset fills.
overall successfully writing to user buffer is performing.
—————————-
revision 1.9
date: 2013/07/11 12:09:24;  author: root;  state: Exp;  lines: +40 -2
to read call driver is comming in scull
scull_read().
here copy_to_user() is working properly only to write first quantum from kernel space to user buffer i.e rbuff in my case.
it is successfully writing upto this.
—————————-
revision 1.8
date: 2013/07/11 10:48:47;  author: root;  state: Exp;  lines: +47 -8
in scull_write(),use copy_from_user() to copy data from user buffer i.e wbuff in our case to the quantums that was allocated.
also after copying data from ubuff to kernel buffer i.e quantums i link the fscullqset with the scullqset of the sculldev that was stored in the filep->private_data .
till now it is successfully working.
it can also move from one scullqset to next when all the quantums of the present scullqset fills.
—————————-
revision 1.7
date: 2013/07/10 10:20:09;  author: root;  state: Exp;  lines: +11 -8
in create_scullqset(),make fscullqset->next = NULL.
sometimes without doing this result in kernel crash in create_quantum().
—————————-
revision 1.6
date: 2013/07/10 07:40:20;  author: root;  state: Exp;  lines: +215 -3
declaire variable noq & nosqs for no. of quantum & no. of scullqset respectively.
from the given info. in header ,found the value of noq & nosqs.
now to create nosqs called function create_scullqset(), &to create no. of qsets i called function create_qset() .
at last i called create_quantum() to create requirted no. of quantums.
value in size comes from application app.c ,i.e 3rd argument of write.
till now working successfully.
—————————-
revision 1.5
date: 2013/07/08 11:15:20;  author: emblogic;  state: Exp;  lines: +97 -18
defined read & write function for reading & writing to & from the kernel buffer to user space buffer.
only control is going to read & write when called by application .
noting is performing in the read & write function.
—————————-
revision 1.4
date: 2013/07/08 11:14:01;  author: emblogic;  state: Exp;  lines: +0 -3
2 lines deleted.
—————————-
revision 1.3
date: 2013/07/08 11:12:58;  author: emblogic;  state: Exp;  lines: +2 -0
2 lines added.
—————————-
revision 1.2
date: 2013/07/02 12:25:03;  author: root;  state: Exp;  lines: +57 -7
branches:  1.2.1;
driver comming in the open_file function after receiving the open call from the application ,app.c.
initialize struct Sculldev elements like qset_size,quantum_size,device_size & data_size.
added open_file() & close_file() function to give response yo the open & close call of app.c program.
in script ,we make node to interface b/w US & KS by using mknod command.
—————————-
revision 1.1
date: 2013/07/02 08:50:13;  author: root;  state: Exp;
Initial revision
—————————-
revision 1.2.1.1
date: 2013/07/05 06:49:09;  author: emblogic;  state: Exp;  lines: +48 -17
in open_file function i use container_of() function to map the machine memory & device memory.
this function return address of that mapped memory whis i am storing in the lsculldev i.e pointer to struct Sculldev.
now this address is put in the private data of struct file .
now i check the requested permission by anding the f_flags member of struct file with O_ACCMODE .
now accordingly control goes to the scull_trim function.
=============================================================================

Posted in Character Driver | Tagged | Leave a comment

Om Parkash E.30.01.30 (impemented scull_trim)

RCS file: chard.c,v
Working file: chard.c
head: 1.10
branch:
locks: strict
emblogic: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10;    selected revisions: 10
description:
registered and unregistered devices using alloc_chrdev_region and unregis_chrdev_region.
implemented scull_setup function.
implemented scull_open routine.
started scull_trim,scull_release,scull_write and scull_read routines.
working well till now.
—————————-
revision 1.10    locked by: emblogic;
date: 2013/07/18 11:26:50;  author: emblogic;  state: Exp;  lines: +12 -14
implemented scull_trim for O_WRONLY mode.
read,write,lseek and trim are completed.
working well.
—————————-
revision 1.9
date: 2013/07/17 13:55:42;  author: emblogic;  state: Exp;  lines: +36 -4
implementing trim.
—————————-
revision 1.8
date: 2013/07/17 08:48:06;  author: emblogic;  state: Exp;  lines: +5 -2
modfied scull_write for count+offset < wcount….
—————————-
revision 1.7
date: 2013/07/17 07:05:35;  author: emblogic;  state: Exp;  lines: +15 -12
Implemnted lseek successfully.
all issues resolved.
working well.
—————————-
revision 1.6
date: 2013/07/17 06:43:42;  author: emblogic;  state: Exp;  lines: +239 -65
Implemnted lseek ..
written successfully after seeking.
read returning more than expected value.
—————————-
revision 1.5
date: 2013/07/11 08:48:05;  author: emblogic;  state: Exp;  lines: +19 -47
implemented read and write successfully for any no. of bytes.
checked for upto 1000 bytes .successfully written to scull Quantums and read from the quantums as well.
—————————-
revision 1.4
date: 2013/07/10 11:43:39;  author: emblogic;  state: Exp;  lines: +89 -8
read successfully .
—————————-
revision 1.3
date: 2013/07/10 06:02:17;  author: emblogic;  state: Exp;  lines: +58 -4
written to scull successfully using write2scull function.
working well.
but printing garbage due to absence of NULL.
—————————-
revision 1.2
date: 2013/07/09 12:03:54;  author: emblogic;  state: Exp;  lines: +170 -5
implemented creat_scullqset,creat_qset and creat_quantums….aloocated memory to write to scull.
quantums created successfully .
working well till now.
—————————-
revision 1.1
date: 2013/07/08 11:03:54;  author: emblogic;  state: Exp;
Initial revision
=============================================================================

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

prince singla E -30.01.30

RCS file: char_driver.c,v
Working file: char_driver.c
head: 1.8
branch:
locks: strict
root: 1.6.1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 9; selected revisions: 9
description:
register using alloc.
successfullu implement sculldev
sucessfully implement cdev
—————————-
revision 1.8
date: 2013/07/19 19:05:08; author: root; state: Exp; lines: +372 -192
implement lseek for read & write().
no of quantum or qset successfully craeted.
—————————-
revision 1.7
date: 2013/07/16 13:44:47; author: emblogic; state: Exp; lines: +73 -35
problem………….
—————————-
revision 1.6
date: 2013/07/12 19:04:31; author: emblogic; state: Exp; lines: +57 -11
branches: 1.6.1;
scull_read working successfully for multiple no of scullqset.
used copy_to_user.
—————————-
revision 1.5
date: 2013/07/12 14:37:34; author: emblogic; state: Exp; lines: +4 -3
written to multiple scullqset.
declared nobws,lcount,lnoq
—————————-
revision 1.4
date: 2013/07/12 14:01:12; author: emblogic; state: Exp; lines: +29 -8
written n no of bytes to scull using copy_from_user.
—————————-
revision 1.3
date: 2013/07/12 12:18:38; author: emblogic; state: Exp; lines: +7 -3
written 8 bytes to scull using copy_from_user.
printed written data into the driver.
—————————-
revision 1.2
date: 2013/07/10 18:01:30; author: emblogic; state: Exp; lines: +319 -9
implemented sucllqset ().
implemented qset(),quantum(),
allocate memory to quantum and qset .
succesfully working .
—————————-
revision 1.1
date: 2013/07/02 10:35:38; author: emblogic; state: Exp;
Initial revision
—————————-
revision 1.6.1.1 locked by: root;
date: 2013/07/16 15:54:53; author: emblogic; state: Exp; lines: +58 -8
successfully implimented llseek() for SEEK_SET.
decleare snoq,snob.
value update in f_pos.
=============================================================================

Posted in Uncategorized | Tagged | Leave a comment

its my 1st project related to linux ,how to compress file &then unzip,& i m very exited to do it

Posted in Uncategorized | Leave a comment