EmbLogic's Blog

LIBRARY CALL vs SYSTEM CALL

System Calls:-
1.Function provoked by the kernel.
2.Get executed in kernel mode.
3.runs in supervisory mode so have every privileged.
4.System calls are slow as there is context switch involved.
5.System call have OS support.
6.System call transfer control to OS.
7.System call are usually not portable.
8.man 2 contains system call.
9. Eg:-open().

Library calls:-
1.Function with Program libraries.
2.Get executed in user mode.
3. Doesn’t have every privileged.
4.Library calls are faster.
5.Library call have compiler support.
6.Library call invoked a subroutine linked with function.
7.Library call are easily readable,portable and maintainable.
8.man 3 contains library calls.
9. Eg:- fopen()

NOTE:Every library call internally calls the system call to perform the task.

Posted in Data Structures with C, Linux Internals and System Programming | Leave a comment

PROCESS CONTEXT vs INTERRUPT CONTEXT.

Process Context :
–>when user space execute system call.Then the kernel is executing one the behalf of process. It is known as in process context.
–>In process context process can sleep.
–>Kernel is preempt able.
–>can slow in handling the request.
–>Access to process virtually address space.

Interrupt Context:
–>When Handling the interrupt kernel is in interrupt context.
–>Kernel can’t execute any sleep function and very quick.
–>kernel can’t be preempted.
–>Run on kernel address space.

Posted in Device Drivers, Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Leave a comment

How to install vlc media player in fedora 20

In fedora you find a bug of gpgcheck but here is a solution of it
go to your terminal and become super user using
[root@localhost ~]# su –
now you have type following commands
link no.1:-
rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
link no.2:-yum install –nogpgcheck vlc
link no.3:-yum install –nogpgcheck gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly
now go to the search option for your fedora apps and search for vlc media player,hope you had that

Posted in Uncategorized | Leave a comment

WRITE A PROGRAM FOR INSERTION SORT.

code:

#include<stdio.h>
#include<stdlib.h>
int insertion_sort(int *,int);
int main()
{
int i,n;
int *arr;
printf(“Enter No. Of Elements\n”);
scanf(“%d”,&n);
arr=calloc(n,sizeof(int));
printf(“Elemente Are:\n”);
for(i=0;i<n;i++)
{
scanf(“%d”,arr+i);
}
insertion_sort(arr,n);
printf(“Sorted Elements Are:\n”);
for(i=0;i<n;i++)
{
printf(“%d “,*(arr+i));
}
return 0;
}
int insertion_sort(int *arr,int n)
{
int i,j,k,temp,flag=0;
for(i=0;i<n;i++)
{
for(j=i-1;(j>=0)&&(*(arr+j)>*(arr+j+1));j–)
{
temp=*(arr+j);
*(arr+j)=*(arr+j+1);
*(arr+j+1)=temp;
flag=1;
}
printf(“Pass[%d]“,i);
for(k=0;k<n;k++)
{
printf(“%d “,*(arr+k));
}
printf(“\n”);
}
}

Posted in Data Structures with C | Leave a comment

WRITE A PROGRAM FOR BUBBLE SORT?

code :

#include<stdio.h>
#include<stdlib.h>
int bubble_sort(int *,int);
int main()
{
int i,n;
int *arr;
printf(“Enter No. Of Elements\n”);
scanf(“%d”,&n);
arr=calloc(n,sizeof(int));
printf(“Elements Are:\n”);
for(i=0;i<n;i++)
{
scanf(“%d”,arr+i);
}
bubble_sort(arr,n);
printf(“Elements After Sorting:\n”);
for(i=0;i<n;i++)
{
printf(“%d”,*(arr+i));
}
return 0;
}

int bubble_sort(int *arr,int n)
{
int i,j,temp,flag,k;
for(i=0;i<n-1;i++)
{
flag=0;
for(j=0;j<(n-1)-i;j++)
{
if(*(arr+j) > *(arr+j+1))
{
temp=*(arr+j);
*(arr+j)=*(arr+j+1);
*(arr+j+1)=temp;
flag=1;
}
}
printf(“Pass[%d]:”,i);
for(k=0;k<n;k++)
{
printf(“%d “,*(arr+k));
}
printf(“\n”);
if(flag==0)
{
break;
}
}
}

Posted in Data Structures with C | Leave a comment

Hello_kern_prog

This is insert the data into the ram and print it.

Posted in Character Driver | Leave a comment

BLOCKING AND NON_BLOCKING I/O

BLOCKING I/O :
**Most I/O requests are considered blocking requests, meaning that control does not return to the application until the I/O is complete.
**Using systems call that block is sometimes call synchronous programming.
**In most cases, the wait is not really a problem because the program can not do anything else until the I/O is finished. but in some cases like networking it is a problem.
**For Eg: read() which blocks if no data is currently available in the buffer.

NON-BLOCKING I/O :
**Non-blocking call returns immediately, without waiting for the I/O to complete.
**Using systems call that not blocks is sometimes call asynchronous programming.
**The completion of the I/O is later communicated to the application either through the setting of some variable in the application or through the triggering of a signal or call-back routine that is executed outside the linear control flow of the application.
**problems of Deadlock and Data Inconsistency are eliminated if correct asynchronous programming is done.
**For Eg:select()

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

USER-level THREAD AND KERNEL-level THREAD

USER-level Thread :
–>Run on top of the system in user mode.These thread within the process are invisible to OS.
–>Simple Representation: Each thread is represented simply by a PC, registers, stack and a small control block, all stored in the user process address space.
–>Simple Management: This simply means that creating a thread, switching between threads and synchronization between threads can all be done without intervention of the kernel.
–>Fast and Efficient: Thread switching is not much more expensive than a procedure call.
–>Computing performance is higher because of less overhead.
–>When using the blocking system call() like read the entire process would block.
–>There is a lack of coordination between threads and operating system kernel the access to multiple processors is not guaranteed since the operating system is not aware of existence of these types of threads.
–>The scheduling control by the thread runtime system may cause some threads to gain exclusive access to the CPU and prevent other threads from obtaining the CPU

KERNEL-level THREAD :
–>Kernel threads are scheduled within the kernel of the OS.
–>Because kernel has full knowledge of all threads, Scheduler may decide to give more time to a process having large number of threads than process having small number of threads.
–>Kernel-level threads are especially good for applications that frequently block.
–>The synchronization and sharing resources among threads are still less expensive than multiple-process model, but more expensive than user-level threads.
–>The kernel-level threads are slow and inefficient.
–>Computing performance is lower because of more overhead.
–>kernel-level threads will guarantee multiple processor access.

HYBRID MODEL APPROACH(User-level thread/kernel-level thread)
Thread Creation done in user space.
Bulk of scheduling and synchronization is done in user space.
Multiplexing user level thread and kernel level thread to combine the best approach of both.

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

THREAD

What is Thread?
Ans :Thread are unit of execution within a process that can be schedule by OS scheduler which share the data and code segment but have its own stack segment.

What is Single threaded process?
Ans :In single-threaded processes, the process contains one thread.process is only thread so one thing going on at a time.

What is MULTI THREADED Process?
Ans :In multi threaded processes, the process contains more than one thread—there’s more than one thing going on simultaneously.

Benefits of Multi-threading?
*Programming Abstraction:Dividing up the work and assign each unit of work to thread make working easy and manageable for user as well as OS gets relieve as context switch within the thread is easy.
*Parallelism :threads provide an efficient way to achieve true parallelism. As each thread receives its own virtualized processor and is an independently-schedulable entity, multiple threads may run on multiple processors at the same time, improving a system’s throughput. Thus Providing BETTER UTILIZATION OF HARDWARE.
*Memory Saving :Threads provide an efficient way to share memory yet utilize multiple units of execution.
*Enhanced performance on multi-processor machines

Disadvantages of Multi-threading.
*general: increased complexity
*As lots of data are shared among thread it need to manage concurrency through mechanisms such as mutexes and condition variables
*difficult to debug, result is sometimes unpredictable
*potential deadlocks.

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

MULTITASKING

What is meant by multitasking ?
Multitasking OS is one which simultaneously interleave execution on more then one process.

There are two types :-

1.Cooperative Multitasking : A process doesn’t stop until it voluntary wants to do so.The act of process voluntary suspending itself is called yielding.
Disadvantages :
1.Scheduler can’t make global decision.
2.A single process can monopolize the system.
3.A hang up process that never yields can potentially bring down the entire system.

2.Pre-emptive Multitasking : In this scheduler decides when a running process cease running and a new process begin running.
The act of involuntary suspending the running process is called pre-emption.Time slice determine when will a running process is pre-empted.
Advantages :
1.Scheduler make global decision.
2.No Process can monopolize the processor.

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

STAGES OF COMPILATION IN LINUX

