Amongst the first sentences...<p>> 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.<p>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! That way even if I brick it I didn't waste too much money".<p>Turns out the Raspberry Pi (and I'm guessing many other systems) are pretty confusing to understand at boot time. For one, it's the GPU that actually does the initial boot process, and much of that is hard to find good info on. (<a href="https://raspberrypi.stackexchange.com/questions/14862/why-does-the-raspberry-pis-gpu-control-the-first-stages-of-the-boot-process" rel="nofollow">https://raspberrypi.stackexchange.com/questions/14862/why-do...</a>)<p>I spent many many hours reading various specs & docs and watching tons of low-level YouTube videos. Compared to software development higher up the stack (my usual area), I found the material surprisingly sparse and poor for the most part. (Maybe that's reflective of the size of the audience and the value in producing it).
Ben Eater's fantastic video series on building a breadboard 6502 based computer and an 8-bit breadboard computer from scratch might be appreciated in this thread.<p>6502 playlist: <a href="https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBypFbtuVMUVXNR0z1mu7dp7eH">https://www.youtube.com/watch?v=LnzuMJLZRdU&list=PLowKtXNTBy...</a><p>8-bit build playlist: <a href="https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBypGqImE405J2565dvjafglHU">https://www.youtube.com/watch?v=HyznrdDSSGM&list=PLowKtXNTBy...</a><p>He also sells kits if one is interested in playing along.
If anyone is interested in what happens with an older CPU, I've written up how the IBM 1401 from 1959 starts up: <a href="https://www.righto.com/2021/02/an-ibm-1401-mainframe-computer-at.html" rel="nofollow">https://www.righto.com/2021/02/an-ibm-1401-mainframe-compute...</a><p>Among other things, since it uses magnetic core memory, you can run the program that was loaded when you shut it off.
> The Z80's system, although simpler, creates a "hole" in the memory, because the bottom of the memory space is used by ROM and therefore you cannot use the beginning of the memory space for normal RAM work.<p>Gameboy 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!<p>> On some computer platforms, the instruction pointer is called the "program counter", inexplicably abbreviated "PG"<p>Typo, maybe? Typically it’s called “pc”.
> Regardless of where the CPU begins getting its instructions, the beginning
point should always be somewhere in a ROM chip. The computer needs startup
instructions to perform basic hardware checking and preparation, and these
are contained in a ROM chip on the motherboard called the BIOS. This is where
any computer begins executing its code when it is turned on.<p>I can't see any date on this, but this is a bit antiquated. For security and reliability, modern CPUs have an on-chip ROM, which is executed first. That on-chip ROM will tend do basic things like check clock, power, memory etc. Once that's complete it will then securely load firmware from the motherboard flash. Even modern cheapo microcontrollers are shipping with on-chip ROM these days.
"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.
Is it me or the article seems incomplete? It kinda finishes for me after:<p>> The following are the memory ranges you get with a 2-to-4 converter on an
8-bit address bus:<p>And that's it. It looks truncated, or incomplete :thinking:
> The memory chips respond by sending the contents of the selected
memory cell over the data bus to the CPU.<p>What does that ROM memory cell _physically look like_? How do we physically manipulate it to contain a 1 or a 0 (absence of something)?
Starting procedure on MOS6502 is not that simple as it is told in the article. It spends some 7 clocks on doing internal initialization and only then fetches address of first jump from reset vector (0xFFFC/0xFFFD). I find Ben Eater's series on building simple 8-bit breadboard computer using 6502 CPU very educating and entertaining.<p><a href="https://www.youtube.com/watch?v=HyznrdDSSGM">https://www.youtube.com/watch?v=HyznrdDSSGM</a>
One route to understanding how CPUs work is to explore the computers that have been made in cellular automata. Golly (<a href="https://golly.sourceforge.net/" rel="nofollow">https://golly.sourceforge.net/</a>) has several, including one by John von Neumann, one by Edgar Codd and another by John Devore. The advantage of course is that the physics is trivial and you can see everything that happens and step backwards and forwards.<p>Example:<p><a href="https://timhutton.github.io/2010/03/10/30984.html" rel="nofollow">https://timhutton.github.io/2010/03/10/30984.html</a><p><a href="https://github.com/GollyGang/ruletablerepository/wiki/CoddsDesign">https://github.com/GollyGang/ruletablerepository/wiki/CoddsD...</a>
> This is because when the power
supply is first powering up, even if it only takes a second or two, the CPU
has already received "dirty" power, because the power supply was building up
a steady stream of electricity. Digital logic chips like CPUs require precise
voltages, and they get confused if they receive something outside their
intended voltage range.<p>This is only partially true. When digital chips boot up, gate outputs are in an indeterminate state. The reset sets them to know initial (and valid) values/bits.
Could anybody clarify for me the purpose of the NOP opcode that the article refers to? I would think that something like a "do nothing" instruction would want to be optimized away as much as possible, but maybe there's some hidden facet of the instruction protocol I'm not familiar with that necessitates it?
It describes old 8-bit machines.
New machines start by executing instructions firmware ROM or in cache memory before RAM is tested and initialized.<p>Additionally the reset registers differ by the platform.
(Some platforms expect software to initialize and reset some registers.)
A tangent, but I thought worth mentioning:<p>If you like this sort of plain text technical document, you might enjoy browsing the net with Gopher.<p>I recommend Gopherus[0] as a modern implementation that's cross-platform.<p>0. <a href="https://gopherus.sourceforge.net/" rel="nofollow">https://gopherus.sourceforge.net/</a>
I think this is traditional for this topic: <a href="https://nandgame.com/" rel="nofollow">https://nandgame.com/</a><p>Say goodbye to a couple hours!