-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible error in ioapic.c #223
Comments
Hey @AntoninRuan first of all thanks for reading the notes, and secondly thanks for this issue .
So do you think that this part of the notes should be improved? (i need to read it again, do you mind to link the part that is not clear here?) What are the bits that are not clear?
That is entirely possible that i made a mistake (i recently found out a function that was returning the opposite of what it was supposed to return! :) ). It took me nearly one hour to figure out what i did more than 2 years ago lol, i also had to go again through the IOApic documentation, because i mostly forgot how it works. So yeah apparently that code is a bug, i will double check, and fix it (you can create a PR eventually, and I can merge it once i confirmed everything is working). Thanks for reporting it. And Yeah I'm happy if other people create issues and even contribute if they want, so don't worry. For me it means that someone is interested in my code (although probably there are much better and elegant solution than mine! :) ) |
I guess it depends on what you want to provides with notes. For me the chapter was a good introduction to APIC and IOAPIC and it allowed me to then search for precise documentation and specifications (mainly the IOAPIC datasheet in this case). I then had trouble understanding the meaning of some of things in the datasheet and used your code to search for more informations. Actually, I just reread the part on the apic and saw I missed the description of a LVT entry, so I guess here I may have benefited from more informations on what the Pin Polarity bit really do but considering the lack of informations given in the datasheet
As for the PR, I am still not sure to really understand what really happens and I rather test a bit more on my side before proposing any change. |
Yeah, i noticed that too, on a quick read, the fact tht part of a IOREDTBL entry is an LVT entry is totally missable (i did miss it too, when reading the docuemntation, only on a second read i found it out) i will try to find a way to make it more clear. Thanks again for reporting this, and i will fix the bug soon. |
Just FYI, i'm not ignoring this issue, or forgot about it, i was trying to finanlize the changes for the other code changes i was doing, then i'll fix this one (or maybe i'll fix it in the same PR of the other changes). :) |
Hi man, i am currently reading through your notes on osdev (it is really well done thank you for that).
And i was actually reading the keyboard interrupt chapter in order to implement it myself also using ioapic. And after reading the ioapic redirection table documentation. I was having a bit of trouble finding how to determine how some bit were supposed to be set, so i decided to read through your implentation hoping to find more informations. Sadly I didn't find what I was searching for but while searching I think I found an error in your code.
If I am not mistaken here your are reading bit 2..4 of an Interrupt Override Structure from the MADT, that are the trigger mode flags but you are writing it the the polarity flag of your entry (flag which you already set a few line above)
Dreamos64/src/kernel/arch/x86_64/cpu/ioapic.c
Lines 136 to 140 in 137159a
I don't know if you really expect issues from other people in this repo, but I thought I'd let you know, if it is indeed an error it may avoid you strange bug in the future.
The text was updated successfully, but these errors were encountered: