@chicken: I've added precompiled bootloader images to the github repo.
@igor: Thanks for the helpful suggestions.
I agree that the code isn't very polished, will try to fix it up, get rid of magic numbers.
To be honest, I didn't put much thought into that filesystem image. I've created it by making a 512kB file, formatting it to FAT12 with 512b sectors using mkfs.msdos, mounting it and adding a firmware.bin file of the right size.
According to FAT documentation, f0 means a 1.44MB/2.88MB floppy.
Like you said, it's just cosmetic, I didn't bother with it
Yeah, might as well get rid of the whole thing.
That's the sector where the data starts.
That's the number of blocks for user firmware, should be 240 of course, or calculated from USER_PROGRAM_LENGTH.
Oops, that's a bug. But that line is not needed anymore.
In the latest version, the program assumes the first cluster in the data region the host tries to write to is the beginning of a new firmware, so it doesn't look at the directory entries at all.
I had to do this, because on Ubuntu, the file manager first starts with writing data to disk (and not in the same place as the previous firmware.bin), and modifies the directory entry afterwards (Windows, for example, modifies the directory entry first).
Also thanks to this, you don't have to rename your binary to firmware.bin anymore.
I don't think it gets written to, but we have a lot of RAM, why not use it?