Live data from Hacker News

SymbOS: Graphical Z80 Multitasking Operating System

symbos.de

101–103 of 103 posts

Re: SymbOS: Graphical Z80 Multitasking Operating System

#101

Earlier quoted context omitted.

Wrote my own for 68xx and 65xx chips in ancient times. https://en.wikipedia.org/wiki/Relocation_(computing) If you have access to the symbol table it is an easy problem to solve, if you don't it can get quite difficult all the way to impossible if the original code makes use of tricks such as jumping into the middle of an instruction. But if the code is 'well behaved' then it can usually be done. Many games used tric…

For fun, I took a "happy medium" approach in KnightOS. Programs are written with RSTs (basically the z80 version of traps) next to each instruction with a relative address, then the kernel looks up the return address on the stack, partially decodes the next instruction, and then modifies the code in RAM to update the address to the correct one. It's basically just-in-time PIC. https://github.com/KnightOS/kernel/blob/…

Heh, that's cool. How do you remember which ones you've modified so you don't do it twice?

Re: SymbOS: Graphical Z80 Multitasking Operating System

#102

The Z80 will always have a place in my heart. Mostly because we used it in college to build a computer from scratch on a wire board. That was an awesome project, and one of the classes that I remember fondly from nearly 18 years ago.

Mine too, largely because it was the first computer I ever owned - the ZX Spectrum (48k), circa 1982.

One of the most popular home computers in the UK at the time, and with good reason.

Re: SymbOS: Graphical Z80 Multitasking Operating System

#103

Earlier quoted context omitted.

For fun, I took a "happy medium" approach in KnightOS. Programs are written with RSTs (basically the z80 version of traps) next to each instruction with a relative address, then the kernel looks up the return address on the stack, partially decodes the next instruction, and then modifies the code in RAM to update the address to the correct one. It's basically just-in-time PIC. https://github.com/KnightOS/kernel/blob/…

Heh, that's cool. How do you remember which ones you've modified so you don't do it twice?

It also modifies the reset (trap instruction) in place and makes it a no-op.
Post reply on HN