Error loading Kernel from Unformatted floppy(image)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
CHarris

Error loading Kernel from Unformatted floppy(image)

Post 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.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Error loading Kernel from Unformatted floppy(image)

Post 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?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Error loading Kernel from Unformatted floppy(image)

Post 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]
Every good solution is obvious once you've found it.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Error loading Kernel from Unformatted floppy(image)

Post 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.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
beyondsociety

Re:Error loading Kernel from Unformatted floppy(image)

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Error loading Kernel from Unformatted floppy(image)

Post 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 ...
Post Reply