Problem with loading kernel...

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
kompustelnik
Posts: 1
Joined: Mon Oct 25, 2010 8:12 am

Problem with loading kernel...

Post by kompustelnik »

Hi all! I'm new here ; )

I have problem with my boot loader. The problem is completly ununderstandable for me. I'm using FAT12 fs (I'm using floppy disk :P)

Here is simple scheme what the BL is doing:

1) Setting Up segment registers.
2) Setting Up stack.
3) Loading Root Directory Table.
4) Looking for kernel file.
5) Loading kernel file (loading FAT and calculating file's clusters).
6) Jumping at kernel address.

Problem is in 5th step. FAT is loaded without any problems. Code of file loading is imo correctly and I've no ideas
where the problem is. :?

Here is the source code (pretty simple and well commented):
BOOT.asm
IncFiles.inc
StdIO.inc
Floppy.inc
FAT12.inc

Please help me, cuz without correctly working BL I can't did anything.

Sorry for my english.

PS: If u want, I can put RAR with all sources + my program for BL installing on the floppy.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Problem with loading kernel...

Post by Combuster »

Problem is in 5th step. FAT is loaded without any problems. Code of file loading is imo correctly and I've no ideas
where the problem is.
The key to debugging is to know and not to guess.

Grab bochs' debugger, step through the code, and write down all the sectors of the supposed file that are loaded. Then you can check if you are loading the right sectors, and if you did, if they are in memory where you expect them to be.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply