IRC channel logs
2025-03-28.log
back to list of logs
<oriansj>gtker: Knight uses HALCODE which the kernel is able to define effectively an interrupt table. Which when userspace executes a HALCODE instruction it jumps to the address stored in that index in that table. So for the sake of simplicity, I defined all Linux HALCODE numbers to be identical to the AMD64 ABI (with the difference being the number AMD64 would put into RAX would be the number in the HALCODE immediate field, RDI => R0, RSI => <oriansj>R1, RDX => R2, R10 => R3, R8 => R4, R9 => R5) <oriansj>I only defined a subset in the VM but I can easily add more <oriansj>There is also a subset that the kernel can't use (10 xx xx => FF FF FF) as they are reserved for the hardware, bootloader and hypervisor <oriansj>but 256K possible kernel HALCODE is more than plenty to support Linux's full set of syscalls <oriansj>(The original hardware only supported 64 kernel entries with the rest being reserved for future expansion and some references that only those in high memory being able to directly interact with hardware) <oriansj>which means there is no way to pass the syscall number to a function to execute. The function already has to have the syscall number embedded in the HALCODE as program memory is READ-EXECUTE no WRITE and HEAP/STACK space is READ-WRITE but no EXCECUTE <oriansj>(Makes FORTHs a bit of a problem for Knight but Lisp, C and assembly map nicely) <agg1>reading along, Knight was mentioned on several occasions before, and now HALCODE. simple question, out of curiosity, what is this? <oriansj>aggi: Knight is a CPU architecture that died young and I thought was neat, so I created a VM from what documentation I could find and used it as one of the targets for stage0 <oriansj>It has no stack or conditional registers; it has weird skip instructions and other odd details <agg1>thanks oriansj; i suspect knight ISA shouldn't be confused with Intel(R) knights architecture <agg1>otherwise i couldn't find reference online that mentioned a historical knights ISA <oriansj>correct, nor the Knight Lisp machines nor the British Knight system (There are a bunch of things in computing with the name Knight) <deesix>Where's that documentation you found? <oriansj>deesix: a copy of all that I found is in the stage0 repo. (I had to guess at opcode encoding as that information isn't available) <deesix>oriansj, I mean the original sources of that information. <matrix_bridge><Andrius Štikonas> deesix: in some old computing journal if I recall correctly <deesix>That's kind of vague. I'm hoping for precise references. <LaurentH>Is it possible that the mirrors and source on live-bootstrap/main are out of sync? I wasn't able to pull all the dependencies from the 2 mirrors and some of the hashes don't match <oriansj>deesix: well it is hard to reliably recall where one got information from over a decade ago. <stikonas>LaurentH: I've just re-ran mirror.sh on my mirror, it downloaded a few files <stikonas>as for knight, it probably doesn't matter now <stikonas>that company was long dead before the internet <stikonas>you could just as well assume that oriansj invented all the opcodes there