Page 2 of 2

Re: Problem stage 2 not loading kernel again.

Posted: Fri Jul 03, 2020 11:18 am
by psimonson1988
It it doesn't load stage2 anymore at all. Because of that division by zero... so why is it dividing by zero? It should be getting all the information from the boot sector am I right? Or perhaps that gets overwritten in memory maybe.

Re: Problem stage 2 not loading kernel again.

Posted: Fri Jul 03, 2020 11:30 am
by nexos
Remember this acronym, GIGO (Garbage In, Garbage Out). The div instruction is being fed garbage, so it is outputting garbage. You will have to find where that garbage is coming from and debug this.

Re: Problem stage 2 not loading kernel again.

Posted: Fri Jul 03, 2020 11:33 am
by PeterX
I'm not 100% sure, but if I remember correctly, sectors per track is 18 on a 1.44 MB floppy disk. But you write 9 in bs.inc.

Greetings
Peter

Re: Problem stage 2 not loading kernel again.

Posted: Fri Jul 03, 2020 12:17 pm
by psimonson1988
It was the sectors per track that was the garbage, it all works now. Thanks to everyone for the help. I would have never guess that sectors per track would cause that. Switch SPT from 9 to 18 and magically it works again now. So again thank you all. Marking as solved.