EmbLogic's Blog

Getting,initializing,retrieving and releasing the semaphore..

RCS file: semaphore_example.c,v
Working file: semaphore_example.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;    selected revisions: 5
description:
This is the main program to understand the working of semaphore.
Initially only the header.h header file is included in the program.
—————————-
revision 1.5    locked by: root;
date: 2014/01/15 06:28:52;  author: root;  state: Exp;  lines: +11 -1
Successfully implemented the signal() operation on the semaphore.
After performing the operation.A statement is added to check the value of the semaphore.
—————————-
revision 1.4
date: 2014/01/15 06:18:22;  author: root;  state: Exp;  lines: +1 -0
Program working fine.
A new statement is added which will give the value of the semaphore.
semctl() function is used to get the value.
—————————-
revision 1.3
date: 2014/01/15 06:08:35;  author: root;  state: Exp;  lines: +15 -0
semctl() function is used to set the value of the semaphore.
A check is also added to see if the call to semctl() is successfull or not.
—————————-
revision 1.2
date: 2014/01/15 05:52:39;  author: root;  state: Exp;  lines: +11 -0
semget() is used to create a new semaphore.The semaphore key 1235 is given to it.
After the call to semget() succeeds it returns the seamphore-id.
A check is added to display an error if the semaphore cannot be created.
—————————-
revision 1.1
date: 2014/01/15 05:46:04;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Leave a comment

Understanding The Fork Bomb

The fork bomb is a form of denial-of-service (DoS) attack against a Linux based system. It makes use of the fork operation. the processes recursively fork until a denial of service or a crash occurs
Fork bombs count as wabbits (a type of self-replicating computer program) they typically do not spread as worms or viruses. To incapacitate a system they rely on the (generally valid) assumption that the number of programs and processes which may execute simultaneously on a computer, has a limit.


A fork bomb works by creating a large number of processes very quickly in order to saturate the available space in the list of processes kept by the computer’s operating system. If the process table becomes saturated, no new programs may start until another process terminates. Even if that happens, it is not likely that a useful program may be started since the instances of the bomb program will each attempt to take any newly-available slot themselves.
Not only do fork bombs use space in the process table each child process uses further processor-time and memory. As a result of this, the system and existing programs slow down and become much more unresponsive and difficult or even impossible to use.

fork bombs can occur by accident in the normal development of software. The development of an application that listens on a network socket and acts as the server in a Client-server system may well use an infinite loop and fork operation in a manner similar to one of the programs presented below. A trivial bug in the source of this kind of application could cause a fork bomb during testing.

How to Make a Fork Bomb Virus

This is how to make a fork bomb, open the terminal as superuser, and execute the following

: (){ :|:& };:

Understanding the above:

: ()      # define ':' -- whenever we say ':', do this:
{        # beginning of what to do when we say ':'
    :    # load another copy of the ':' function into memory...
    |    # ...and pipe its output to...
    :    # ...another copy of ':' function, which has to be loaded into memory
         # (therefore, ':|:' simply gets two copies of ':' loaded whenever ':' is called)
    &    # disown the functions -- if the first ':' is killed, all of the functions that it has started should NOT be auto-killed
}        # end of what to do when we say ':'
;        # Having defined ':', we should now...
:        # ...call ':', initiating a chain-reaction: each ':' will start two more.
Posted in Linux Internals and System Programming, Uncategorized | Leave a comment

Appending a linked list at the end of another linked list in C

RCS file: append_list.c,v
Working file: append_list.c
head: 1.17
branch:
locks: strict
root: 1.17
access list:
symbolic names:
keyword substitution: kv
total revisions: 17;    selected revisions: 17
description:
Program that appends a linked list to another linked list.
—————————-
revision 1.17    locked by: root;
date: 2014/01/12 20:30:09;  author: root;  state: Exp;  lines: +7 -5
Logical error is fixed.
Issue:Linking of the last node of the first list with the first node
of the second list is not getting created.
—————————-
revision 1.16
date: 2014/01/12 20:18:21;  author: root;  state: Exp;  lines: +10 -9
Logical error in the append_function,checking after using double
pointers.
In the display function updated value is not getting passed.
—————————-
revision 1.15
date: 2014/01/12 20:08:28;  author: root;  state: Exp;  lines: +1 -0
Logical error is present in the append function.
program is not returning control to the user.
Issue:break statement is not included inside the while loop.
—————————-
revision 1.14
date: 2014/01/12 20:05:13;  author: root;  state: Exp;  lines: +6 -2
Declaration error fixed.
Issue: prototype of the function append_list() is missing.
—————————-
revision 1.13
date: 2014/01/12 20:02:33;  author: root;  state: Exp;  lines: +21 -3
append_list() function is implemented.
—————————-
revision 1.12
date: 2014/01/12 19:46:53;  author: root;  state: Exp;  lines: +1 -0
declaration error fixed.
—————————-
revision 1.11
date: 2014/01/12 19:45:50;  author: root;  state: Exp;  lines: +9 -1
display function is added for the first linked list.
—————————-
revision 1.10
date: 2014/01/12 19:41:22;  author: root;  state: Exp;  lines: +6 -0
exit() function is added in the program so that the user can
come out of the program.
—————————-
revision 1.9
date: 2014/01/12 19:38:01;  author: root;  state: Exp;  lines: +2 -0
Segmentation fault occurred in the program.
Possible reasons:After selecting case 3,case 4 also is getting selected
because break statement is not included.
—————————-
revision 1.8
date: 2014/01/12 19:35:47;  author: root;  state: Exp;  lines: +21 -8
insert_node() function for both first and second linked list is implemented.
Checking the functionality of the insert function.
—————————-
revision 1.7
date: 2014/01/11 14:50:48;  author: root;  state: Exp;  lines: +13 -3
If the creation of linked list is successfull display an appropriate
message to the user.
—————————-
revision 1.6
date: 2014/01/11 14:46:24;  author: root;  state: Exp;  lines: +2 -0
Prototype of the create_node() and insert_value() is added.
—————————-
revision 1.5
date: 2014/01/11 14:44:53;  author: root;  state: Exp;  lines: +1 -0
Header file:<stdlib.h> is added to support the exit() and malloc() function.
—————————-
revision 1.4
date: 2014/01/11 14:42:55;  author: root;  state: Exp;  lines: +12 -1
create_node() function is implemented to insert the nodes in the linked list.
Checking whether the functionality is correct or not.
—————————-
revision 1.3
date: 2014/01/11 14:38:42;  author: root;  state: Exp;  lines: +20 -0
Structure is defined having 2 data members: a info part and a pointer
to a structure of the same type.
—————————-
revision 1.2
date: 2014/01/11 14:34:58;  author: root;  state: Exp;  lines: +1 -1
Layout of the program is prepared by preparing the MAIN MENU.
—————————-
revision 1.1
date: 2014/01/11 14:34:20;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Data Structures with C | Leave a comment

An introduction to block device drivers

It is customary for authors explaining device drivers to start with a complete explanation of character devices, saving block device drivers for a later chapter. To explain why this is, I need to briefly introduce character devices as well. To do that, I’ll give a little history.

When Unix was written 25 years ago, its design was eclectic. One unusual design feature was that every physical device connected to the computer was represented as a file. This was a bold decision, because many devices are very different from one another, especially at first glance. Why use the same interface to talk to a printer as to talk to a disk drive?

The short answer is that while the devices are very much different, they can be thought of as having most of the same characteristics as files. The entire system is then kept smaller and simpler by only using one interface with a few extensions.
A practical effect of the difference is that filesystems can only be mounted on block devices, not on character ones. For example, most tapes are character devices. It is possible to copy the contents of a raw, quiescent (unmounted and not being modified) filesystem to a tape, but you will not be able to mount the tape, even though it contains the same information as the disk.

Most textbooks and tutorials start by explaining character devices, the sequential-access ones, because a minimal character device driver is easier to write than a minimal block device driver. My own Linux Kernel Hackers’ Guide (the KHG) is written the same way.

Posted in Uncategorized | Leave a comment

Sorting of values in the linked list in C language.

