Octocontrabass wrote:
There's no way I could tell what's going on without seeing either your code or the rest of the contents of the registers struct.
Although I did spot this mistake. (It's not causing any issues right now because the stack is already aligned due to the number of things you push, but that should be RSP instead of R12.)
Ah. That's what I get for having GitHub copilot installed. Well that's fixed now. And I also realized one of the potential causes literally 5 minutes after I went to bed yesterday: My handler doesn't actually yet fix the interrupt number by adding the 127 back to it that was used previously for proper alignment.
UPDATE: After some tinkering I think I got the real interrupt number (still doesn't make sense though, as from what I can find it seems to be a DOS specific interrupt??.....), 0x20.
UPDATE 2: I still simply can't figure out what that interrupt is supposed to be. I'm going to comment out the code that panic's for an unknown interrupt and just simply run the generic handler that should handle the majority of interrupts.
UPDATE 3: After removing that piece of code. It seems like it just goes to a black screen and jumps to some junk code (somehow doesn't crash although it is an inf loop) pushing the current code now. Although: I currently can't test it, I'm at school. But I do have a link back to the PC with the code. So I can make any edits now. But I won't be able to test them for at least a few more hours.
Also something: I'm not entirely sure that the regs stuct is coming through perfectly unscathed. Some of the values seem rather busted (e.g. the RDI register should at the time of the panic contain the address of the "message" variable (so it should start with some 0xF's), however it seems rather random.)