Find the answer to your Linux question:
Results 1 to 8 of 8
Hi! I'm just an IT student, I'm working on a project and I need a little bit more knowledge about how files get executed in the kernel, I found something ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    7

    binfmt and binary execution!


    Hi!

    I'm just an IT student, I'm working on a project and I need a little bit more knowledge about how files get executed in the kernel,

    I found something about the binfmt but mostly on wrapper rather than real binary loaders (like a.out and elf).

    I'm trying (unsuccessfully) to figure out exactly in which file the binary is loaded in to the memory, the only kzalloc I found is located in the do_exec() from exec.c but it should refer at the initialization of the struct linux_binprm, so it loads the file references on the memory, but not the file itself.


    I'm sorry if my question isn't clear, summarizing, I would like to have more accurate information about how binary are loaded and executed by exec.c.


    thank you

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    Terms of use for these forums precludes helping people with school work. I have to think that your class provides the necessary resources and references to address these issues.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    7
    Quote Originally Posted by Rubberman View Post
    Terms of use for these forums precludes helping people with school work. I have to think that your class provides the necessary resources and references to address these issues.
    What??
    Ok, maybe, my fault, I try to explain it better, this is NOT a simple "school work", this is something that I need for my degree thesis,

    I'm working on a project that involve the execution of a binary that's already in the ram, so I have to figure out how to put in the kernel memory and execute it. My tutor don't even know if it's possible to make the entire project work, no one gave me the "necessary resources" just because it's not something you do on a lecture... it's implied that I have search other sources of knowledge...

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    That's the thing about a graduate thesis, the work is supposed to be "original", or an original/novel approach to solve an existing problem in your domain. In any case, visit and spend some quality time on these two web sites:

    The Linux Kernel Archives
    The Linux Documentation Project
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    Mar 2010
    Posts
    7
    I'm NOT looking for the solution itself, if that's what you understood, I'm sorry, my english isn't so good , I'm just asking if anyone got good documentation about binary formats handling and, more precisely, on how they got loaded into the ram at the execution time (when the right handler has been located).

    Of course I already have the kernel sources, and I also visited tlpd site, but I haven't found any detailed information. I'm still looking around on tlpd, but I'm always looking for new sources of information about that.

    Anyhow, thank you for your replies!

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    Yeah. Finding definitive information on these processes (loading & executing a process file) is difficult to find. It all starts with the sys_clone() kernel call. I think you are going to need to read these pages:

    Linux Kernel 2.4 Internals: Process and Interrupt Management
    man 2 clone

    Also, you are going to need to spend a considerable amount of time reading/understanding the related kernel code. Sorry I don't know enough to say more - this is something I need to do myself as well. Perhaps it is an opportunity for a new Understanding The Linux Kernel book?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    I still haven't found the info you want, but some more searching is telling me that the means of doing this are likely in the ld-linux.so shared library, so the source for that should give you what you want.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Just Joined!
    Join Date
    Mar 2010
    Posts
    7
    thank you RubberMan!!

Posting Permissions

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