EmbLogic's Blog

Author Archives: Raghav

Installing Arduino IDE in Fedora OS

 Open the terminal First you log in as a super user $ su $ password: ******* After you log in as a super user, download these packages given below. yum install arduino yum install java-1.7.0-openjdk After running these two commands … Continue reading

Posted in Uncategorized | Leave a comment

Writing Character Device Driver

Following are the important points to note while writing data from user space to kernel space 1. The memory we allocate for creating qsets are architecture dependent, because qsets are the array of pointers which points to quantums i.e. they … Continue reading

Posted in Uncategorized | Leave a comment

User Interface to Character Device Driver

RCS file: writef.c,v Working file: writef.c head: 1.15 branch: locks: strict root: 1.15 access list: symbolic names: keyword substitution: kv total revisions: 15;    selected revisions: 15 description: chardev_write() function reside here. —————————- revision 1.15    locked by: root; date: 2014/03/01 11:19:07;  … Continue reading

Posted in Uncategorized | Leave a comment

Writing data to character device driver

RCS file: wwrite.c,v Working file: wwrite.c head: 1.7 branch: locks: strict raghav: 1.7 access list: symbolic names: keyword substitution: kv total revisions: 7;    selected revisions: 7 description: The file_operations structure is defined in linux/fs.h —————————- revision 1.7    locked by: raghav; … Continue reading

Posted in Uncategorized | Leave a comment

Implementing cdev_del() — remove a cdev from the system

RCS file: clean.c,v Working file: clean.c head: 1.3 branch: locks: strict raghav: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3;    selected revisions: 3 description: to delete the chr_dev structure which we had initialized during chr_dev init —————————- … Continue reading

Posted in Uncategorized | Leave a comment

Passing Command Line Arguments to a Module

Driver Modules can take command line arguments, but not with the argc/argv you might be used to. To allow arguments to be passed to your module, declare the variables that will take the values of the command line arguments as … Continue reading

Posted in Uncategorized | Leave a comment

Program to delete a file using file handling in c

RCS file: x.c,v Working file: x.c raghav: 1.5 access list: keyword substitution: kv total revisions: 5;    selected revisions: 5 description: Program to delete any file using file handling in c With function remove() we can delete/remove any file from the … Continue reading

Posted in Uncategorized | Leave a comment

User interface to Character Device Driver

There are few steps to follow to open a file inside kernel from application layer. 1. Insert your character device driver inside the kernel using insmod and check its entry in the device driver table using cat /proc/devices and note … Continue reading

Posted in Uncategorized | Leave a comment

Unregistering a character device driver from device table

There are some points which we have to note down while working in character device driver: 1. The second argument of unregister_chrdev_region function means the number of devices to unregister from the device table ….  should be matched with the … Continue reading

Posted in Uncategorized | Leave a comment

Adding a character device driver to the system using cdev_add

Implementing cdev_add and cdev_init RCS file: header.h,v Working file: header.h head: 1.4 branch: locks: strict raghav: 1.4 access list: symbolic names: keyword substitution: kv total revisions: 4;    selected revisions: 4 description: This is a seperate header file where i have … Continue reading

Posted in Uncategorized | Leave a comment

Problem in registering and unregistering driver in kernel

There are some problems which we faced in un- registering the driver 1. there is no return type of unregister_chrdev_region , so you can check the result only by using vim /proc/devices after rmmod command 2. suppose if you are … Continue reading

Posted in Uncategorized | Leave a comment

Registering a character device driver with Major and Minor number in kernel

RCS file: header.h,v Working file: header.h head: 1.3 branch: locks: strict raghav: 1.3 access list: symbolic names: keyword substitution: kv total revisions: 3;    selected revisions: 3 description: This is a seperate header file where i have included all the necessary … Continue reading

Posted in Uncategorized | Leave a comment

Inserting a file inside a Kernel file system

RCS file: entry.c,v Working file: entry.c head: 1.6 branch: locks: strict raghav: 1.6 access list: symbolic names: keyword substitution: kv total revisions: 6;    selected revisions: 6 description: program to insert a driver file inside our kernel —————————- revision 1.6    locked … Continue reading

Posted in Uncategorized | Leave a comment

Implementing Semaphore in a single process by setting its initial value to ZERO

RCS file: test1.c,v Working file: test1.c head: 1.6 branch: locks: strict raghav: 1.6 access list: symbolic names: keyword substitution: kv total revisions: 6;    selected revisions: 6 description: Implementing semaphore in a single process to check what if …we set the … Continue reading

Posted in Uncategorized | Leave a comment

PROCESS MANAGEMENT

“Process management” as name itself means to manage the processes. And in terms of Linux OS, processes means “executing instance” of a program or we can use a word “tasks” for processes. Example: when ever we copy a file or … Continue reading

Posted in Uncategorized | Leave a comment