3

I have read that at startup, the CPU program counter register is filled with F000.

I thought that:

PC registers contain the next instruction address.
This address is send to the address bus and value return to the data bus

Does the address bus only deal with RAM? Obviously the BIOS isn't stored in RAM.

So how does F000 target the ROM to start BIOS execution?

3 Answers 3

12

At power on, the chipset maps the reset vector (0xffff0) to the BIOS ROM. The CPU executes instructions directly off the ROM part using a technique called Execute in Place (XIP). Next, the BIOS can utilize the processor's L2 cache as if it were RAM using a technique called "No Evict Mode", or "Cache-as-RAM". Finally, main system RAM is initialized and an operating system can be loaded. For more information:

https://en.wikipedia.org/wiki/Reset_vector
https://en.wikipedia.org/wiki/Execute_in_place

Beyond BIOS
Intel® 64 and IA-32 Architectures Software Developer Manuals

2
  • this is exactly what I want to know. Can you suggest me a good book covering that low level struff please Commented Mar 17, 2014 at 21:22
  • added a few more links Commented Mar 18, 2014 at 2:55
3

Different CPUs have different start address. Many have 0000 as the start address. The BIOS ROM, RAM and other peripherals (e.g. serial port) are all attached to the processor bus. The BIOS ROM contains the startup instructions which the CPU executes on startup. When programs have been loaded into the RAM, the BIOS directs CPU to start executing instructions from the RAM.

3

The addresses are used for more than just volatile RAM.

A 32-bit CPU can address up to 4 billion memory addresses (4 GB). If you buy 4 GB of RAM, your OS may only report that you have 3.5 GB because ~600 million addresses are needed for other hardware like the BIOS. http://blog.codinghorror.com/dude-wheres-my-4-gigabytes-of-ram/

When the CPU starts up and is told to grab the next instruction in address x, it doesn't know or care that x is mapped to BIOS memory rather than volatile memory. It will follow the same process of fetch, decode, execute.

3
  • "wasting some of your money" is a bit narrow-minded, don't you think?
    – jiggunjer
    Commented Oct 3, 2016 at 4:52
  • @jiggunjer One definition of waste is "not used or in use". left over or superfluous." It's a fact that some of the memory you purchased is unusable. This is not to mean that your entire purchase is a waste, it wasn't a good deal or you are stupid for buying 4 GB. I've removed that part since it has nothing to do with the point I'm making.
    – Despertar
    Commented Oct 9, 2016 at 23:04
  • It is also a fact that unusable memory is not the same as unused memory. It is used.
    – jiggunjer
    Commented Oct 10, 2016 at 8:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.