I got some bug on part 4 of jamesM's tutorial
-
- Posts: 6
- Joined: Wed Jan 22, 2014 9:46 am
I got some bug on part 4 of jamesM's tutorial
I've been following Jame's tutorial and it seems ok, however I have hit a bug on part 4. It is probably something simple so I would like a fresh pairs of eyes to have a peek at my code. I did after all I did stop it from compiling with an incorrect letter, however that has been rectified now.
My code is attached below and thank you for reading this, I'm sure it is one of many annoying newbie questions (sorry).
My code is attached below and thank you for reading this, I'm sure it is one of many annoying newbie questions (sorry).
- Attachments
-
- myo.zip
- (8.64 KiB) Downloaded 109 times
Re: I got some bug on part 4 of jamesM's tutorial
I'm going to suggest that you "explain" the bug your experiencing because I'm not sure if anyone is going to pick through your code to figure it out.usernameHere wrote:I've been following Jame's tutorial and it seems ok, however I have hit a bug on part 4. It is probably something simple so I would like a fresh pairs of eyes to have a peek at my code. I did after all I did stop it from compiling with an incorrect letter, however that has been rectified now.
My code is attached below and thank you for reading this, I'm sure it is one of many annoying newbie questions (sorry).
- Matt
-
- Posts: 6
- Joined: Wed Jan 22, 2014 9:46 am
Re: I got some bug on part 4 of jamesM's tutorial
Ah yes, not so much as a bug but it just won't work (I'm quite tired so sorry for not explaining properly). The code compiles fine however running it in bochs will cause it to restart at "int 0x03". There is some interesting stuff in the log which I believe indicates I didn't set up the interrupts properly.
I believe the first one is my own issued interrupt and the last two are the CPU trying to send an interrupt because the first one failed.
Code: Select all
00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x03)
00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d)
00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
Re: I got some bug on part 4 of jamesM's tutorial
I could be wrong, but I have a feeling your IDT entrys are not valid. Make sure your IDT Table is setup properly and that you have interrupts actually mapped. That might have been the bug in JamesMolleys tutorial if I remember right.. Anyways post your IDT code if you don't mind, I have a feeling its something to do with it.usernameHere wrote:Ah yes, not so much as a bug but it just won't work (I'm quite tired so sorry for not explaining properly). The code compiles fine however running it in bochs will cause it to restart at "int 0x03". There is some interesting stuff in the log which I believe indicates I didn't set up the interrupts properly.I believe the first one is my own issued interrupt and the last two are the CPU trying to send an interrupt because the first one failed.Code: Select all
00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x03) 00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x0d) 00050627844e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
-
- Posts: 6
- Joined: Wed Jan 22, 2014 9:46 am
Re: I got some bug on part 4 of jamesM's tutorial
Ok, I've put the code on pastebin because it would have made this reply gigantic.
Descriptor tables
Descriptor tables (header)
Interupts
Descriptor tables
Descriptor tables (header)
Interupts
Re: I got some bug on part 4 of jamesM's tutorial
Where is your assembly code where you use the "LIDT" instruction? Because if you haven't loaded the IDT that would be the cause.
- Matt
Edit: I looked through your code and found idt_flush, good so you do have that but I don't see it being called in your code as far as I have seen.
Yeah, your not calling "idt_flush" when you init your IDT so its not even being loaded, which is why your getting invalid descriptors. - Matt
- Matt
Edit: I looked through your code and found idt_flush, good so you do have that but I don't see it being called in your code as far as I have seen.
Yeah, your not calling "idt_flush" when you init your IDT so its not even being loaded, which is why your getting invalid descriptors. - Matt
-
- Posts: 6
- Joined: Wed Jan 22, 2014 9:46 am
Re: I got some bug on part 4 of jamesM's tutorial
I feel stupid now but sometimes you just need a fresh pair of eyes to point out the obvious. Thank you for helping
Re: I got some bug on part 4 of jamesM's tutorial
Hahaha that's alright, glad to see its working.usernameHere wrote:I feel stupid now but sometimes you just need a fresh pair of eyes to point out the obvious. Thank you for helping
Thanks, Matt
Re: I got some bug on part 4 of jamesM's tutorial
Just as a precaution: James' tutorials aren't designed to be copy-pastable but rather to teach a general idea. You will run into this the most during his multithreading implementation which no sound person should utilize.
-
- Posts: 6
- Joined: Wed Jan 22, 2014 9:46 am
Re: I got some bug on part 4 of jamesM's tutorial
Yeah I'm using it as my main resource but I have a lot in the background as well, including the OSDev wiki.