Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-20-2011, 08:38 AM
|
#1
|
LQ Newbie
Registered: May 2009
Posts: 25
Rep:
|
Accessing and performing operations on Base level kernel structure
Dear All,
We all know linux kernel base layer is made up of structures, in which every object of kernel is well defined. Structure members correspond to object properties required to define object behavior.
For example if we take case of File system.It composed of four objects , superblock objects, inode objects, file objects and dentry object.Each having well defined structure which is being operated by system call handler and by system call service routine in the kernel mode.
Now my question is even in kernel mode we do not have some mechanism by which we can get access to pointer of these structures.We have some macro.
If I want to manipulate structure on my on way, or performing some more operation defined by me.For example after the crash of Hard Disk Drive, having ext2/3 file system, If i want to know all the inode pointers, and block details.
Can I have some way out to do desired operation ??
Can anybody suggest me some mechanism to operate on these base label structures, even in kernel mode ..
All suggestions are welcomed.
Thanks & Regards.
Ankur
Last edited by ankur0921; 01-20-2011 at 08:40 AM.
|
|
|
01-20-2011, 11:45 AM
|
#2
|
Senior Member
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
|
You need a Linux kernel debugger, for example kdb, and a kernel with debugging enabled (CONFIG_KDB=y). If you have a serial or ethernet connection to another machine, you can also use kgdb from the other machine. The starting point for further Linux kernel debugging information is here.
Hope this helps, Nominal Animal
Last edited by Nominal Animal; 03-21-2011 at 06:09 AM.
|
|
|
01-23-2011, 12:54 AM
|
#3
|
LQ Newbie
Registered: May 2009
Posts: 25
Original Poster
Rep:
|
Dear Nominal Animal,
Thanks for the information, you have provided.But All this I knew earlier.I asked how to take base level structure pointers under our control to perform desired task ?
If you knew please help me in this regard.
Ankur
|
|
|
01-23-2011, 04:32 AM
|
#4
|
Senior Member
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
|
Quote:
Originally Posted by ankur0921
Now my question is even in kernel mode we do not have some mechanism by which we can get access to pointer of these structures.We have some macro.
If I want to manipulate structure on my on way, or performing some more operation defined by me.
|
I don't really understand what you mean; a macro is a perfectly useful mechanism. I assume you have read Documentation/kdb.mm (part of KDB patches), which describes how to access those structures using KDB. There may be ready-made KDB "packages" (macros for KDB) that let you access the structures in an easier manner, but in any case, you can unravel the kernel macros yourself and do the necessary accesses directly yourself.
One way you can unravel the kernel access macros and inline functions is to write a small test function, and compile it to symbolic assembly in the kernel tree.
Perhaps you can give a more detailed description on what you actually want to accomplish?
Nominal Animal
Last edited by Nominal Animal; 03-21-2011 at 06:01 AM.
|
|
|
01-26-2011, 12:53 AM
|
#5
|
LQ Newbie
Registered: May 2009
Posts: 25
Original Poster
Rep:
|
Dear Nominal Animal,
I am struggling with the installation of KDB with Fedora Core 5.In fact I am not getting the proper documentation of KDB.Even stated on the sgi website or stated by you.It would be a great help if you can provide me the link of documentation you have stated.Or it you have some good documents, please do the great favor by mailing me at smile.ankur@gmail.com.
It would be a great help in my work.
Thanks and Regards.
Ankur
|
|
|
All times are GMT -5. The time now is 08:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|