where the **** does that 0xAAAA stuff come from ? how many bytes of FAT are you reading ? and why don't you simply put the Root after those bytes ?
How do the "readsector routine" work and how to build one in pmode?
that's a complex stuff. you'll have to program the FDC and the DMA chip together, make sure you give the proper addresses to the DMA, etc. If you can avoid it (for instance, loading the whole floppy in memory -- or everything you need from it) while you're in (un)real mode, you'll make your life a lot easier ...
Never tried it myself: i consider it as a lack of my precious time as there are more and more floppyless systems ...
How to find/calculate (and load) programs and dir?s in fat12?
their first chunk is in the root directory, and from there you just have to follow the FAT to know which chunk is next...
how to delete/create files on a fat12 disc?
delete: you sweep the list of chunks for the file (in the FAT) and tag them as 'free' (there's a special number for this ... which is 0xFFE iirc) and then replace the first character of the file with a 'is deleted' character (it was the Delta on my IBM pc -- look the MS doc to be sure)
create: you sweep the directory for a free entry (check the flags), write the filename there. When you want to add datas on a new chunk, sweep the FAT for a cluster (*that*'s the word i've been seeking for . replace all the 'chunk' by 'cluster) that is tagged as 'free' and write its number in the entry for the previous cluster of your file.
For instance you have
Code: Select all
[myFile .exe] (first = 0) is an empty file
[myFile .exe] (first = 123) and FAT[123]=0 is a single-cluster file
[myFile .exe] (first = 123) and FAT[123]=124, FAT[124]=0 is a two-clusters file, etc.