how is the loading of an exe or com file is done in,
lets say, dos ?
thanks
loading of an exe or com
Re:loading of an exe or com
DOS loads the executable file from disk into memory, then performrms the execution of the app code via a jmp instruction.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:loading of an exe or com
i would suggest you to read the "loader and linkers" online book (check the recommended reading sticky thread
But *very* basically,
But *very* basically,
Code: Select all
int (run*)(void);
void* com=alloc(file_size("program.com"));
file_map(com,"program.com");
run=com;
return run();
Re:loading of an exe or com
well, DOS calls the BIOS to load sectors from the disk into memory, (bios int 13). then transfering processes execution with a jmp instruction to the location in memory where DOS told the bios to put the program. it dose't get any more simple than that.
Re:loading of an exe or com
Hi !
First u must Load the File into Memory and then Jump to its Start, the rest makes the File
First u must Load the File into Memory and then Jump to its Start, the rest makes the File
Re:loading of an exe or com
i look at a file as a chunk of memory that isnt accessible until put into memory. it can be code or data.