Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2004
    Posts
    26

    How do i read a .o file?


    Hello,
    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?

    Regards,
    Shivanu

  2. #2
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496

    Re: How do i read a .o file?

    Quote Originally Posted by shivanu
    Hello,
    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?

    Regards,
    Shivanu
    As far as I know, you can't read .o files. They're compiled object files which I believe are used by applications to build modules for your kernel.
    Registered Linux user #270181
    TechieMoe's Tech Rants

  3. #3
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    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 anyway
    The Unforgiven
    Registered Linux User #358564

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •