[Solved] Problem stage 2 not loading kernel again.

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.
psimonson1988
Member
Member
Posts: 40
Joined: Tue Jul 16, 2019 8:40 pm

Re: Problem stage 2 not loading kernel again.

Post 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.
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Problem stage 2 not loading kernel again.

Post 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.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Problem stage 2 not loading kernel again.

Post 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
psimonson1988
Member
Member
Posts: 40
Joined: Tue Jul 16, 2019 8:40 pm

Re: Problem stage 2 not loading kernel again.

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