RCS file: Sorting_linked_list.c,v
Working file: Sorting_linked_list.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;    selected revisions: 5
description:
Program to sort the info. in the linked list.
Main menu is prepared for the user.
insert_node(),display() and create_node() functions are implemented successfully.
No issue is coming so far and the program is working absolutely fine.
—————————-
revision 1.5    locked by: root;
date: 2014/01/11 08:07:25;  author: root;  state: Exp;  lines: +1 -0
Sorting of linked list is successfully implemented.
—————————-
revision 1.4
date: 2014/01/11 08:03:42;  author: root;  state: Exp;  lines: +9 -0
Function to sort the linked list is implemented.
Checking the functionality of the function….
—————————-
revision 1.3
date: 2014/01/11 07:59:16;  author: root;  state: Exp;  lines: +5 -0
Another condition is added in the linked list’s display function part.
i.e to if there is no node in the list then display the message to the user
that there is no list.
—————————-
revision 1.2
date: 2014/01/11 07:56:12;  author: root;  state: Exp;  lines: +19 -0
A check is added in the program to display a message to the user,if the user enters the
choice for sorting the linked list but there is no node in the list.
—————————-
revision 1.1
date: 2014/01/11 07:49:37;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Data Structures with C | Leave a comment

tool chain Macro

Here we discuss about the variables/Macro use to make tool chains
1.SRCDIR:- This directory home all sources downloaded.
e.g.
export SRCDIR=/root/chaine/sources

2.BULIDDIR:- It is in this directory that will compile all source packages e.g.
export BUILDDIR=/root/chaine/build
3.TARGETMACH:-
This variable specifies the type of target architecture
e.g.
export TARGETMACH=arm-none-linux-gnueabi
4.BUILDMACH:-
This variable specifies the type of architecture in which the package is compiled.

export BUILDMACH=x86_64-pc-linux-gnu
5.INSTALLDIR
This variable provides information about the folder hosting the cross-toolchain.

export INSTALLDIR=/opt/arm

6.SYSROOTDIR :-
This variable provides information on the directory hosting the libraries and header files the kernel of the target system.e.g.
export SYSROOTDIR=/opt/arm/sysroot

7.CROSS:-
Indicates that we use the variable fields CROSS with arm-none-linux-gnueabi.
export CROSS=arm-none-linux-gnueabi

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

Open and Close File operations

head    1.3;
access;
symbols;
locks; strict;
comment    @ * @;

1.3
date    2014.01.10.09.25.47;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.09.11.09.19;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.23.58;    author root;    state Exp;
branches;
next    ;

desc
@Header file for init.c and exit .c
@

1.3
log
@header file now only includes header files and macros.
@

——————————————————————————————————————————————————–

head    1.3;
access;
symbols;
locks; strict;
comment    @ * @;

1.3
date    2014.01.10.09.26.29;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.09.11.09.45;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.25.07;    author root;    state Exp;
branches;
next    ;

desc
@all the declerations are done in this file for init.c and exit.c
@

1.3
log
@this file now has the extern declerations
@

——————————————————————————————————————————————————–

 

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.01.10.09.32.30;    author root;    state Exp;
branches;
next    ;

desc
@this file has the mapping of the file_operations fops
open and close.
@

——————————————————————————————————————————————————–

head    1.3;
access;
symbols;
locks; strict;
comment    @ * @;

1.3
date    2014.01.10.09.27.06;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.09.11.05.33;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.29.02;    author root;    state Exp;
branches;
next    ;

desc
@source code fro initialization function
@

1.3
log
@added the definitions of extern declerations
@

——————————————————————————————————————————————————–

head    1.2;
access;
symbols;
locks; strict;
comment    @ * @;

1.2
date    2014.01.10.09.27.33;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.29.47;    author root;    state Exp;
branches;
next    ;

desc
@source code for clean-up function.
@

1.2
log
@added the definitions of extern declerations
@

——————————————————————————————————————————————————–

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.01.10.09.33.32;    author root;    state Exp;
branches;
next    ;

desc
@routine for opening the node between kernel and user space
@

——————————————————————————————————————————————————–

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.01.10.09.34.09;    author root;    state Exp;
branches;
next    ;

desc
@routine for releasing the node between kernel and user space

——————————————————————————————————————————————————–

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.01.10.09.32.26;    author root;    state Exp;
branches;
next    ;

desc
@the application which is calling the driver for file_operations fops.
@

——————————————————————————————————————————————————–

head    1.2;
access;
symbols;
locks; strict;
comment    @# @;

1.2
date    2014.01.10.09.29.33;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.30.54;    author root;    state Exp;
branches;
next    ;

desc
@script file for the code
@

1.2
log
@added the command MKNOD
added the command make app
added the command unlink
@

