Thursday, March 20, 2008

now that wen i have got a good response for this post on device drivers i wud love to thankyou all and share more..now let us examine the anatomy of the device driver..i mean the major components of a driver..from my previous post we can percept that device driver is a software with a set of entrypoints that can be called by the operating system.it can also contain *data structures private to the driver*references to kernel data structures external to the driver*routines private to the driver..here i dont mean entry points..instead routines..now let me stop boring you ppl with the theory part and jump into programming.. :) :)most drivers are written as a single source file or set a set of dependent files andcompiled usign make command..(before that we gotta write the Makefile specifying the orderof compilation of all the .o files)the initial part of the driver source file is called as a prologue and the rest contains entry points.the prologue contains the initialization part as most of the .c files are written. * #include-header files * #define-all the constants used in the driver * all the variable declarations and data structuresas said before the remaining part contains the entry points

like init,exit,open,read,write,close and allk let me continue in my next post..got some work :(

Friday, March 14, 2008

a very interesting and challenging subject for system programmers..device drivers are the programs which allow high-level programs to interact with the hardware..now all that am going to talk about is device drivers in unix and unix-like os.

in a programmer's point of view there are four types of drivers..* char drivers(read/write char by char eg..floppy,mouse)* block drivers(block by block.eg.filesystems..hard drivers)* terminal drivers(ttys)* stream drivers(don knw much abt these.neva worked..must be related to stream interface functions)

in unix/linux device drivers can be part of the kernel or can be loadable modules..modules are the programs which can be loaded into the kernel during run-time..these are generally called