Page 1 of 1

BIOS code execution

Posted: Fri Sep 07, 2007 7:04 pm
by sid_007
Hi,

When the processor starts the bootstrap procedure reading from the BIOS, does the code from the BIOS flow through the memory hierarchy, that is, the main memory (DRAM), and caches, or the processor has an ability to read instructions directly from the ROM, if so how ?

Thanks in advance

Posted: Sat Sep 08, 2007 9:27 am
by cp
the processor reads the first instructions directly from the rom. this is nothing special since the rom consists of addresses and data, too. the only difference between ram and bios is that no values can be saved in the bios address area. after the first few instructions which initialize the chipset and thus the ram, the bios is decrunched to main memory.
on startup the only memory hierarchy are the processor registers (maybe L1 caches) and the bios eprom.

Posted: Sun Sep 09, 2007 4:45 am
by sid_007
Thanks for the reply, does the copying of BIOS to DRAM happen always or only when the ROM shadowing option is turned ON. Thanks again

Posted: Sun Sep 09, 2007 12:56 pm
by cp
since most - if not all - mainboard bios use compressed code, they have to be decrunched to memory. otherwise execution wouldn't be possible. this is the reason why compressed bioses will automaticaly be shadowed.
but if you load a modern OS (Linux, Windows NT/2K/XP/VISTA), the bios doesn't play any role at all because none of those OS uses bios calls or uses any data provided by the bios (except some acpi stuff maybe).