Replies: 9 comments 50 replies
-
Hello @tyama501, Wow, nice find! It appears that Are you thinking we should port this to ELKS, or just run on Linux or macOS? Just to try it, I was able to compile it and run on macOS using the following changes:
Then compile it and test on an ELKS FAT image using:
I was also able to find a OpenBSD man page for it. I would say it should be pretty straightforward to port to ELKS, but this needs to be looked at further as it does seem to do lots of I would suggest playing with this on your PC by compiling it on your OS, then testing against various "bad" FAT disk images to see if it works well fixing them. If you like its operation, I can certainly help port it, or assist you in doing so for ELKS. Thank you! |
Beta Was this translation helpful? Give feedback.
-
In the extended version there is a:
Maybe we can set it to 300 KBs (to be compatible with a system with 640 KB of memory) on ELKS and hopefully the rest will work OK. |
Beta Was this translation helpful? Give feedback.
-
Good catch. I now see the entire FAT is If ~300k of RAM were allocated into far memory, that would only increase the max FAT volume checkable to be 72MB, smaller than most all FAT32 volumes out there. It appears the 4096k current FAT size limit would allow for max FAT32 volume size of (4096k / 4 * 512) = 524MB. Still not very large, although the 4096k define could be easily increased on 32- or 64-bit hosts. The following source comment was kind of funny:
Rewriting software... the story of our lives? Lol. We'll see what @tyama501 reports as to whether it can repair his corrupted floppies... ? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
It seems a proper CHKDSK is pretty complicated... the MSDOS 2.0 CHKDSK source, written in ASM is three files: CHKDSK.ASM (900 lines), CHKPROC.ASM (1400 lines) and CHKMES.ASM (475 lines). I also found FreeDOS chkdsk which is huge: 7 main C source files and 10 additional directories of library routines, all included in the checker. I'm not sure how either of them work, but am imagining that both use much more than 64K data in order to function. If we had large model support allowing for all __far pointers and automatic far memory allocation, things would be a lot easier, but that's another even larger problem and would likely require porting the Watcom C compiler to produce ELKS executables, along with a specially-created large model version of our C library - a lot of work. Another idea would be to create and/or run a 386-based kernel on our ancient systems (386+ only, of course). This would allow for full 32-bit protected mode, even on very old systems (but still newer than 8086 and 80286). I have been investigating such a thing if anyone is interested. |
Beta Was this translation helpful? Give feedback.
-
Hello @ghaerr , I used the same corrupted image by vi for testing. No increase to the Free space, Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hello @ghaerr , I could reproduce another broken FAT using "mv". Well, I just moved multiple files as before... Before mv the Used 1186. I tried fsck-dos from another elks. Then booted with the image again. Thank you! |
Beta Was this translation helpful? Give feedback.
-
It seems that the boot sector off FAT12/16/32 need to have boot signature of 0xAA55 at offset 510, even the sector size is over 512 Bytes. So, I think I need to add it in the boot sector of PC-98, but the boot code is already full and no space for the 2 bytes... |
Beta Was this translation helpful? Give feedback.
-
I found old fsck FAT source code from BSD.
https://github.com/boundarydevices/fsck_msdos
Is there a chance to porting this?
Beta Was this translation helpful? Give feedback.
All reactions