Quote:
How much data are you dynamically allocating, anyway? That's an unusually large stack for a kernel.
The memory allocator is currently set to be able to allocate up to 2kb of memory but I think with the testing stuff set up and all it only uses around 290 bytes of that by the time it lets you type in keyboard input. The stack was already at 0x6FFF or something and while the stack never goes more than FFF deep in bochs, I found through random trial and error that moving it somewhere else made it work better on real hardware for some reason.
Quote:
Are you switching between real mode and protected mode? Have you enabled the A20 line? Do you have exception handlers?
I only switch from real mode to protected mode once and that happens it stays in protected mode. I'm not enabling the A20 line via the 8042 controller. I keep toggling on and off my code for enabling A20 via port 0x92 but it doesn't make a difference in reliability. My system doesn't actually use more than 1mb of memory or read or write anything to high memory (at least if it is, its not supposed to be).
I definitely don't have exception handlers or interrupts of any kind. Maybe I should.
Quote:
Your cross-compiler shouldn't provide any files named io.h. Are you sure you're using the right kind of cross-compiler?
Am I
sure I'm using the right kind? Short answer: no. I have a folder called "include" which has a bunch of header files. When I use "#include <sys/io.h>" with the corss compiler, it references an io.h from there. I can't actually remember but I'm pretty sure I made this one more or less by following the osdev tutorial. I did try several different methods of getting a cross compiler though and I might be misremembering things as i've been working on this on and off for quite a long time.
It turned out this project was on github the entire time with the last commit being august 2022 and I just forgot it was there.