Enable intterupts once in pmode
Enable intterupts once in pmode
...
Thanks all,
Lprogster
Thanks all,
Lprogster
Last edited by Lprogster on Tue Oct 23, 2007 11:31 am, edited 1 time in total.
Hi,
A few things that have caused this before in my OS:
* Have you definitely got a valid IDT?
* If in PMode is your GDT valid?
Is it possible (using Bochs or similar) to see what the register state is when the CPU triple-faults (ie, which exception number is actually causing the first exception?).
HTH
A few things that have caused this before in my OS:
* Have you definitely got a valid IDT?
* If in PMode is your GDT valid?
Is it possible (using Bochs or similar) to see what the register state is when the CPU triple-faults (ie, which exception number is actually causing the first exception?).
HTH
I am not using Bochs. Ill post the source code, would that help?
NOTE: This is probably poorly written/ unsafe!
Thanks,
Lprogster
NOTE: This is probably poorly written/ unsafe!
Code: Select all
;{EDIT}
Lprogster
Last edited by Lprogster on Wed Nov 15, 2006 8:26 am, edited 1 time in total.
I haven't had time to read this in detail, but does the CPU also reset if you change:
to
This will at least let you know if the area you are jumping to is causing the problem.
Sorry if I have missed something obvious but I am doing this in between other work! I am also fairly new to OS dev myself...
Adam
Code: Select all
jmp 08h:01000h
Code: Select all
jmp $
Sorry if I have missed something obvious but I am doing this in between other work! I am also fairly new to OS dev myself...
Adam
Re: Enable intterupts once in pmode
Hi,
You're doing none of this, so the first time an IRQ is received the CPU thinks there's a valid 32-bit protected mode IDT where the old (real mode only) IVT is at 0x00000000. In this case the CPU crashes trying to load the IDT entry for the IRQ (causing a double fault, then triple fault/CPU reset).
Cheers,
Brendan
For protected mode, you must tell the CPU where to find a "32 bit compatible" IDT, then you need to either mask all IRQs or provide 32-bit protected mode IRQ handlers for anything that isn't masked.Lprogster wrote:How should I enable interrupts?
You're doing none of this, so the first time an IRQ is received the CPU thinks there's a valid 32-bit protected mode IDT where the old (real mode only) IVT is at 0x00000000. In this case the CPU crashes trying to load the IDT entry for the IRQ (causing a double fault, then triple fault/CPU reset).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
For my first test kernel, I used:
http://www.osdever.net/bkerndev/index.php?the_id=90
which seems to take you through each stage step-by-step. Sorry I didn't mention the protected mode IDT - as I said, I'm fairly new to all this myself.
Adam[/url]
http://www.osdever.net/bkerndev/index.php?the_id=90
which seems to take you through each stage step-by-step. Sorry I didn't mention the protected mode IDT - as I said, I'm fairly new to all this myself.
Adam[/url]
get the intel manuals -- they will be a very big help, especially with the beginning where you are now
there is a link to the intel manuals in my signature, where you can download them, at the bottom of the page is a link to instructions on ordering hard-copies highly recommended, and completely free -- you need volume 3a most, but i recommend getting all 5 books
read very closely, volume 3, particularly chapters 2-5, and then you will probably want to reread them again before beginning to understand, but its very important -- the CPU is complicated, but important, and all your work is Dependant on that chip
there is a link to the intel manuals in my signature, where you can download them, at the bottom of the page is a link to instructions on ordering hard-copies highly recommended, and completely free -- you need volume 3a most, but i recommend getting all 5 books
read very closely, volume 3, particularly chapters 2-5, and then you will probably want to reread them again before beginning to understand, but its very important -- the CPU is complicated, but important, and all your work is Dependant on that chip