Bootloaders

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
weathermanfrank

Bootloaders

Post by weathermanfrank »

Hi ya'll

I'm on my bootloader and have run in to some trouble. I've done tons of research on the net not to mention reading half of "Operating systems: Design and Implamentation" yet I still getting stuck:). I have made and loaded my GDT turned of Interupts and other stuff.
My problem is the wonderful triple fault
In the code:
mov eax, cr0
or al, 1
mov cr0, eax
if I comment out the last line my bootloader just hangs but does not triple fault other wise it does.
I'm just realy stuck and lookin for some hints of what I might try.

Thank you
Frank
jrfritz

Re:Bootloaders

Post by jrfritz »

Could you post the whole code?

Maybe your GDT's bad...
weathermanfrank

Tom: Here is my code

Post by weathermanfrank »

[attachment deleted by admin]
jrfritz

Re:Bootloaders

Post by jrfritz »

[attachment deleted by admin]
jrfritz

Re:Bootloaders

Post by jrfritz »

[attachment deleted by admin]
jrfritz

Re:Bootloaders

Post by jrfritz »

[attachment deleted by admin]
weathermanfrank

Re:Bootloaders

Post by weathermanfrank »

I thank you for your help thus far. What were you able to determine about my code? And thank you for a look at your code I nothing else I'll try to modify mine using yours as a guide if thats all right with you.

Thank you again
Frank
weathermanfrank

Re:Bootloaders(yours)

Post by weathermanfrank »

Now I really must begin to wonder? I booted your up and it to reset the computer. Could that be because I had no kernel for it to load or would that be more a physical system problem?
jrfritz

Re:Bootloaders

Post by jrfritz »

[attachment deleted by admin]
jrfritz

Re:Bootloaders

Post by jrfritz »

Did that work?
beyondsociety

Re:Bootloaders

Post by beyondsociety »

Here is your problem:

Code: Select all

codeSeg
   dw   0FFFFh      
   dw   0000h      
   db   00h
   db   98h         ; Right Here
   db   0CFh
   db   00h
Change it to:

Code: Select all

codeSeg
   dw   0FFFFh      
   dw   0000h      
   db   00h
   db   9Ah      ; This line has been changed
   db   0CFh
   db   00h

Hope this helps!
jrfritz

Re:Bootloaders

Post by jrfritz »

I guess it's time for me to read some more on GDT stuff...
weathermanfrank

Re:Bootloaders(Tom)

Post by weathermanfrank »

Thank you again your code works now I just have to play with it a bit and make sure that I understand it operation an I'll be all set. But I look forward to the challange. Thank you again for your help.

Frank
weathermanfrank

Re:Bootloaders(Tom)

Post by weathermanfrank »

With respect to your boot loader. how do you init, the segments to there respective selectors after the
jmp $
I seams that If I change that to
jmp $ + 1 I triple fault the CPU
So where do you go from this?

Thanks for any ideas:)
Frank
jrfritz

Re:Bootloaders

Post by jrfritz »

You are jumping to a unknown place...that's why...

Also...after there...you load your C kernel if you want to program your OS in C.
Post Reply