Load "exe"
RE:Load
Here is a simplified order of events to executing a binary:
You need to load the binary header and binary itself into memory (possibly in different locations, as the header is no longer needed after the binary has begun execution, and can be discarded).
Prepare any OS specific application environment things, such as the apps ldt and page tables. At this point, you may also set up a TSS for the task.
Parse the binary header to determine relocations, etc, so that you can link your binary with any libraries and external dependancies.
Once all these relocations have been resolved, you can finally jump to the binary's entry point (also defined in the binary header). There are many different methods to actually jump to the binary (jump to tss, "fudge" the stack and ret, simply jump, etc)... no matter what method you choose, make sure that the registers are set to the proper application descriptors.
Cheers,
Jeff
You need to load the binary header and binary itself into memory (possibly in different locations, as the header is no longer needed after the binary has begun execution, and can be discarded).
Prepare any OS specific application environment things, such as the apps ldt and page tables. At this point, you may also set up a TSS for the task.
Parse the binary header to determine relocations, etc, so that you can link your binary with any libraries and external dependancies.
Once all these relocations have been resolved, you can finally jump to the binary's entry point (also defined in the binary header). There are many different methods to actually jump to the binary (jump to tss, "fudge" the stack and ret, simply jump, etc)... no matter what method you choose, make sure that the registers are set to the proper application descriptors.
Cheers,
Jeff
RE:Load
i do not know about .elf, but i have seen some tutorial about how to load a .exe... make a search..
then of course u have to make sure that the exe don´t make a call to some INT 21h service that dosn´t exist in your os.. =)
then of course u have to make sure that the exe don´t make a call to some INT 21h service that dosn´t exist in your os.. =)