A silly noobish question about executables
Posted: Sat Dec 10, 2011 9:56 am
Hello. Dis is just what the topic title says. Also can be translated as "how do i make an API for coding my OS' software".
So, if, say, i have a simple monotasking operating system running in kernel mode with some filesystem support that includes tools for reading an executable format (ELF, for example) and other files, so how do i actually "execute" them? Load the executable into memory, store the current EIP position, then move it to the start of executable in memory, and when that new program finishes, it calls some function that restores previous EIP position? How do i call previously declared kernel functions then? Jumping the EIP back'n'forth? So that when writing software for my OS, i need to reference these functions by corresponding addresses in memory?
Eh, i know, this might sound idiotic.
So, if, say, i have a simple monotasking operating system running in kernel mode with some filesystem support that includes tools for reading an executable format (ELF, for example) and other files, so how do i actually "execute" them? Load the executable into memory, store the current EIP position, then move it to the start of executable in memory, and when that new program finishes, it calls some function that restores previous EIP position? How do i call previously declared kernel functions then? Jumping the EIP back'n'forth? So that when writing software for my OS, i need to reference these functions by corresponding addresses in memory?
Eh, i know, this might sound idiotic.