————————————————————————————————–
STAGES OF COMPILATION IN LINUX
————————————————————————————————–

Step 1 : Preprocessing :We use cpp tool here
—-> it helps in creating fast and efficient code.
—-> it reads from header files for creating a pre-processed source file.
—-> all macros and constant symbols are replaced.
—-> all conditional pre-processor directives are processed by pre-processor.
—-> it provides conditional pre-processor directives are pre-processed by processor.

Step 2 : Assembler : (We use compiler tool here )
—–> Takes pre-processed file and creates file with ‘.s’ extension called as assembly file.
—–> It is mainly required for optimixation (speed and space) of code.

Step 3 : Relocatable Binary : (We use assembler tool here )
—–>contains offset address of the assembly code, it is assigned at compile time.object dump of first.o shows offset address.
for eg: a relocatable code contains call. Its position depends on main position.
This file contains source in assembly and library routines.

Step 4 : Linking : ( We use linker tool )
—–>linker tool is used to build the executable image, here we are packaging that gives
lodable binary code that can be loaded and executed.

Posted in Data Structures with C | Leave a comment

LINUX BOOT PROCESS

LINUX BOOT PROCESS

When a system is booted ,Processor executed a code from a well-known location known as BIOS(Basic Input Output System) which is stored in flash memory of motherboard. Its Job is to find the boot device.
When boot device is found ,FIRST stage boot loader is loaded into the RAM and executed. This Boot Loader is 512bytes in size. Its job is to find the SECOND order Boot Loader.
When the second-stage boot loader is in RAM and executing, upon this Linux and an optional initial RAM disk (temporary root file system) are loaded into memory. When the images are loaded, the second-stage boot loader passes control to the kernel image and the kernel is decompressed and initialized. At this stage, the second-stage boot loader checks the system hardware, enumerates the attached hardware devices, mounts the root device,and then loads the necessary kernel modules. When complete, the first user-space program (init)starts, and high-level system initialization is performed.

What BIOS do during startup?

In a PC, booting Linux begins in the BIOS at an specific address(like 0xFFFF0).
The first step of the BIOS is the power-on self test (POST). The job of the POST is to perform a check of the hardware. The second step of the BIOS is local device enumeration and initialization.
To boot an operating system, the BIOS runtime searches for devices that are both active and bootable . A boot device can be a floppy disk, a CD-ROM etc.
Commonly, Linux is booted from a hard disk, where the Master Boot Record (MBR) contains the primary boot loader.

What STAGE 1 boot loader do?
The primary boot loader that resides in the MBR is a 512-byte image containing both program code and a small partition table. The first 446 bytes are the primary boot loader,which contains both executable code and error message text. The next sixty-four bytes are the partition table, which contains a record for each of four partitions (sixteen bytes each). The MBR ends with two bytes that are defined as the magic number. This number serves as a validation check of the MBR.

What STAGE-2 boot loader do?
The secondary, or second-stage, boot loader could be more aptly called the kernel loader. The task at this stage is to load the Linux kernel and optional initial RAM disk.

The first- and second-stage boot loaders combined are called Linux Loader (LILO) or GRandUnified Bootloader (GRUB) in the x86 PC environment

After After the kernel is booted and initialized, the kernel starts the first user-space application that is init. This is the first program invoked that is compiled with the standard C library.

Posted in Linux Internals and System Programming | Leave a comment

MAJOR AND MINOR NUMBER

MAJOR AND MINOR NUMBER :-

Char devices are accessed through names in the filesystem.
Those names are called special files or device files or simply nodes of the filesystem tree.
they are conventionally located in the /dev directory.

MIJOR NO. == Kernel give to the driver. It identifies the driver associated with the device.

MINOR NO. == Driver gives to the device. It identifies exactly which device is being referred to.

There are total 255 Major and 255 Minor no

Posted in Character Driver | Leave a comment

MY FIRST HELLO_WORLD MODULE

/*
* This is my first driver module:
* Module is a piece of code that can be loaded and unloaded into the kernel during runtime.
*/

#ifndef __HEADER
#define __HEADER
#include<linux/kernel.h>                //Needed by KERN_INFO
#include<linux/module.h>              //Needed by All Module
#include<linux/init.h>                     //for init_module
#include<linux/sched.h>                //for current value
#endif

MODULE_LICENSE(“GPL”);                                //Macro: specify copyright license for the file.
MODULE_AUTHOR(“Jyoti Singh”);                           //Macro: specify module author.
MODULE_DESCRIPTION(“Hello_Module”);          //Macro: specify short module description
static int hello_init(void)                 //static to make scope within this file.
{

printk(KERN_INFO “Hello!!!Here,I M This is what I can do for U(*.*)\n”);
printk(KERN_INFO “The process is \”%s\” (pid %i)\n”,current->comm,current->pid);
return 0;
}

static void hello_exit(void)
{
printk(KERN_INFO “BYE!! I M Not there any more , don’t ask me to do any work!!!\n”);
printk(KERN_INFO “The process is \”%s\” (pid %i)\n”,current->comm,current->pid);
}

module_init(hello_init);                             //This is a Macro Invoke during loading(insmod)
module_exit(hello_exit);                           //This is a Macro Invoke during unloading(rmmod)

Posted in Character Driver | Leave a comment

Character-driver

Character driver
—————————-
revision 1.38
date: 2016/03/11 05:46:49; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.37
date: 2016/03/10 09:52:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.36
date: 2016/03/10 09:49:21; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.35
date: 2016/03/10 09:40:54; author: root; state: Exp; lines: +5 -2
*** empty log message ***
—————————-
revision 1.34
date: 2016/03/10 09:34:58; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.33
date: 2016/03/10 09:32:03; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.32
date: 2016/03/10 09:23:40; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.31
date: 2016/03/10 09:22:50; author: root; state: Exp; lines: +2 -0
We cross check the program.
—————————-
revision 1.30
date: 2016/03/10 09:19:44; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.29
date: 2016/03/10 09:17:59; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.28
date: 2016/03/10 09:17:21; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.27
date: 2016/03/10 09:15:41; author: root; state: Exp; lines: +6 -4
Call the memset().
Call the cdev_init().
Call the cdev_add().
—————————-
revision 1.26
date: 2016/03/10 09:03:11; author: root; state: Exp; lines: +1 -0
Declare the variable of dev inside it.
—————————-
revision 1.25
date: 2016/03/10 08:56:32; author: root; state: Exp; lines: +7 -0
Malloc the memory for dev struct through kmalloc.
It takes two arguments frist type or bit o memory and 2nd is flag.
—————————-
revision 1.24
date: 2016/03/10 08:36:18; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.23
date: 2016/03/10 08:34:18; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2016/03/10 06:20:52; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.21
date: 2016/03/10 06:17:13; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.20
date: 2016/03/10 06:15:15; author: root; state: Exp; lines: +6 -6
*** empty log message ***
—————————-
revision 1.19
date: 2016/03/10 06:11:27; author: root; state: Exp; lines: +6 -4
*** empty log message ***
—————————-
revision 1.18
date: 2016/03/10 06:03:04; author: root; state: Exp; lines: +2 -3
Delete the majorno and minorno variable and declare it into the macro.h
Delete the dev_t devid and declare it into the macro.h
—————————-
revision 1.17
date: 2016/03/10 05:53:26; author: root; state: Exp; lines: +3 -1
Here declare the libraray #include”macro.h”.
We spacifie the macro inside the function.
—————————-
revision 1.16
date: 2016/03/09 10:24:50; author: root; state: Exp; lines: +1 -1
Pass the address.
—————————-
revision 1.15
date: 2016/03/09 10:23:00; author: root; state: Exp; lines: +1 -1
Here we use alloc_chrdev_region().
Now pass the argument where the minor no. startup and no. of devices.
—————————-
revision 1.14
date: 2016/03/09 10:01:33; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/09 09:58:32; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/09 09:56:35; author: root; state: Exp; lines: +3 -4
Add the dev_t variable and inside the register_chrdev_region().
Print the majar no. and minor no.
—————————-
revision 1.11
date: 2016/03/09 09:48:56; author: root; state: Exp; lines: +1 -1
Add the argument which tell no. of devices.
—————————-
revision 1.10
date: 2016/03/09 09:46:41; author: root; state: Exp; lines: +1 -1
Aplly condition to check the registeration through register_chrdev_region.
—————————-
revision 1.9
date: 2016/03/09 09:46:07; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/03/09 09:42:29; author: root; state: Exp; lines: +3 -3
Decalre a integer variable which name is mano.(major no.).
—————————-
revision 1.7
date: 2016/03/09 09:39:01; author: root; state: Exp; lines: +16 -3
Call the register_chrdev_region().
The frist argument is dev_t type in which major no. is save and 2nd argument strore the minor number.
3rd argument is name of driver i.e in which name you register your own driver in table.
—————————-
revision 1.6
date: 2016/03/09 09:20:55; author: root; state: Exp; lines: +1 -1
Add the termination condition.
—————————-
revision 1.5
date: 2016/03/09 09:19:21; author: root; state: Exp; lines: +0 -2
Add the prototype file.
Define the struct file_operations.
—————————-
revision 1.4
date: 2016/03/09 09:09:30; author: root; state: Exp; lines: +1 -1
Here declare the mno.
—————————-
revision 1.3
date: 2016/03/09 08:56:52; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/03/09 08:50:51; author: root; state: Exp; lines: +6 -0
Register().
Frist arguments is major no..
So put in 0 for default case.
2nd arguments are driver name
3rd arguments are file operations.
—————————-
revision 1.1
date: 2016/03/04 10:29:25; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: macro.h,v
Working file: macro.h
head: 1.15
branch:
locks: strict
root: 1.15
access list:
symbolic names:
keyword substitution: kv
total revisions: 15; selected revisions: 15
description:
Declare a new file.Here we define the macro.
—————————-
revision 1.15 locked by: root;
date: 2016/03/27 10:11:10; author: root; state: Exp; lines: +0 -4
*** empty log message ***
—————————-
revision 1.14
date: 2016/03/27 10:10:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/27 10:05:42; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/27 10:02:37; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/03/16 10:38:14; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/03/11 12:23:37; author: root; state: Exp; lines: +4 -0
Add the macro of DEBUG
—————————-
revision 1.9
date: 2016/03/11 05:58:19; author: root; state: Exp; lines: +0 -3
*** empty log message ***
—————————-
revision 1.8
date: 2016/03/11 05:52:49; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/11 05:51:42; author: root; state: Exp; lines: +0 -4
Remove the node macro.
—————————-
revision 1.6
date: 2016/03/10 08:57:42; author: root; state: Exp; lines: +15 -0
define the variale of structure like devicesize,quantumsize,qsetsize,datasize.
—————————-
revision 1.5
date: 2016/03/10 08:41:40; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/03/10 06:17:15; author: root; state: Exp; lines: +0 -3
*** empty log message ***
—————————-
revision 1.3
date: 2016/03/10 06:06:02; author: root; state: Exp; lines: +10 -0
Here declare the minorno and majorno .
We also declare dev_t devid variable.
—————————-
revision 1.2
date: 2016/03/10 05:56:12; author: root; state: Exp; lines: +1 -1
Defile the value of nod.
—————————-
revision 1.1
date: 2016/03/10 05:54:14; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: opendev.c,v
Working file: opendev.c
head: 1.44
branch:
locks: strict
root: 1.44
access list:
symbolic names:
keyword substitution: kv
total revisions: 44; selected revisions: 44
description:
Here open the device.
release the device.
—————————-
revision 1.44 locked by: root;
date: 2016/03/26 08:23:06; author: root; state: Exp; lines: +9 -9
*** empty log message ***
—————————-
revision 1.43
date: 2016/03/26 08:17:34; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.42
date: 2016/03/26 08:15:51; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.41
date: 2016/03/26 08:06:45; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.40
date: 2016/03/26 07:56:13; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.39
date: 2016/03/26 07:55:16; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.38
date: 2016/03/26 07:54:15; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.37
date: 2016/03/26 07:53:09; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.36
date: 2016/03/26 07:50:05; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.35
date: 2016/03/26 07:46:21; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.34
date: 2016/03/26 07:42:37; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.33
date: 2016/03/26 06:10:00; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.32
date: 2016/03/26 05:58:03; author: root; state: Exp; lines: +0 -1
remove the call of trimdev().
—————————-
revision 1.31
date: 2016/03/23 19:27:13; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.30
date: 2016/03/23 19:24:55; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.29
date: 2016/03/16 10:45:01; author: root; state: Exp; lines: +4 -4
*** empty log message ***
—————————-
revision 1.28
date: 2016/03/16 05:05:43; author: root; state: Exp; lines: +1 -2
Here we remove one print statement and add some print text.
—————————-
revision 1.27
date: 2016/03/16 04:59:56; author: root; state: Exp; lines: +1 -1
There is not allow , inside printk like that printk(KERN_INFO, “g\n”); like this this create a error.
—————————-
revision 1.26
date: 2016/03/16 04:52:50; author: root; state: Exp; lines: +8 -11
Initially we put ldev = NULL.
We use ldev into container_of().
It return some value then these value save inside the file->private.data.
And make a conditon in which it always strore the last two bit same as because we know O_ACCMODE the value is three and its binaray no. is 11 we and with the flag value so it store same flag digit of frist two digit.
—————————-
revision 1.25
date: 2016/03/16 04:45:55; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.24
date: 2016/03/14 11:47:10; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.23
date: 2016/03/14 11:46:25; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2016/03/14 11:45:46; author: root; state: Exp; lines: +2 -3
*** empty log message ***
—————————-
revision 1.21
date: 2016/03/14 11:43:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2016/03/14 11:42:29; author: root; state: Exp; lines: +1 -1
Define the struct dev *ldev.
—————————-
revision 1.19
date: 2016/03/14 11:40:07; author: root; state: Exp; lines: +1 -3
Call the trimdev().
—————————-
revision 1.18
date: 2016/03/14 11:37:59; author: root; state: Exp; lines: +3 -2
Add the macro.h header file.
—————————-
revision 1.17
date: 2016/03/14 11:35:39; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.16
date: 2016/03/14 11:16:28; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.15
date: 2016/03/14 11:13:56; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.14
date: 2016/03/14 11:13:25; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/14 10:50:12; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/14 10:45:46; author: root; state: Exp; lines: +3 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/03/14 10:42:55; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.10
date: 2016/03/14 10:40:59; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/03/14 10:24:30; author: root; state: Exp; lines: +0 -4
*** empty log message ***
—————————-
revision 1.8
date: 2016/03/14 10:17:23; author: root; state: Exp; lines: +5 -1
And operataion perform.
—————————-
revision 1.7
date: 2016/03/14 08:08:03; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/11 12:23:49; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.5
date: 2016/03/11 12:03:53; author: root; state: Exp; lines: +0 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/03/11 12:02:41; author: root; state: Exp; lines: +7 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/03/11 11:41:49; author: root; state: Exp; lines: +22 -2
Call the trim function which use to overwrite data.
—————————-
revision 1.2
date: 2016/03/11 10:51:03; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/03/11 10:04:55; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.16
branch:
locks: strict
root: 1.16
access list:
symbolic names:
keyword substitution: kv
total revisions: 16; selected revisions: 16
description:
—————————-
revision 1.16 locked by: root;
date: 2016/03/28 10:15:46; author: root; state: Exp; lines: +1 -0
Add the seekdev() return and prototype.
—————————-
revision 1.15
date: 2016/03/22 03:46:26; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2016/03/22 03:42:57; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/21 10:56:47; author: root; state: Exp; lines: +21 -0
Remove the prototype here.
—————————-
revision 1.12
date: 2016/03/11 12:23:50; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/03/11 11:50:42; author: root; state: Exp; lines: +1 -1
Defination of the trimdev().
—————————-
revision 1.10
date: 2016/03/11 11:42:31; author: root; state: Exp; lines: +1 -0
Add the int trimdev().
—————————-
revision 1.9
date: 2016/03/11 06:44:38; author: root; state: Exp; lines: +1 -1
Add the dev_t devno.
—————————-
revision 1.8
date: 2016/03/11 06:02:54; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/11 05:57:57; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/10 09:16:24; author: root; state: Exp; lines: +1 -1
Add the pointer structre.
—————————-
revision 1.5
date: 2016/03/10 09:03:33; author: root; state: Exp; lines: +1 -0
Add the variable of dev.\
—————————-
revision 1.4
date: 2016/03/10 08:37:52; author: root; state: Exp; lines: +2 -0
Add the two variables.
—————————-
revision 1.3
date: 2016/03/09 09:57:27; author: root; state: Exp; lines: +1 -1
Add the variable chrdev.
—————————-
revision 1.2
date: 2016/03/09 09:44:25; author: root; state: Exp; lines: +1 -0
Add the extern file
Declare the major no. inside the prototype.h.
—————————-
revision 1.1
date: 2016/03/09 09:14:21; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: readdev.c,v
Working file: readdev.c
head: 1.179
branch:
locks: strict
root: 1.179
access list:
symbolic names:
keyword substitution: kv
total revisions: 179; selected revisions: 179
description:
This is a readdev().
Here we start to read data.
—————————-
revision 1.179 locked by: root;
date: 2016/03/31 06:06:31; author: root; state: Exp; lines: +2 -3
*** empty log message ***
—————————-
revision 1.178

Posted in Character Driver | Leave a comment