Posted in Uncategorized | Leave a comment

Mutexes provide a high level of safety for mutual exclusion

Unbounded Priority Inversion
Problem with using counting or binary semaphores for controlling access to critical resources is called unbounded priority inversion. Priority inversion occurs when a low-priority task owns a semaphore, and a high-priority task is forced to wait on the semaphore until the low-priority task releases it. If, prior to releasing the semaphore, the low priority task is preempted by one or more mid-priority tasks, then unbounded priority inversion has occurred because the delay of the high-priority task is no longer predictable

Sharing a critical resource between high and low priority tasks is not a desirable design practice.It is better to share a resource only among equal priority tasks or to limit resource accesses to a single resource server task.

Priority Inheritance
The most common approach is priority inheritance. Since the mutex knows its current owner, it is possible to promote the priority of the owner whenever a higher-priority task starts waiting on the mutex. The current owner temporarily assumes the priority of the highest priority taskwaiting on the mutex. This allows the owner to resume running if it was preempted by a mid-priority task,When theowner releases the mutex, it drops back to its original priority.

Problems with Priority Inheritance
1.Since promotion of low-priority tasks to higher priority levels is caused by random sequences of events, it is not possible to predict how long mid-priority tasks will be
blocked by lower-priority promoted tasks
2.Priority inheritance can cause extra task switching.
3.Priority inheritance increases the likelihood of deadlocks, because priorities change unpredictably.

Priority Ceiling Promotion
An alternative to priority inheritance is priority ceiling promotion. With it, a priority
ceiling is specified for a mutex, when it is created. The ceiling is set equal to the priority
of the highest-priority task that is expected to get the mutex. When a lower-priority task
obtains the mutex, its priority is immediately boosted to the mutex’s ceiling. Hence, a
mid-priority task cannot preempt as long as the low-priority task owns the mutex, nor can
any other task preempt that wants the mutex. Interestingly, priority ceiling is a simply an
automatic method for forcing tasks to be of the same priority while using a resource.

Problems with Priority Ceiling Promotion
1.If the high-priority task seldom uses the resource and the low-priority task frequently uses the resource, this needlessly blocks mid-priority tasks from running. In this situation, priority inheritance is more attractive
2. A mutex ceiling is static. It is possible that a user task may have had its priority increased by the programmer, or increased dynamically, to a value above the mutex’s ceiling. Then priority ceiling promotion would not be working fully and some priority inversion could occur.

Summary of Methods for Mutual Exclusion
1. Counting Semaphore. Adequate for minimal systems, but has the following limitations: protection failure due to spurious signals, task lockup, premature release, and unbounded priority inversion.
2. Binary Semaphore. Better because it ignores spurious signals, but it still has these limitations: task lockup, premature release, and unbounded priority inversion.

3. Simple Mutex. Permits nesting, but does not deal with priority inversion.
4. Priority Inheritance Mutex. Less blocking of mid-priority tasks than priority ceiling, but can lead to excessive task switches, thus increasing overhead.
5. Priority Ceiling Mutex. Less task switches than inheritance, but may block mid-priority tasks too much. Provides a good method to prevent deadlocks

Posted in Linux Internals and System Programming, Uncategorized | Leave a comment

ARTICLE ON LODABLE KERNEL MODULE

Loadable kernel module

In computing, a loadable kernel module (or LKM) is an object file that contains code to extend the running kernel, or so-called base kernel, of an operating system. LKMs are typically used to add support for new hardware and/or filesystems, or for adding system calls. When the functionality provided by a LKM is no longer required, it can be unloaded in order to free memory and other resources.

Most current Unix-like systems and Microsoft Windows support loadable kernel modules, although they might use a different name for them, such as kernel loadable module (kld) in FreeBSD, kernel extension (kext) in OS X and kernel-mode driver in Windows NT. They are also known as Kernel Loadable Modules (or KLM), and simply as Kernel Modules (KMOD)

Advantages

Without loadable kernel modules, an operating system would have to include all possible anticipated functionality already compiled directly into the base kernel. Much of that functionality would reside in memory without being used, wasting memory, and would require that users rebuild and reboot the base kernel every time they require new functionality. Most operating systems supporting loadable kernel modules will include modules to support most desired functionality.

Disadvantages

