read/ write 1581 disks with linux

Started by hannenz, January 22, 2008, 09:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

hannenz

I am searching for a possibility to access my 1581 disks from within linux.
I know there is 1581copy but this is win/dos only and it won't work either with wine nor with VirtualBox.
I have fiddled a lot with fdutils since i found descriptions in the net that let me assume that it SHOULD be possible to do what i want with fdutils but i didn't find out how this works...
so, is there a way and if yes, could anyone be so kind to tell me step by step what i have to do...?!

I'd be happy with having the possibility to read / write whole imagedumps but having the disk mounted in the filesystem and allowing access to single files would be great! (there is cbmfs which works well with mounting diskimages into the filesystem but it won't accep /dev/fd0 as image)

ah, and for those who are interested: i found out that c1541 allows attaching /dev/fd0 as "image" and it even showed me a directory and let me read some files from the disk, but the results seemed to be corrupted files and then this sometimes works and sometimes it doesn't - so it seems to be a rather unreliable method.

I am sure that there is a possibility - we are talking about linux, so everything is possible ;), so c'mon!

Mark Smith

Google is your friend :-)

Do a search for "CBMFS", not sure how up to date it is though.

Personally I think Linux is a crappy bag of rubbish ... my views stem from the fact that I have no end of trouble doing implementations at work whenever "linux" is in the mix ... so many distros, so many ways to install software, so many ways to configure it .. and bugger all of them seem to be finished and just reside in beta-land for ever cause the developer got bored, couldn't be bothered to finish the product (because "hey it's Linux if you want to fix it you do it yourself!") and went on to another project which will undoubtedly also be left unfinished.

Hmmm ... sorry went off on a rant .. Linux == my most hated OS .. even higher than Windows!

Mark
------------------------------------------------------------------------------------------------------------------

Commodore 128, 512K 1750 REU, 1581, 1571, 1541-II, MMC64 + MP3@64, Retro-Replay + RR-Net and a 1541 Ultimate with 16MB REU, IDE64 v4.1 + 4GB CF :-)

hannenz

thanks for your reply...
i did google and i did find cbmfs before, but...
1) there seem to be two (more or less) different versions of cbmfs, the first one (rather old) i couldn't compile, dunno why and this seems to be very outdated as well, talking about something like kernel 1.2 or what...
the other version is ok, but only let's you mount disk IMAGES, no real disks (or is there something i did miss... if i try to use cbmfsmount /dev/fd0, it tells me "/dev/fd0" is not a regular file - which is - in fact - true....)
2) the (older one) cbmfs is claimed to be read-only and thats not exactly what i am looking for, though it would be a good start, but as i said, i don't get it compiled at all....

i rather think that there must be a way using fdutils in some way...

btw: what IS your fav. OS then, if you hate Linux MORE that Windows ;) (MacOS???!)
about your opinion towards linux: you might be right - or wrong, that's one of the more "cool features" we linux users get acustomed to: despite other-os-users, we don't even give a f*** what other people think about any OS at all ;) ok, now you sure say, then go ahead and help yourself instead of bothering other people in forums then, but hey - don't take all that too serios, ok... it's just about computers and having fun with'em.......


Mark Smith

I didn't think CBMFS would work to be honest .. it looked quite elderly :-(

Favourite OS ?  Currently like OSX, Solaris and HP-UX ... you know real operating systems ;-)

Don't get me wrong Linux is a superb educational OS, definitly gets people learning .. it's just such a bad choice for enterprise level, I work in data storage for some of our products we have 6 installation guides for "Linux", and they only cover the main flavours, tough luck if the customer has been a numpty and installed Ubuntopix or some other distro :-)   Support is a nightmare for Linux it's just too fluffy with no rules in place ... ho well when I take over the world I'll do a claen up :-)
------------------------------------------------------------------------------------------------------------------

Commodore 128, 512K 1750 REU, 1581, 1571, 1541-II, MMC64 + MP3@64, Retro-Replay + RR-Net and a 1541 Ultimate with 16MB REU, IDE64 v4.1 + 4GB CF :-)

Ian Colquhoun

This is a very common question in fact and I've responded to it in other forums, but not here, so:

Add the following lines to /etc/fdprm:

cbm1581         1600    10   2  80    2 0x2A 0x02 0xDF     0x2E
800/720         1600    10   2  80    0 0x2A 0x02 0xDF     0x2E


Then do the following to read or write an entire 1581 DD floppy (usually as root):

# setfdprm /dev/fd0 cbm1581
# dd if=/dev/fd0 of=mydiskimage.d81


or

