How can I load a program in the memory and jump to it?
I need some assembler source code.
Loading programs
RE:Loading programs
I think you missed the sarcasm
Such a task is different from OS to OS, and since you're writting your own OS, it's _impossible_ for us to _tell_ you how do load a program.
Essentially, most OSs do the following:
find the binary file without your file system
parse the binary file's header to find information about this program (size, linkage info, etc)
load the appropriate sectors into newly allocated memory
perform any dynamic linking necessary (ie, like Win32 dll's, and Linux so's)
jump to the program's entry point (also, usually, specified in the header)
That's it.
Jeff
Such a task is different from OS to OS, and since you're writting your own OS, it's _impossible_ for us to _tell_ you how do load a program.
Essentially, most OSs do the following:
find the binary file without your file system
parse the binary file's header to find information about this program (size, linkage info, etc)
load the appropriate sectors into newly allocated memory
perform any dynamic linking necessary (ie, like Win32 dll's, and Linux so's)
jump to the program's entry point (also, usually, specified in the header)
That's it.
Jeff
RE:Loading programs
IF it helps any, there is an excellent book on the subject, _Linkers and Loaders_ by John Levine, which you might want to pick up or borrow (many college libraries will have it). An early draft of the book, with some serious errata, is available at the book's website (http://linker.iecc.com/), but the final published version is substantially better IMO.