r/AskComputerScience • u/Successful_Box_1007 • Dec 01 '24
How does Bios Transfer access, read, and transfer entire OS in ROM quickly enough to RAM where it’s better to do this than just keep OS in the slower-accessible ROM?
Hi everybody,
A bit confused about something: How does Bios Transfer access, read, and transfer entire OS in ROM quickly enough to RAM where it’s better to do this than just keep OS in the slower-accessible ROM?
Thanks so much!
5
Upvotes
View all comments
Show parent comment
2
u/ElevatorGuy85 Dec 08 '24
The program counter (PC) should be well-explained in the Intel 8080/8085 manual that I gave you the link for. I encourage you to read that manual!!!
Think of the PC as a special purpose register that tells the CPU the address in memory where it should fetch the next instruction from. Every time an instruction is executed, the PC will be updated. Some CPUs give the PC another name, e.g. on the 8088 used on the early IBM PCs, it was called the Instruction Pointer (IP), but in that case there was a second register call the Code Segment (CS) that was also used because of the so-called “segmented” memory model that the 8088 adopted. So it was a combination of the CS and IP that determined the address. Later Intel processors adopted a “flat” memory model and used Extended Instruction Pointer (EIP) instead. The most important thing, regardless of what professor manufactures call it, is that there is some sort of analogous register (or combination of registers) that tell the CPU where to fetch the next instruction from.
A “reset vector” is just a memory location that the CPU will read the contents from in order to know what memory location it will load into the Program Counter (PC) when it first starts up (from a power-on or reset event). There are some variations on this concept, but the basic purpose is the same, i.e. provide a way for a CPU to know where it should start executing instructions from after some event occurs, whether that’s a reset, or an interrupt, or handling an exception situation like a divide-by-zero, etc.
Google is your friend! But again, starting to grasp these concepts on a “simple” older 8-bit CPU is often helpful in understanding the same concept on a far-more-complex 32 or 64-bit modern CPU.