Page 1 of 1
Error loading Kernel from Unformatted floppy(image)
Posted: Wed Nov 24, 2004 6:04 pm
by CHarris
I've been trying to load my kernel with my own custom bootloader, but it isn't going too well. I'm using NASM for asm and Bochs for my Virtual Machine.
This is my compiler/builder script:
And my ASM is as follows:
http://vectec.net/booter.asm
However, if I remove the errornous lines, it complains about locking and never leaves the ground...
Is what I'm doing right? I tried searching and looking through the Wiki and I've been googling for a couple days and #asm in Freenode isn't helping.
Re:Error loading Kernel from Unformatted floppy(image)
Posted: Thu Nov 25, 2004 2:08 am
by distantvoices
First, this is the *testing* forum. Pls post questions like yours in the os *development, design, FAQ* forum. It's above this one in the entry page.
Second: What errorneous lines dost thou mean? Canna check nor find anything if you don't tell which ones are failing.
Third: compiler/builder script? Where?
Oh, and *what* complains about locking?
Re:Error loading Kernel from Unformatted floppy(image)
Posted: Thu Nov 25, 2004 8:30 am
by Solar
I guess he meant these:
Code: Select all
;Exception between here...
mov eax, cr0
or al, 1
mov cr0, eax
;...and here
[quote][/quote]
Re:Error loading Kernel from Unformatted floppy(image)
Posted: Thu Nov 25, 2004 1:12 pm
by distantvoices
@solar:oops. that's the art of reading I guess, which has failed me here. *chuckle*
@charris:
Possibilities: you enable protected mode with interrupts enabled and a timer interrupt occurs. As I don't see any lidt instruction nor any idt in your code, it is likely that the processor produces a triple fault because of this hurting lack of IDT.
I suppose you tell the processor to *cli* before doing the pmode thing and only enable 'em again after having provided a proper idt (and idtr). This will help you as long as you avoid triggering exceptions.
Re:Error loading Kernel from Unformatted floppy(image)
Posted: Fri Nov 26, 2004 11:19 am
by beyondsociety
Your not disabling interrupts before you enter protected mode. You need to add a cli before the pmode initiation code:
Code: Select all
cli ; Clear interrupts
; Enable protected mode
mov eax, cr0
or al, 1
mov cr0, eax
Hope this helps.
Re:Error loading Kernel from Unformatted floppy(image)
Posted: Mon Nov 29, 2004 4:59 am
by Pype.Clicker
there are plenty of pmode tutorials in Bona Fide & OSRC (check the .:QuickLinkz:.) make sure you understand what they say if you wish to write your own custom bootloader
Entering
ProtectedMode is certainly not the easiest thing to do ...