Results 1 to 3 of 3
Thread: How do i read a .o file?
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Sep 2004
How do i read a .o file?
I am trying to look into the Linux kernel and see how Linux reads the CPU Information, etc. The kernel has these files with .o extension. Was wondering how to read them, if possible?
Re: How do i read a .o file?Originally Posted by shivanuRegistered Linux user #270181
TechieMoe's Tech Rants
- Join Date
- Oct 2004
If you're talking about finding out how the code in .o file works (kind of reverse-compiling) then, it's not possible - at least I don't know how to do it. You can disassemble the file though producing the assembly code from the file. But, you can still find out a lot of useful information about the .o file using the program objdump. If the .o file is an ELF executable, you can even try out readelf.
Now, coming to the main purpose of your exercise, linux won't simply allow that. Finding out how kernel works while it is running is not possible because linux is a protected-mode operating system - which means that the normal user programs do not have access to any kernel-level data structures. The kernel functionality is to be called from user programs using well-defined ways (system calls).
The best way to find that out is to check the kernel source code itself - which is freely available anywayThe Unforgiven
Registered Linux User #358564