Combuster wrote:
Btw, its sortof racism to say VB's evil when you have no clue what its actually capable of, and unfortunately a LOT of people make that mistake. Didnt know though that saying VB6 is worse than saying "Lord Voldemort" though...
Lord VolBemort, I think... ;D
I have made a some serious apps in VB: one old db management program in VB6, and two more in VB.net, of which one is hashsum, published at sourceforge (though I no longer work in the VB version) and the other is an internet clock (little form that shows the @ time and it converts to and from normal dates).
The only thing I ever liked in VB is the "My" features - the very reason C++ programmers in the 90s kept boasting "VB programmes have all too easy" - especially My.Settings and My.Computer, but starting at VS2005, that is also easily accesible in C#, which is my language of choice because is java+VB with a bit of C++ if needed (unsafe blocks with pointers).
I find it quite respectable if you like the language, but you'll have to admit that VB 1) was used by every idiot in the 90s that, after achieving a form with a "hello" label and a "close" button, told everyone they were programming masters, and 2) is the second most obfuscated and error-prone language in the world unless you enable "option strict" and "option explicit" (which, of course, none of the idiots featured in 1 did). I say the second because, of course, the first is C with its #defines and its implicit automagical conversion of pointer types to void* and viceversa (thankfully that was removed in C++)
Edit: I added my MSN Messenger to my profile, so you can tell me about VB as long as you want. I'll be really happy to listen
Combuster wrote:
Agreed, there is a problem with bad area markers referencing to the data area and not to the index area. But then, you can jump into the index area anywhere without following any pointers, so how do you have the driver know it cant go there without traversing the index area (and consequently stumbing upon corrupt data, that might say bad things).
You can position the "bad index area block" markers topmost, near the volume identifier, so that they are read first (if that block is bad, the disk is screwed). Furthermore, it is possible to detect if the data just read is good or not (CRCs), so you just jump over it if it's bad
Combuster wrote:
as for LBA: It simply means that a disk can be addressed as sectors 0 - a lot (effectively getting rid of CHS translation). You just ask /dev/hdx for 512 bytes starting at address 512*sector. I think its default linux behaviour to think in LBA mode, but i'm not a linux guru, and i have no clue as to how to write filesystems for it, or FUSE for that matter. But i expect you can just ask the floppy driver to return sector xxx and it'll translate it to heads cylinders and sectors internally.
Oh my god, I'm being REALLY dense... When I say GEOMETRY I _don't mean CHS_. I mean
how can I know the size of a volume. Currently I do something like this:
Code: Select all
fstream reader(volumeToFormat);
if (reader.fail())
throw invalid_argument("Couldn't open the volume");
reader.seekp(0, ios::end); // Goto end of stream (end of volume)
volumeSize = reader.tellp(); // Get current position
reader.close()
That has worked OK many times and returned 1474560 bytes for 1440K floppies (2880 sectors x 512 bytes), but once I found one that returned more than 1600000 bytes (more than 3000 sectors), while its BPB clearly stated 2880. More amazingly, the anomaly went away when I formatted it with mkdosfs or mke2fs, I don't remember which. After that, my method returned once more 1474560.
And my question is: is there any reliable way of finding the real size of floppies or will I have to force anything near 1-2 MiB to my known floppy sizes? (as msdosfs does, or so I think)