One minor criticism of preferring a modular kernel over a static kernel is the so-called Fragmentation Penalty. The base kernel is always unpacked into real contiguous memory by its setup routines; so, the base kernel code is never fragmented. Once the system is in a state where modules may be inserted—for example, once the filesystems have been mounted that contain the modules—it is probable that any new kernel code insertion will cause the kernel to become fragmented, thereby introducing a minor performance penalty.

Implementation of LKM in linux

Loadable kernel modules in Linux are loaded (and unloaded) by the insmode command. They are located in /lib/modules and have had the extension .ko (“kernel object”) since version 2.6 (previous versions used the .o extension).The lsmod command lists the loaded kernel modules. In emergency cases, when the system fails to boot due to e.g. broken modules, specific modules can be enabled or disabled by modifying the kernel boot parameters list (for example, if using GRUB, by pressing ‘e’ in the GRUB start menu, then editing the kernel parameter line).

In the opinion of Linux maintainers, LKM are derived works of the kernel. The Linux maintainers tolerate the distribution of proprietary modules, but allow symbols to be marked as only available to GNU General Public License (GPL) modules.

Loading a proprietary or non-GPL-compatible LKM will set a ‘taint’ flagin the running kernel—meaning that any problems or bugs experienced will be less likely to be investigated by the maintainers. LKMs effectively become part of the running kernel, so can corrupt kernel data structures and produce bugs.

In 2004, Linuxant—a consulting company that releases proprietary device drivers as loadable kernel modules—attempted to bypass GPLONLY symbol restrictions by abusing a NULL terminator in their

module license i.e.,

MODULE_LICENSE:

MODULE_LICENSE("GPLfor files in the \"GPL\" directory; for others, only LICENSE file applies");

Linux allows disabling module loading via sysctl option /proc/sys/kernel/modules_disabled .An initramfs system may load specific modules needed for a machine at boot and then disable module loading. This makes the security very similar to a monolithic kernel. If an attacker can change the initramfs, they can change the kernel binary.

Posted in Uncategorized | Leave a comment

KERNEL SYMBOL TABLE

In programming language, a symbol is either a variable or a function. Or more generally, we can say, a symbol is a name representing an space in the memory, which stores data (variable, for reading and writing) or instructions (function, for executing). To make life easier for cooperation among various kernel function unit, there are thousands of global symbols in Linux kernel.

In general,when we have to use some variable or function outside the scope we use EXTERN or Declare globally similarly in kernal space we use symbol table .Once we EXPORT a module to symbol table it become a part of kerner .On that kernel any user can import that module .The table contains the addresses of global kernel items—functions and variables—that are needed to implement modularized drivers. When a module is loaded, any symbol exported by the module becomes part of the kernel symbol table.you can stack new modules on top of other modules. Module stacking is implemented in the mainstream kernel sources as well.

Posted in Uncategorized | Leave a comment

INTODUCTION TO CHARACTER DEVICE DRIVER

Character special files or character devices relate to devices through which the system transmits data one character at a time by, for example, getchar. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, and serial modems, and usually do not support random access to data.

In most implementations, character devices use unbuffered input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.

There are two major ways for a kernel module to talk to processes. One is through device files (like the files in the /dev directory), the other is to use the proc file system. Since one of the major reasons to write something in the kernel is to support some kind of hardware device, we’ll begin with device files.

The original purpose of device files is to allow processes to communicate with device drivers in the kernel, and through them with physical devices (modems, terminals, etc.). The way this is implemented is the following.

Each device driver, which is responsible for some type of hardware, is assigned its own major number. The list of drivers and their major numbers is available in /proc/devices. Each physical device managed by a device driver is assigned a minor number. The /dev directory is supposed to include a special file, called a device file, for each of those devices, whether or not it’s really installed on the system.

 

Posted in Uncategorized | Leave a comment

head    1.4;
access;
symbols;
locks
root:1.4; strict;
comment @ * @;

1.4
date    2014.01.09.16.52.25;    author root;    state Exp;
branches;
next    1.3;

1.3
date    2014.01.06.17.48.18;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.16.35.38;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.15.15.50;    author root;    state Exp;
branches;
next    ;

desc
@Device Driver registration using alloc_chrdev_region
@

1.4
log
@DRIVER INITIALIZATION FOR NO. OF DEVICES AND IMPORT FUNCTION
@

