BootLoader Problem

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
wererabit
Posts:30
Joined:Wed Sep 03, 2008 2:50 am
BootLoader Problem

Post by wererabit » Wed Mar 25, 2009 9:07 am

yay, the forum is back. :D

fellows, I'm at tutorial 10, and I am having a problem.

After I put all those 32 bit text printing functions in the second stage loader, I found out there is a bug in my bootloader. It seems that it only load 1 sector, the first sector, if the size of 2nd Stage is bigger than 512 it just standing there laughing at me.

I built the code one on top of the previous, so the bootloader is the code from tutorial 6. The problem is when I studied, I tried to understand Mike's code and retype from my memory. So the structure of my code and maybe something else is a bit different. Now I can't easily compare two pieces of codes. I went through my code again, but to my understanding I couldnt find anything wrong. I could use Mike's bootloader and pretend that it is mine (it works once I replace mine by his bootloader by the way), but dont really feel happy about it.

I am posting the code here in the atatchment, its long as you already know hoping that you could see where I missed

Thank you
Attachments
Boot4.zip
(3.96KiB)Downloaded 1581 times

Andyhhp
Moderator
Posts:387
Joined:Tue Oct 23, 2007 10:05 am
Location:127.0.0.1
Contact:

Re: BootLoader Problem

Post by Andyhhp » Wed Mar 25, 2009 11:39 am

Hi,

I havnt got time to look at the code atm.

However, can you say how exactly you are copying the 2nd stage to the floppy?

more specifically, are you certain you are copying more than just the first sector?

~Andrew
Image

wererabit
Posts:30
Joined:Wed Sep 03, 2008 2:50 am

Re: BootLoader Problem

Post by wererabit » Wed Mar 25, 2009 8:40 pm

Hi Andrew,

I just drag the KRNLDR.SYS across to the A drive.

Anyway, some one pointed out that there is an error in

.EVEN_CLUSTER:

add dx, 0000111111111111b ; remove the top 4 bits (significant)
jmp .NEXT_CLUSTER

It should be and not add

I still haven't tested yet, but more than likely that is the cause. I'll make sure of it tonight.

Thanks for your help :)

Post Reply