Live data from Hacker News

Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

nanochess.org

21–30 of 34 posts

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#21
How is the phrase "register window" not in this article? https://en.wikipedia.org/wiki/Register_window

"The AMD 29000 improved the design by allowing the windows to be of variable size, which helps utilization in the common case where fewer than eight registers are needed for a call. It also separated the registers into a global set of 64, and an additional 128 for the windows."

Amazing stuff. (Both the 29K and the article).

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#22
Great article! I remember reading about the Toledo family's computer systems ( http://www.biyubi.com/ ) years ago, but never saw any specifics so they were always shrouded in mystery to me. It's interesting reading about how you wrote the OS and seeing it run in an emulator. It's really impressive that you were able to write such a complex system in machine code.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#23

How is the phrase "register window" not in this article? https://en.wikipedia.org/wiki/Register_window "The AMD 29000 improved the design by allowing the windows to be of variable size, which helps utilization in the common case where fewer than eight registers are needed for a call. It also separated the registers into a global set of 64, and an additional 128 for the windows." Amazing stuff. (Both the 29K and the a…

The registers could also be partitioned into fixed sizes and protected, to allow for a banked register file that allowed for amazingly fast context switches in RTOS systems.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#24
post #23

How is the phrase "register window" not in this article? https://en.wikipedia.org/wiki/Register_window "The AMD 29000 improved the design by allowing the windows to be of variable size, which helps utilization in the common case where fewer than eight registers are needed for a call. It also separated the registers into a global set of 64, and an additional 128 for the windows." Amazing stuff. (Both the 29K and the a…

The registers could also be partitioned into fixed sizes and protected, to allow for a banked register file that allowed for amazingly fast context switches in RTOS systems.

Yes, I had an architecture professor that was a fan of it (and so your work, presumably!) It's the only way I'd encountered it, sadly.

That was back around 2000 at Loughborough in the UK.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#25
post #8

Wow, blast from the past! I was on the architecture / micro-architecture team for the 29K and 29050, and your story of writing and debugging the emulator brought up similar memories of working on the performance simulator for these chips. Very impressive work -- congratulations!

Wow! Thank you! The floating-point implementation in the Am29050 is really great as it ran in parallel with the integer unit. Sorry, I need to ask, maybe you don't remember. What happens if you write into gr2-gr63? Not really needed to know, but I've been curious the last 30 years.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#26

How is the phrase "register window" not in this article? https://en.wikipedia.org/wiki/Register_window "The AMD 29000 improved the design by allowing the windows to be of variable size, which helps utilization in the common case where fewer than eight registers are needed for a call. It also separated the registers into a global set of 64, and an additional 128 for the windows." Amazing stuff. (Both the 29K and the a…

There was so much stuff to cover but there's a slight mention saying " had to add the LOADM and STOREM instructions as these handle the spilling of local registers to memory when the register stack is full" I can add an extra explanation there.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#27
post #10

Writing a windowing OS straight in machine code for the Am29000 is wild. The emulator debugging story is the part I would love expanded.

The article ended so big for my own measures, but I'm glad to know you want more of my wall of text. Thank you!

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#28
post #17

Earlier quoted context omitted.

You might have heard of the x86 cpu the AMD K5 that competed against the Pentium? Well that was basically an am29000 but with an x86 instruction decoder front end. The architecture was that good it was competitive 10years later. Think of the am29000 as an incredibly influential research project that flowed into all of AMDs future CPUs in some way or another.

Wow, I wasn't aware of that either! I didn't have an AMD K5 PC, but (IIRC) a K6-III - did that still have the same underlying architecture?

No. AMD K5 did not have successors.

AMD bought the company NexGen and K6, K6-2 and K6-III were based on the NexGen design. I had been the happy owner of a K6-2, which did not have the integrated L2 cache of K6-III, but I had a friend who had bought earlier an AMD K5.

The K6 family also did not have successors, as Athlon had a very different microarchitecture, with a lot of inspiration from DEC Alpha.

The AMD K6 family of CPUs has the distinction of being one of the very few modern CPUs that are described in an entire book: "The anatomy of a high-performance microprocessor : a systems perspective" by Bruce Shriver.

I am not aware about any comparable description for any more recent CPU, because nowadays the companies have become much more secretive.

It is likely that the publication of many details about K6 was also approved because it was an architecture abandoned by AMD, as they focused on Athlon for their future (this was not yet known publicly when the book was launched, in 1998).

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#29

How is the phrase "register window" not in this article? https://en.wikipedia.org/wiki/Register_window "The AMD 29000 improved the design by allowing the windows to be of variable size, which helps utilization in the common case where fewer than eight registers are needed for a call. It also separated the registers into a global set of 64, and an additional 128 for the windows." Amazing stuff. (Both the 29K and the a…

There was so much stuff to cover but there's a slight mention saying " had to add the LOADM and STOREM instructions as these handle the spilling of local registers to memory when the register stack is full" I can add an extra explanation there.

It was more an expression of surprise than anything else. The defining feature of the 29K, when I was introduced to it at least, was what appeared to be an enormous register set and the way of dealing with the stack better than the SPARC equivalents.

The fact you got this stuff working at all is completely mind bending.

Re: Unearthing my 1996 windowed OS in machine code for Am29000 homebrew computer

#30
> The subtraction instruction has a set with reversed operands, so we have SUB, SUBU, SUBS, SUBC, SUBCU, SUBCS, but also SUBR, SUBRU, SUBRS, SUBRC, SUBRCU, SUBRCS.

Pretty much the only use of "reversed subtraction" instruction on a 3-operand machine is to implement NEG (subtract from immediate zero) and NOT (subtract from immediate -1, which Am29000 can't actually do since it zero-extends the immediates)... but NOT is usually not a very useful operation on its own anyway, especially when you have an actual ANDN instruction (most of the uses of ~ in C are of "var &= ~mask" or "expr & ~mask" variety) and a whole slew of NAND/NOR/XNOR instructions as well. Oh, and also, if you know for sure that your value is either 1 or 0, you can logically negate it by subtracting it from immediate 1.

On the other hand, on a 2-operand machine "SUBR reg, reg" is a surprisingly useful instruction.

> I made a phantom ROM that reads the disk using a special instruction coded in the emulator, and returns on unhandled services.

Really puts into perspective just how useful BIOS/UEFI utilities are, doesn't it? Just give me the device tree info (or the equivalent) and load the bloody OS image, thank you, that's all I need.

> I find fun how they implement the multiplication instruction using a trap and 32 continuous MUL instructions (bit-shifting all the way).

They did division the same way; I believe it was a done as a clever to have an interruptible MULTIPLY/DIVIDE instructions: otherwise, those 32-35 cycle beasts would need some special handling in the pipeline.

Post reply on HN