Page 1 of 1

BootLoader Problem

Posted: Wed Mar 25, 2009 9:07 am
by wererabit
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

Re: BootLoader Problem

Posted: Wed Mar 25, 2009 11:39 am
by Andyhhp
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

Re: BootLoader Problem

Posted: Wed Mar 25, 2009 8:40 pm
by wererabit
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 :)