FAT 32
FAT 32
I started to write code to implement the FAT32 file system (I copy past the FAT 12 code and renamed the function ...). The FAT12 could find a file and get the first data chunk.
The plan will be to use the fat with the IDE (Hard Drive / Compact Flash) and SD card. I'm planing to implement : Open, Close, Read, Write. I will limit the FAT to work only on one file at the time for now as it will make my life easyer.
The under-laying functionality needed to work on file are :
- Read the MBR (Master Boot Record, it's also a musician artist) to get the position of the Boot sector we are interested on
- Read the Boot Sector to locate the FAT and the Root directory.
- Read the Root Directory to get the file and folder name, the cluster associated with it and other meta data
- Read the FAT to find where to read the next data cluster
The plan will be to use the fat with the IDE (Hard Drive / Compact Flash) and SD card. I'm planing to implement : Open, Close, Read, Write. I will limit the FAT to work only on one file at the time for now as it will make my life easyer.
The under-laying functionality needed to work on file are :
- Read the MBR (Master Boot Record, it's also a musician artist) to get the position of the Boot sector we are interested on
- Read the Boot Sector to locate the FAT and the Root directory.
- Read the Root Directory to get the file and folder name, the cluster associated with it and other meta data
- Read the FAT to find where to read the next data cluster
Give me anything with electronic and I will make it crash/bug
Re: FAT 32
So far I can read the MBR, the Boot Sector, and the Root Directory with the first data cluster associated with the file/folder
Now I need to test the FAT function to get the next cluster from the current cluster. The 5E in the picture mean : deleted file.

Now I need to test the FAT function to get the next cluster from the current cluster. The 5E in the picture mean : deleted file.

Give me anything with electronic and I will make it crash/bug
Re: FAT 32
It's great to see this!
Re: FAT 32
Dude, this is awesome, keep working at this and I could actually remove the CH376S by the time I ship the Rev C
Keep us updated, this is great work!
Cheers
Stefany
Mistress of All Villainy
-
- Posts: 41
- Joined: Wed May 01, 2019 6:51 pm
Re: FAT 32
It is great work, but I'm not sure you should remove the ch376 (and I am not saying that because I was working to implement it in de IDE
, things change).
The ch376 is a somewhat low threshold chip, "easy" to get going and if people want to do stuff or experiments without the standard kernel, it allows them easy access to a simple storage medium including fat support without any added libraries or memory use and such. Might not be the greatest chip but it works...
@Drone84
Extra question. I see this working on the IDE in the screenshots. Does this mean you also added IDE support to the IDE? I might be mistaken, but I did not think this was already added?

The ch376 is a somewhat low threshold chip, "easy" to get going and if people want to do stuff or experiments without the standard kernel, it allows them easy access to a simple storage medium including fat support without any added libraries or memory use and such. Might not be the greatest chip but it works...
@Drone84
Extra question. I see this working on the IDE in the screenshots. Does this mean you also added IDE support to the IDE? I might be mistaken, but I did not think this was already added?
Re: FAT 32
Small update before going to bet. I can now read the directory entry to search for a file or folder name. I also coded/debugged the function to look in the fat to get he next data cluster if you give him the current cluster.


Give me anything with electronic and I will make it crash/bug
Re: FAT 32
bzuidgeest wrote: ↑Tue Sep 10, 2019 2:34 pmIt is great work, but I'm not sure you should remove the ch376 (and I am not saying that because I was working to implement it in de IDE, things change).
The ch376 is a somewhat low threshold chip, "easy" to get going and if people want to do stuff or experiments without the standard kernel, it allows them easy access to a simple storage medium including fat support without any added libraries or memory use and such. Might not be the greatest chip but it works...
@Drone84
Extra question. I see this working on the IDE in the screenshots. Does this mean you also added IDE support to the IDE? I might be mistaken, but I did not think this was already added?
I haven't coded any IDE, I just took an 100MB image disc and I edited the FAT and the Boot sector to store data in only a few kB. I includes in the code as raw data the new "Disc".
We have IDE emulation in the emulator ???

Give me anything with electronic and I will make it crash/bug
-
- Posts: 41
- Joined: Wed May 01, 2019 6:51 pm
Re: FAT 32
Sorry! I created some confusion in my question. I was talking about the FoenixIDE and IDE as the hard disk interface at the same time. That's not helpful
In your screenshot I see you are testing your fat code in foenixIDE (as in development environment), since the foenixIDE had no IDE (harddisk interface) emulation, I wondered if you had implemented that IDE interlace emulation. But from your answer I understand you are testing from a disk image file. So that answers it.

In your screenshot I see you are testing your fat code in foenixIDE (as in development environment), since the foenixIDE had no IDE (harddisk interface) emulation, I wondered if you had implemented that IDE interlace emulation. But from your answer I understand you are testing from a disk image file. So that answers it.
Re: FAT 32
Small update for the fat : it's working(ish). I can search for a file in the root directory (first folder of the absorbance like C:\ or G:\) and if the name match (short name : 8.3 exactly) well it load the first cluster of 512 Byte on the screen.

From the user point of vue it's fairly easy to use :

From the user point of vue it's fairly easy to use :
Code: Select all
file_to_load_f32 .text "TEXT_T~1TXT"
...
JSL FAT32_init ; need to be called only once
JSL FAT32_Open_File ; need to be called when you want to ... open a file ... :geek:
CMP #1
BNE FAT32_test__Faill_To_Find_file
JSL FAT32_Read_File
JSL FAT32_Print_Cluster
Give me anything with electronic and I will make it crash/bug
Re: FAT 32
Drone84, this is freakin Awesome! Now, you are talking! We will be able to throw out the CH376S chip!drone84 wrote: ↑Sun Sep 22, 2019 7:15 pmSmall update for the fat : it's working(ish). I can search for a file in the root directory (first folder of the absorbance like C:\ or G:\) and if the name match (short name : 8.3 exactly) well it load the first cluster of 512 Byte on the screen.
From the user point of vue it's fairly easy to use :
Code: Select all
file_to_load_f32 .text "TEXT_T~1TXT" ... JSL FAT32_init ; need to be called only once JSL FAT32_Open_File ; need to be called when you want to ... open a file ... :geek: CMP #1 BNE FAT32_test__Faill_To_Find_file JSL FAT32_Read_File JSL FAT32_Print_Cluster
Thanks!
S
Mistress of All Villainy