OSDEV: FAT filesystem problem on my Operating System
Posted: Sun May 26, 2013 8:39 am
Hi everyone, I'm new! Sorry for my bad english but I'm Italian and I'm using Google Translator! Returning to the topic, I'm writing this OS and have a good point, I wrote the GDT, IDT, ISR, FPU, Drivers Keyboard and Mouse, Timer, IRQ, floppy drives and FAT file system, the latter with the help of: http: / / http://www.brokenthorn.com/Resources/OSDev22.html, but I have a problem with the filesystem.
The guide is written that to mount the FAT, just do:
p_bootsector_t bootsector = (p_bootsector_t) flp_read_sector (0);
/ / And other code ...
But when I go to start the car sends me into a kernel panic for Division by zero in fact doing a log of all the variables:
bootsector-> Bpb.NumSectors
bootsector-> Bpb.SectorsPerFat
bootsector-> Bpb.NumDirEntries
(Bootsector-> Bpb.NumDirEntries * 32) / bootsector-> Bpb.BytesPerSector
give me all result 0, but I do not understand why, I also did a test by entering the correct values (taken from the internet), but the output is an infinite series of strings "0 @ P` p ', and do not understand the why!
Can you give me a hand?
Thank you very much
PS: I followed the guide only to implement the drivers in C for DMA, FDC and FAT! Maybe there's more to implement?
The guide is written that to mount the FAT, just do:
p_bootsector_t bootsector = (p_bootsector_t) flp_read_sector (0);
/ / And other code ...
But when I go to start the car sends me into a kernel panic for Division by zero in fact doing a log of all the variables:
bootsector-> Bpb.NumSectors
bootsector-> Bpb.SectorsPerFat
bootsector-> Bpb.NumDirEntries
(Bootsector-> Bpb.NumDirEntries * 32) / bootsector-> Bpb.BytesPerSector
give me all result 0, but I do not understand why, I also did a test by entering the correct values (taken from the internet), but the output is an infinite series of strings "0 @ P` p ', and do not understand the why!
Can you give me a hand?
Thank you very much
PS: I followed the guide only to implement the drivers in C for DMA, FDC and FAT! Maybe there's more to implement?