Re: [LIP] Kernel blues
Linux India has been formed for Foster the growth of Linux in India
Brought to you by:
manojmishra,
raju
From: Supreet S. <supreet@SDF.LONESTAR.ORG> - 2003-01-29 03:31:41
|
I do'nt know if its of any interset or not but there is a package syscalltrack which would probably help in this case. EIP is IP that is Instruction pointer AFAIK and E in front means Extended that is extension to original x86 instruction set. looking for asbestos undies quickly etc and supreet On Tue, Jan 28, 2003 at 09:52:57PM +0530, Dhruv Gami wrote: > Hi all, > > ive recently ventured into kernel programming, and that too coz i was > required to write a module for catching data coming from one program and > inserting it in my running module to perform certain checks. > > The idea i used: > > I tried to create a character device (as explained in The Linux Kernel > Module Programming Guide from TLDP), by using get_user() and put_user() to > interact with the user space. I created a character device (/dev/char_dev) > by mknod, providing it with a major number as returned by my module. > > I wrote code for device_open(), device_release(), device_read(), > device_write() and device_ioctl(). Now the program compiles and the module > gets inserted by insmod. The problem is that im unable to interact with > the module. > > I donot know how to write to the device so as to get data into my module. > > Also, by tracing the program using printk's ... i discovered that > device_open() is NOT being called when a reference is made to it. i wrote > a tiny perl script to open() the device, so as to create a reference to > it. but 'lsmod' shows a reference count of -1 upon doing so. > > apparently, device_open() is not being called(that increments the > reference count), but device_release() is being called TWICE ! thus after > every time i run my tiny perl script, the reference count decreases by two > and goes deeper into negative numbers. > > Can somebody explain to me how a kernel module works. what is the flow of > control in a module ? how can i debug/trace it ? > > Im running kernel 2.4.18-14, on an intel p4 machine. > > i used register_chrdev() to register my device and unregister_chrdev() to > unregister it. could there be a problem with this ? > > Also, the dump as shown by the program upon running the perl script says > that it has some Null Pointer reference (EIP has a NULL value).... does > that mean something ? > > a quick reply with some help or pointers to relevent text would be greatly > appreciated. If someone wants a look at the code and error messages, i > shall do so in my next mail, as the code is in office and i can send it > from there tommorrow. > > thanks, > > regards, > Gami > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > linux-india-programmers mailing list > lin...@li... > https://lists.sourceforge.net/lists/listinfo/linux-india-programmers -- su...@sd... SDF Public Access UNIX System - http://sdf.lonestar.org |