← Back to context

Comment by medbar

1 month ago

Gladly! Since my last comment I added sound support through an ac97 driver. It was fairly straightforward in hindsight, only had an issue with the interrupt not being handled - turns out my ISR stubs weren't fleshed out to handle IRQs, just the cpu exceptions. Also had a minor bug where addresses outside of the kernel weren't getting translated properly, which I hadn't tested before and assumed to be correct.

I probably could have saved myself 2+ hours of debugging if I had simply stopped working off of assumptions that my driver code was wrong (it was, but that just took reading the spec and checking out some drivers for reference) and doing a root cause analysis with `objdump` or through QEMU. Still surprised how far you can go with vanilla debugging prints - when I started this project, I was sure that I'd become fluent in gdb as a byproduct, but I stopped using it once it would break when the stack became corrupted and haven't tried it since.

Discussion is the reason I made the jump from lurking to having an account on HN. Happy to talk - reached out to you on twitter. And good luck to you as well :^)