I thought it started by executing microcode from ROM.
What happens when a CPU starts
61–70 of 133 posts
Re: What happens when a CPU starts
#62"It starts at 0 and executes instructions" is a funny, but mostly true way to express this. Some people are shocked that no magic happens before the instructions start.
This is pretty old. There's quite a lot that happens before instructions start on modern CPUs. Just one small example: CPUs have many small SRAM arrays for micro-architecture features like branch predictors. Some of these need to be initialized after reset by a state machine that takes many cycles. I have even heard of a large chip that pushes initialization vectors through the scan chains so that all flops begin in…
Re: What happens when a CPU starts
#63Earlier quoted context omitted.
Yeah, more or less; mostly more. pusha/pushad is one of those instructions that sounded good, but isn't used much (it became invalid in amd64), windows will push the registers one at a time, and maybe FPU, MMX, SSE, etc registers; of course, that's a lot of extra pushing, so there's strategies to avoid it if the thread doesn't use them. If you switch to a different task, you're going to need to load its page tables,…
This seems wildly inefficient. Can’t we have multiple sets of registers? Not millions, but… Are registers expensive in hardware? Why not have loads of them?
Re: What happens when a CPU starts
#64Earlier quoted context omitted.
As early as the mid-70s, minicomputers started including microcontrollers to manage the boot environment. I had a Sun machine once that included what they called Lights Out Management. A little microcontroller that had control over the system power and etc. Always available via its dedicated serial port, even when the machine was shut off. Everything is like that now. A smartphone will have multiple processors. Some…
True. It's like what's happened with electronics, radio, video in that way. A solid grasp of the (always-present) basic components, and basic tech and design philosophy, goes a long way. It's like learning a language. So easily-understandable articles like this are essential for beginners, along with a short list of masterful books ( e.g. those by Forrest Mims, for electronics) and playing with physical components! T…
Re: What happens when a CPU starts
#65"It starts at 0 and executes instructions" is a funny, but mostly true way to express this. Some people are shocked that no magic happens before the instructions start.
If older CPUs have no magic, what is the 6502 doing here ( https://youtu.be/yl8vPW5hydQ?t=706 ) that causes it to put eb60 → ffff → eb60 → 01f7 → 01f6 → 01f5 on the address bus, before it actually reads from memory?
Re: What happens when a CPU starts
#66Earlier quoted context omitted.
writing programs for old game consoles, Oh yeah, like the Intellivision. particularly the Nintendo DS. Oh come on, the DS ain't that old.
Never done anything but I think the gameboy family is a good choice. Unlike NES or SNES which use assembly heavily, we can use C for the GBA. There are also great communities devoted for them.
Re: What happens when a CPU starts
#67Earlier quoted context omitted.
Yeah, more or less; mostly more. pusha/pushad is one of those instructions that sounded good, but isn't used much (it became invalid in amd64), windows will push the registers one at a time, and maybe FPU, MMX, SSE, etc registers; of course, that's a lot of extra pushing, so there's strategies to avoid it if the thread doesn't use them. If you switch to a different task, you're going to need to load its page tables,…
This seems wildly inefficient. Can’t we have multiple sets of registers? Not millions, but… Are registers expensive in hardware? Why not have loads of them?
Re: What happens when a CPU starts
#68Amongst the first sentences... > It may be thought of as what happens when a whole computer starts, since the CPU is the center of the computer and the place where the action begins. I thought that too. Last year I spent a while getting as low-level as I could and trying to understand how to write a boot loader, a kernel, learn about clocks and pins and interrupts, etc. I thought, "I know, I'll get a Raspberry Pi! Th…
Re: What happens when a CPU starts
#69Re: What happens when a CPU starts
#70Gameboy actually does a funny thing where the boot ROM gets mapped at the bottom of the address space, and then it writes to a MMIO address to unmap the ROM overlay and restore the first 256 bytes of the cartridge there instead. It’s quite amusing!
> On some computer platforms, the instruction pointer is called the "program counter", inexplicably abbreviated "PG"
Typo, maybe? Typically it’s called “pc”.