Reading from a FAT12 cluster causes an abort

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
User avatar
K3achas
Posts: 22
Joined: Sat May 26, 2018 5:32 pm

Reading from a FAT12 cluster causes an abort

Post by K3achas »

Hello. I have successfully got my code to read the multiple sector FAT12 root directory, but when trying to load the kernel off of the disk, the drive gives an abort error. I've checked the images in a hex editor, and the sector it reads from seems to be the correct sector, and other reads work fine (e.g. reading from the GPT, reading the BPB, reading the root directory). Any help would be much appreciated.

Link to the line in my fat driver that goes to the abort.

Link to the code that implements da_read (there are a few tiny wrappers in between).
The maker of Foxtrot microkernels. Currently just Greyhound, which is currently smaller than 3 KiB.
Also working on osmkVII.
User avatar
BenLunt
Member
Member
Posts: 941
Joined: Sat Nov 22, 2014 6:33 pm
Location: USA
Contact:

Re: Reading from a FAT12 cluster causes an abort

Post by BenLunt »

Just a comment, I mean no disrespect, you have once mentioned that you wanted to code this in assembly for the challenge.

So, here is your challenge: ... You will get to do most of it yourself ...

Even those of us that are experienced assembly programmers will look at your code, find out it is assembly, and move on. Assembly, even to the person writing it, let alone to an invited seeker, is very hard to follow and not really worth the trouble to investigate.

I strongly suggest, that if you want others to look over your code and help, you move to C or another higher level language.

Just a comment, again, I mean no disrespect.

Ben
- http://www.fysnet.net/osdesign_book_series.htm
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Reading from a FAT12 cluster causes an abort

Post by iansjack »

Alternatively, take some time out to learn how to debug an operating system. This will serve you well once your code gets at all complicated.

(PS I have to concur with Ben - asking others to debug your assembly code is not a road to success. Those who are knowledgeable enough to provide useful help are knowledgeable enough to use a high-level language.)
User avatar
K3achas
Posts: 22
Joined: Sat May 26, 2018 5:32 pm

Re: Reading from a FAT12 cluster causes an abort

Post by K3achas »

I understand. I'll try to write the more complicated code in C from now on, and if I get too many more bugs in the low level stuff, I'll try to put in a GDB stub.
The maker of Foxtrot microkernels. Currently just Greyhound, which is currently smaller than 3 KiB.
Also working on osmkVII.
Post Reply