Jump to content

Photo

Using IBM Floppy Disks

altirra disk image emulation

16 replies to this topic

#1 toddtmw OFFLINE  

toddtmw

    Moonsweeper

  • 376 posts
  • Location:Cincinnati, Ohio

Posted Mon Apr 24, 2017 6:08 PM

In Altirra, is it possible to use a 3.5" IBM Floppy disk as a virtual Atari Disk without putting an .ATR image on it.

 

I can point it to a directory, but it appears when I do that, the directory is read-only.

 

If I put an ATR image on the disk, it has to read the entire image before it can use it.

 

I'm thinking it might be fun to use real 3.5" disks with the emulator to get closer to an old-school experience without relying on 30-year-old technology (rather, relying on 20-year-old technology  :grin:  instead.)

 

Thoughts on how I could do this?

 

Thanks.



#2 Joey Z OFFLINE  

Joey Z

    Dragonstomper

  • 874 posts
  • Location:Hoffman Estates, IL

Posted Mon Apr 24, 2017 7:06 PM

If Altirra supports a raw disk image w/o any headers (ala xfd images I think) you can run Altirra in Wine on linux and use /dev/fd0 (or whatever your floppy drive is) as the 'image' file. No way to do it in windows without writing code.



#3 Rybags OFFLINE  

Rybags

    Quadrunner

  • 15,263 posts
  • Location:Australia

Posted Mon Apr 24, 2017 9:53 PM

Use the "Disk Drives" pulldown item instead of the "Open image" or "Boot image" item.

Set the mode to "R/W" for that drive before opening the image with the "..." button.  That should do what you want and without reading the entire image first.

 

As for the "experience" - I suspect it'll be a bit underwhelming.  A standard HD 3.5" floppy is formatted with 18 x 512 byte sectors per track, and double sided makes that 36 sectors or 18K per cylinder.

So, an 88K 810 image will occupy about 2.5 cylinders, a 130K 1050 image will occupy about 3.5 cylinders (vs 40 tracks on a real drive).

But potentially you could use large ATR images which use the entire floppy.  You could also have multiple virtual drives using images on 1 floppy though it'd cause slowdown.  The actual speed - from memory PC floppies run about 20K or maybe a bit more per second so a disk image could be read fairly quickly.  Also, it'll probably be cached so subsequent reads might be just as fast as a HDD based image.


Edited by Rybags, Mon Apr 24, 2017 10:00 PM.


#4 Joey Z OFFLINE  

Joey Z

    Dragonstomper

  • 874 posts
  • Location:Hoffman Estates, IL

Posted Tue Apr 25, 2017 10:35 AM

Use the "Disk Drives" pulldown item instead of the "Open image" or "Boot image" item.

Set the mode to "R/W" for that drive before opening the image with the "..." button.  That should do what you want and without reading the entire image first.

 

As for the "experience" - I suspect it'll be a bit underwhelming.  A standard HD 3.5" floppy is formatted with 18 x 512 byte sectors per track, and double sided makes that 36 sectors or 18K per cylinder.

So, an 88K 810 image will occupy about 2.5 cylinders, a 130K 1050 image will occupy about 3.5 cylinders (vs 40 tracks on a real drive).

But potentially you could use large ATR images which use the entire floppy.  You could also have multiple virtual drives using images on 1 floppy though it'd cause slowdown.  The actual speed - from memory PC floppies run about 20K or maybe a bit more per second so a disk image could be read fairly quickly.  Also, it'll probably be cached so subsequent reads might be just as fast as a HDD based image.

 

On linux at least, you can set weird formats as you like. Lots of controllers don't support FM, but you can probably convince them to do 130k mode, by telling it you have a 40 track drive that is single sided, and to use 128 byte sectors, and to use 26 sectors per track.

 

Of course, you need a *real* floppy controller for that, USB floppies aren't going to cut it.

 

Also, I bet there's a way to disable the caching in linux, I just don't know it.

 

Windows? you're screwed regardless, without writing new software, and possibly even a special driver to do the atari formats.


Edited by Joey Z, Tue Apr 25, 2017 10:35 AM.


#5 Rybags OFFLINE  

Rybags

    Quadrunner

  • 15,263 posts
  • Location:Australia

Posted Tue Apr 25, 2017 10:41 AM

He's just wanting to use floppies that hold the ATR images to achieve the "feel" of it - the problem encountered was that when you use the read-only mode the emulator precaches the entire image which defeats the purpose of doing it that way.



#6 Joey Z OFFLINE  

Joey Z

    Dragonstomper

  • 874 posts
  • Location:Hoffman Estates, IL

Posted Tue Apr 25, 2017 10:48 AM

He's just wanting to use floppies that hold the ATR images to achieve the "feel" of it - the problem encountered was that when you use the read-only mode the emulator precaches the entire image which defeats the purpose of doing it that way.

yes, I suppose I fell into the 'answering the question' rather than 'answering the problem' trap. He asked if there was a way he could use the floppy without just putting an ATR on it, so I answered *that*. What he really wanted, was a way to convince the floppy to act similarly to how it would if it was an actual Atari disk drive.



#7 toddtmw OFFLINE  

toddtmw

    Moonsweeper

  • Topic Starter
  • 376 posts
  • Location:Cincinnati, Ohio

Posted Tue Apr 25, 2017 11:24 AM

Thanks for the suggestion. I'll try a R/W ATR tonight. Is it possible to make an ATR that is 1.44MB in size?

Thanks, again!

#8 Joey Z OFFLINE  

Joey Z

    Dragonstomper

  • 874 posts
  • Location:Hoffman Estates, IL

Posted Tue Apr 25, 2017 11:42 AM

Thanks for the suggestion. I'll try a R/W ATR tonight. Is it possible to make an ATR that is 1.44MB in size?

Thanks, again!

yes, but you'll have to make it exactly as big as the available space on the floppy disk (formatted capacity is smaller than unformatted). Also, you'll need to remember than an ATR has a 16 byte header when you make the file.

 

Lastly, not all DOSes support odd sizes. I'm not well versed in this area, I typically stick with standard disk sizes to avoid this issue, so I just haven't learned what does and doesn't work, or how to make it work when it doesn't but should.



#9 toddtmw OFFLINE  

toddtmw

    Moonsweeper

  • Topic Starter
  • 376 posts
  • Location:Cincinnati, Ohio

Posted Tue Apr 25, 2017 4:29 PM

Use the "Disk Drives" pulldown item instead of the "Open image" or "Boot image" item.

Set the mode to "R/W" for that drive before opening the image with the "..." button.  That should do what you want and without reading the entire image first.

 

As for the "experience" - I suspect it'll be a bit underwhelming.  A standard HD 3.5" floppy is formatted with 18 x 512 byte sectors per track, and double sided makes that 36 sectors or 18K per cylinder.

So, an 88K 810 image will occupy about 2.5 cylinders, a 130K 1050 image will occupy about 3.5 cylinders (vs 40 tracks on a real drive).

But potentially you could use large ATR images which use the entire floppy.  You could also have multiple virtual drives using images on 1 floppy though it'd cause slowdown.  The actual speed - from memory PC floppies run about 20K or maybe a bit more per second so a disk image could be read fairly quickly.  Also, it'll probably be cached so subsequent reads might be just as fast as a HDD based image.

 

Unfortunately, this does not work. I created a .ATR file. (Seems like the biggest I can create is about 720k) made it R/W and then saved it to a floppy. Then I wrote DOS to it which was funny because it made all the disk noises and then when it was done, the floppy spun up for a few seconds while it wrote the changes.

 

Then I unmounted the disk and while leaving the slot R/W, I selected it again and it paused to read the whole thing before it let me do anything. I'm assuming this happens with regular images, but they are so small and hard drives are so fast no one notices.

 

Ah well, it was an interesting idea. Guess it was not meant to be.

 

Thanks.

-Todd



#10 Kyle22 OFFLINE  

Kyle22

    River Patroller

  • 3,144 posts
  • Location:McKees Rocks (Pittsburgh), PA

Posted Tue Apr 25, 2017 5:51 PM

It would be pretty cool if Altirra supported a 10502PC type device that would give it an SIO port so it could talk to real, physical drives, printers and modems.



#11 toddtmw OFFLINE  

toddtmw

    Moonsweeper

  • Topic Starter
  • 376 posts
  • Location:Cincinnati, Ohio

Posted Tue Apr 25, 2017 8:28 PM

It would be pretty cool if Altirra supported a 10502PC type device that would give it an SIO port so it could talk to real, physical drives, printers and modems.

 

Actually, if it would just allow a "folder" (in this case the entire floppy) to look like a disk image that could be read/write and booted from, it would allow what I am trying to do.

 

To be clear, this is just a pipe dream. I'm trying to get as close the real experience without having to devote space to a real computer. Just playing around with ways to make it closer to the real experience. I miss the boxes of disks and physically putting them in a drive, but I do not miss the bulky size of the 8-bit drives.

 

Just playing around and looking for new ways to make it real....

 

Thanks all for your comments and ideas.



#12 Rybags OFFLINE  

Rybags

    Quadrunner

  • 15,263 posts
  • Location:Australia

Posted Tue Apr 25, 2017 8:59 PM

I think floppy drives might be attached as "Optimize for performance" which means they're cached.

Possibly you could change it to "Optimize for quick removal" which performs writes immediately and should only read on-demand without caching.

 

I can't test, don't have a drive attached, haven't actually used one for years.



#13 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,292 posts
  • Location:USA

Posted Tue Apr 25, 2017 10:04 PM

I think floppies default to write-through in Windows, but that still allows for read buffering and prefetch. Bypassing the cache would actually make the floppy I/O slower than on the real Atari because the sector interleave and rotational speeds don't match up. Atari disks rotate at 288 RPM and space out successive sectors halfway around the disks; PC disks rotate at 360 RPM and arrange the sectors in order (1:1 interleave). Reading the PC floppy at Atari timings without caching is actually ~60% slower. USB floppy drives are even weirder as some of them actually run at 2x speeds. Trying to use the PC floppy like the Atari floppy is like cooking your dinner in a dishwasher -- it's doable but not terribly practical.

 

There's also the little issue that not a single one of my current PCs has a floppy drive.



#14 toddtmw OFFLINE  

toddtmw

    Moonsweeper

  • Topic Starter
  • 376 posts
  • Location:Cincinnati, Ohio

Posted Wed Apr 26, 2017 4:21 AM

I think floppies default to write-through in Windows, but that still allows for read buffering and prefetch. Bypassing the cache would actually make the floppy I/O slower than on the real Atari because the sector interleave and rotational speeds don't match up. Atari disks rotate at 288 RPM and space out successive sectors halfway around the disks; PC disks rotate at 360 RPM and arrange the sectors in order (1:1 interleave). Reading the PC floppy at Atari timings without caching is actually ~60% slower. USB floppy drives are even weirder as some of them actually run at 2x speeds. Trying to use the PC floppy like the Atari floppy is like cooking your dinner in a dishwasher -- it's doable but not terribly practical.

 

There's also the little issue that not a single one of my current PCs has a floppy drive.

 

I'm not hung up on when the Atari is accessing the floppy, the floppy has to be spinning, so I don't think Caching would be bad. I think the big thing would be detecting when a disk had been changed. (Both in Windows, and in the emulator).

 

I'd be happy to buy you a USB floppy drive if you had any interest in even trying to make this work.

 

-Todd



#15 Rybags OFFLINE  

Rybags

    Quadrunner

  • 15,263 posts
  • Location:Australia

Posted Wed Apr 26, 2017 7:39 AM

Read cacheing would mean it'd probably read the image file once and the floppy would stop dead.  130K of data to a modern PC's cache is nothing and if you have more than about 2 Gig Ram it can hang around a long time before something flushes it out.

Media change detection, IMO way beyond the scope of what an emulator should be doing.  The modern day philosophy is that file access abstraction is media type independant and an application talks to the file, not the device.

 

One idea, no idea if it's possible or will work - fairly sure that if you access a file over network share the caching will be minimal at your own end.  Whether it's possible though to mount a floppy drive or folder within to appear as a network folder, I don't know.


Edited by Rybags, Wed Apr 26, 2017 7:41 AM.


#16 thorfdbg OFFLINE  

thorfdbg

    Dragonstomper

  • 746 posts

Posted Wed Apr 26, 2017 11:44 AM

 

Unfortunately, this does not work. I created a .ATR file. (Seems like the biggest I can create is about 720k) made it R/W and then saved it to a floppy.

 

This cannot work. An "ATR" is not a raw floppy image - an "XFD" is. ATR has a header that specifies the density and capacity of the disk. You first have to strip off the header, essentially 16 bytes.



#17 thorfdbg OFFLINE  

thorfdbg

    Dragonstomper

  • 746 posts

Posted Wed Apr 26, 2017 11:47 AM

It would be pretty cool if Altirra supported a 10502PC type device that would give it an SIO port so it could talk to real, physical drives, printers and modems.

Atari++ does. You can connect a real 1050 to your Linux system.







Also tagged with one or more of these keywords: altirra, disk image, emulation

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users