Loading from Hard Disk to Ram

I was wondering how exactly programs and such are loaded into memory. As in, does the OS read byte for byte from the hard drive, and sequentially load bytes into memory? Also, in order to communicate with memory could you use an in instruction with a port to memory...sounds completely wrong, but, not sure how it works and can't find any info about it. I don't need a detailed explanation, just a simple one to help me in the right direction if anybody can help.
Thanks!

Comments

  • [b][red]This message was edited by AsmGuru62 at 2003-10-8 6:25:10[/red][/b][hr]
    : I was wondering how exactly programs and such are loaded into memory. As in, does the OS read byte for byte from the hard drive, and sequentially load bytes into memory? Also, in order to communicate with memory could you use an in instruction with a port to memory...sounds completely wrong, but, not sure how it works and can't find any info about it. I don't need a detailed explanation, just a simple one to help me in the right direction if anybody can help.
    : Thanks!
    :
    [blue]EXE files have predefined format, which is known to operating system. Of course, the file is loaded byte-by-byte, but because hardware talks not with a single bytes but with a clusters of bytes, so the hard drive access will be faster. After the loading - system does some adjustments to the file already in memory, like table of relocations, etc. - and then again system loads the address of a first CPU instruction of that EXE into CS:(E)IP and it is done! The code now runs starting from that point.[/blue]


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion