robert-w-gries / rxinu

Rust implementation of Xinu educational operating system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The first IRQ in the interrupts field is not the cascade interrupt.

toor opened this issue · comments

commented

Assuming the IRQs have been remapped to vector offsets 0x20 onwards, then the first IRQ at 0x20 is IRQ 0, timer interrupt. Same goes for COM1 and COM2, these do not have offsets 0x21 and 0x22 respectively. Please correct me if I am missing something here.

Thank you for raising the issue, I believe you are correct.

The patch seems easy enough, I will fix it in the master branch.

- idt.interrupts[0].set_handler_fn(irq::cascade);
- idt.interrupts[1].set_handler_fn(irq::com1);
- idt.interrupts[2].set_handler_fn(irq::com2);
+ idt.interrupts[2].set_handler_fn(irq::cascade);
+ idt.interrupts[3].set_handler_fn(irq::com2);
+ idt.interrupts[4].set_handler_fn(irq::com1);

If I may ask, how did you stumble onto this project? I'm now self-conscious that my code isn't up to par :-)

commented

I believe you opened an issue on Phil's blog, or commented? It might've been to do with the second edition.