How does the CPU get to the BIOS right after boot?

Asked 1 years ago, Updated 1 years ago, 113 views

To run the BIOS program immediately after boot, you must boot to the BIOS ROM address 0xffff0.AMD and Intel specifications say so, but I am not convinced.I'm not convinced because it doesn't describe the process from issuing the initial CPU signal to running BIOS 0xffff0.Can someone tell me what's going on in the meantime?

In my own opinion, I thought about going to the BIOS with in and out instructions, but that would reduce security and performance.I thought about a dedicated circuit that connects directly from the CPU to the BIOS, but I wondered why it is possible to load bios updates and ROM contents from the os of Linux and Windows.I thought the above two patterns were not......
It's sad that I can't play with the BIOS.

x86 bios

2022-09-30 19:41

2 Answers

I'm not convinced because it doesn't describe the process from issuing the initial CPU signal to running BIOS 0xffff0.Can someone tell me what's going on in the meantime?

Nothing has happened.IA-32 Intel Architecture Software Developer's Manual Volume 2: The System Programming Guide reads:

9.1.Initialization Overview

A first instruction to be executed after fetching after hardware reset is arranged at a physical address FFFFFFF0H.This address is located 16 bytes below the physical address at the top of the processor.The EPROM that stores the software initialization code must be located at this address.

It is as explained.The CPU is designed to execute instructions for the physical address FFFFFFF0H in case of a hardware reset.Therefore, the PC manufacturer must place the BIOS code at this address.
(I wrote 000FFFF0H in the comment, but this was old with knowledge around 486)

See Book 9.1 for Hardware Reset.

After power up or after the RESET# pin has been asserted, each processor on the system bus initializes its own hardware (called a hardware reset),

is described as

From Kunif's comment

This information system management mode - Wikipedia makes sense, but only Intel and x86 compatible CPU developers can and need to know it.

That's not the case.The example System Management Mode (SMM) is also described in Chapter 13 of the book, System Management.Certain information is public.

The CPU initialization part of the main topic is also

After a hardware reset, when a new value is first loaded into the CS register, the processor follows the usual rules applied to address translation in real address mode (that is, [CS Base Address = CS Segment Selector ]16]. Do not put far jumps or far calls in the code to ensure that the base address in the CS register is not changed until the EPROM-based software initialization code is completed.

These are detailed to a level that is not too much of a common sense, and specific code examples such as 9.10. Examples of initialization and mode switching are also provided.

A questioner who claims to have read these comments says, "What I don't understand is that the process from issuing the initial CPU signal to running the BIOS 0xffff0 is not written," but honestly, I don't know what I'm not satisfied with.


2022-09-30 19:41

The CPU has a register called a program counter or instruction pointer.
This indicates the address of the currently executing instruction.After executing the currently executing instruction, the address of the program counter is changed to the address of the next instruction, and the instruction is read out of memory and executed according to the value.This will cause the program to run again.
The program counter value is the address of the next instruction if the instruction is not a jump instruction or the like, but in the case of a jump instruction, it is the address of the jump destination.
The program runs immediately after the reset, but immediately after the reset, the program counter value becomes a specific value.
This depends on the type of CPU, but for x86, it is 0xffff0.
Therefore, the first instruction to be executed must be 0xffff0.
In other words, we're not doing anything special right after the reset, we're just executing instructions for the address indicated by the program counter.
The program counter values immediately after the reset may be 0 or 0 addresses, depending on the CPU.
Operating systems such as Linux and Windows are typically stored in storage and run from storage to memory.The memory in this case must be rewriteable RAM, but the instructions immediately after the reset must be nonvolatile memory (ROM) because the contents are indeterminate in RAM.


2022-09-30 19:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.