3 ms·
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 relat
by Sir_Cmpwn 9y ago
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/master/src/00/restarts.asm#L1-L62 https://github.com/KnightOS/kernel/blob/master/src/00/restar...