0xffff0 and BIOS

When the computer first boots up, it starts running at the physical address 0xffff0. This address contains the jmp instruction for the BIOS.

Now for my question, I always assume that the physical addresses are displayed in RAM. If RAM initially contains garbage values, what exactly puts the jmp command at 0xffff0? Is the jmp command always the same or different from different BIOS? Then it displays 0xffff0 from RAM to BIOS (what does it mean to be hard-coded)?

+7
memory boot bios
source share
4 answers

The top 64kB or so are displayed in the BIOS ROM, not RAM.

+19
source share

See the PC boot sequence . As Ignacio already answered, he is "hard-coded" into read-only memory.

+5
source share

Check out this Intel manual:

http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-3a-part-1-manual.pdf

Go to page 9-6 and subsequent pages, all of which describe the initial CPU startup mode. The first command is taken from ffffff00 (which was connected to the BIOS ROM):

The first instruction that is fetched and executed following a hardware reset is located at physical address FFFFFFF0H. This address is 16 bytes below the processor's uppermost physical address. The EPROM containing the software- initialization code must be located at this address. 

And remembering that at this stage he is still in realmode mode:

 The CS register has two parts: the visible segment selector part and the hidden base address part. In real-address mode, the base address is normally formed by shifting the 16-bit segment selector value 4 bits to the left to produce a 20-bit base address. However, during a hardware reset, the segment selector in the CS register is loaded with F000H and the base address is loaded with FFFF0000H. The starting address is thus formed by adding the base address to the value in the EIP register (that is, FFFF0000 + FFF0H = FFFFFFF0H). 

And then look further, in Figure 9-3, the 64K memory location is from ffffffff to ffff0000 and it is indicated that there is an EPROM or system biography, and therefore not RAM.

+4
source share

Actually, this is a little more complicated. First of all, on any processor with 386, it actually starts with fffffff0 (i.e., 16 bytes less than the top of the 32-bit address space). Until the processor first executes the long jump command, it makes some special mapping to display the entire 32-bit address space, even if it is running in real mode. After the big jump is performed, it launches the β€œnormal” real mode.

In any case, on the hardware side, you usually have a (Flash) ROM mapped to this location, so when it starts executing, it executes the code in ROM. To begin with, this is actually not a BIOS, but it's just code to unpack a real BIOS from ROM to RAM, and then reformat this RAM to the BIOS address range.

+3
source share

All Articles