# setfdprm /dev/fd0 cbm1581
# dd if=mydiskimage.d81 of=/dev/fd0


That should be all there is to it.

hannenz

#5
thanks a lot for the answer but unfortunately this won't work for me.
on my system there is no /etc/fdprm since it seems to be replaced by a file called /etc/mediaprm
this file contains entries for CBM1581 and FD2000 by default but the entries are in another format, it looks like this:

########################################################################
#  Other interesting formats, please contribute ;-)
#

# Commodore 1581  (the 3 1/2 drive of the Commodore 128)
"CBM1581":
DS DD sect=10 cyl=80 ssize=512 fmt_gap=35 gap=12 swapsides

# CMD FD2000 disk drive, a third party floppy disk drive for the
# Commodore line of computers with double of the capacity:
"CMDFD2M":
DS HD sect=10 cyl=81 ssize=1024 fmt_gap=100 gap=12 swapsides


if i try to set fd parameters using

# setfdprm /dev/fd0 CBM1581
# dd if=.......

i get:


root@rock:~# setfdprm /dev/fd0 CBM1581
root@rock:~# dd if=/dev/fd0 of=test.d81
dd: Lesen von ,,/dev/fd0": Input/output error
0+0 Datensätze ein
0+0 Datensätze aus
0 Bytes (0 B) kopiert, 3,37344 Sekunden, 0,0 kB/s


i tried copying your lines into /etc/mediaprm and tried with "cbm1581" but it gets the same results.

but now i know that this SHOULD work and it does NOT work for me, so i have still hope to get this going... :)


EDIT (10 min. later ;):
i just deleted the lines i added again and tried once more... now it WORKS!!!! great!
thanks a lot even though i really don't know why it is working now, but - who cares, if it still works next time... :)

StyleCHM

Excellent!

Im just wondering, what sort of floppy drive do you have?

Im thinking of getting an external USB floppy drive so I can write 1581 disks, but Im wondering if the USB drives are as capable as the old internal 3.5" drives....

hannenz

ok, i get varying results, sometimes it works, most times it doesn't. I read Wolfgang Moeser's (author of 1581copy) notes on 1581 & Linnux in the 1581copy readme, he says that the GAP parameter might be not suited, using the default settings in /etc/fdprms (which is /etc/mediaprms now), i played around with different values, but the results stay unreliable; as i said, it works approx. one out of ten times.
I tried something different inbetween: Launching c1541 and then attaching /dev/fd0 as "image" works too, but also kind of unreliable. Advantage is that you can access single files with the read and write commandos but as i said, this is not 100% working. As an example i tried to extract all files from a 1581 disk using the "extract" commando of c1541; which worked on let's say 80% of the files (there were a whole lot, some > 200 on the disk) and the other 20% (approx. 10-12 files) it issued an error message.
So i think the problem with dd is that it aborts on the first read error that it encounters while c1541 skips the files it can't read. this lets me assume that the method is working but in detail there must be some parameters wrong.
Now, is there anyone who succeeded reliably in copying disks under linux and what parameters does he /she use to do so...?!
@Colquhoun: are these parameters you posted tested on your environment?! Of course i tried those too but they seem to work only sometimes, too...

The other possibility would be that something is wrong with the PC disk drive; i bought it brandnew a few days ago just for this purpose, it's a standard no-name bulk disk drive, don't know - is there some test/ benchmark program i could throw at it?!

The disks itself should be ok too, they are factory new "KingZ" 2DD disks, freshly formatted and i tried different disks of course...

Or: Could there be something like the 1581 being "unaligned" or something, that the 1581 writes sectors, the pc drive can't read reliably, like the case with some 1541 drives, that write disks that can be read only from the same drive (never had this case, but heard of it). If this could be an issue: how could I realign  the 1581...?!

Ok, if there is something more i could test/ report, please let me know and i hope someone could at least tell me that he/ she did successfully what i am trying to do so i can be sure that there is some failure in my setup that needs to be fixed.

@StyleCHM: I'm sorry, i can't say anything about usb drives, since i don't even get a standard drive working for now, but my guess is that it should work - but that's a guess ;)

Ian Colquhoun

Hmm, unfortunate you're having intermittent results. This is the config I've been using at home on my run of the mill Dell workstation and have never had a problem after dozens of reads and writes. That being said, I may be slightly out of date software-wise - I didn't know the newer versions had gone to /etc/mediaprms.

One thing I do know for certain though is that a USB floppy will not work. They do not implement a full featured floppy controller and therefore cannot make use of the extended parameters in the kernel's floppy driver.