head    1.4;
access;
symbols;
locks
root:1.4; strict;
comment @ * @;

1.4
date    2014.01.09.16.59.43;    author root;    state Exp;
branches;
next    1.3;

1.3
date    2014.01.06.17.48.18;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.16.35.38;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.15.15.50;    author root;    state Exp;
branches;
next    ;

desc
@Device Driver registration using alloc_chrdev_region
@

Posted in Uncategorized | Leave a comment

character driver initialization completed

LOG FILE FOR ENTRY OF A MODULE IN KERNEL :

head    1.4;
access;
symbols;
locks
root:1.4; strict;
comment    @ * @;

1.4
date    2014.01.09.16.41.19;    author root;    state Exp;
branches;
next    1.3;

1.3
date    2014.01.06.14.28.40;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.14.10.20;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.13.06.31;    author root;    state Exp;
branches;
next    ;

desc
@source file for driver registration using alloc_chrdev_registration .
@

1.4
log
@initialization scull  &  c_dev for multiple devices and export a function in symbol table by using EXPORT_SYMBOL.
@

LOG FILE FOR DELETION OF A MODULE IN KERNEL :

head    1.3;
access;
symbols;
locks
root:1.3; strict;
comment    @ used free & unregister @;

1.3
date    2014.01.06.14.41.04;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.14.20.34;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.13.15.52;    author root;    state Exp;
branches;
next    ;

desc
@source file for driver to unregister it from kernel.
@

1.3
log
@ remove the cdev from device table using cdev_del and deallocate the memory too and unregister the driver.
@

Posted in Uncategorized | Leave a comment

Scull For Multiple Devices

head    1.2;
access;
symbols;
locks; strict;
comment    @ * @;

1.2
date    2014.01.09.11.09.19;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.23.58;    author root;    state Exp;
branches;
next    ;

desc
@Header file for init.c and exit .c
@

1.2
log
@nothing is changed as per the project
@

———————————————————————————————————————————————–

head    1.2;
access;
symbols;
locks; strict;
comment    @ * @;

1.2
date    2014.01.09.11.09.45;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.25.07;    author root;    state Exp;
branches;
next    ;

desc
@all the declerations are done in this file for init.c and exit.c
@

1.2
log
@declared the scull function for multiple devices
@

 

———————————————————————————————————————————————–

head    1.1;
access;
symbols;
locks; strict;
comment    @ * @;

1.1
date    2014.01.06.10.29.47;    author root;    state Exp;
branches;
next    ;

desc
@source code for clean-up function.
@

———————————————————————————————————————————————–

head    1.2;
access;
symbols;
locks; strict;
comment    @ * @;

1.2
date    2014.01.09.11.05.33;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.10.29.02;    author root;    state Exp;
branches;
next    ;

desc
@source code fro initialization function
@

1.2
log
@created for multiple devices using for loop and exported the function to Symbol Table
@

Posted in Uncategorized | Leave a comment

Character Device Driver

Implemented the following:

1.Set-up Scull for multiple devices.

2.Export a self made function to symbol table of kernel, and use the function in some other file.

Log file for init.c:

head    1.4;
access;
symbols;
locks
root:1.4; strict;
comment    @ * @;

1.4
date    2014.01.09.11.07.19;    author root;    state Exp;
branches;
next    1.3;

1.3
date    2014.01.06.15.38.44;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.14.16.20;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.13.06.31;    author root;    state Exp;
branches;
next    ;

desc
@This is the source file of initialization file of driver initialization by new mechanism.
@

1.4
log
@Setup scull for multiple devices and export a function in symbol table by using EXPORT_SYMBOL.
@

Log file for exit.c:

head    1.3;
access;
symbols;
locks
root:1.3; strict;
comment    @ * @;

1.3
date    2014.01.06.15.41.04;    author root;    state Exp;
branches;
next    1.2;

1.2
date    2014.01.06.14.20.34;    author root;    state Exp;
branches;
next    1.1;

1.1
date    2014.01.06.13.07.52;    author root;    state Exp;
branches;
next    ;

desc
@This is the source file of exit file of driver initialization by new mechanism.
@

1.3
log
@After allocating the memory and adding the cdev to device table, remove the cdev from device table using cdev_del and deallocate the memory too and unregister the driver.
@

Posted in Uncategorized | Leave a comment