Atari file system support for Linux ?

WinSTon, Nostalgia, MSA Converter, FloImg, Makedisk and all the others.

Moderators: Mug UK, Moderator Team

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: Atari file system support for Linux ?

Postby AtariZoll » Thu Nov 30, 2017 6:00 pm

Maybe just need to stick to good, old Hatari, or Aranym - they will access any of partitioning system, byte-swapped or not ...
I don't know is direct access to attached Flash cards possible - there was some talk about it, but I never tried.
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Fri Feb 23, 2018 1:16 pm

Hi guys, I've ported P.Putniks tool to QT 4.x (should also work on 5.x). Almost all functionality should work. Maybe there is a "delete file" function possible in future, but earnestly, I'm not a filesystem specialist. To deeply understand how P.P.'s tool is working inside, some work has to be done. The used code style is ... lets say slightly old fashioned. So code need to be reviewed and partly recoded.
I've removed all KDE components and used only QT components, so there is no need to install KDE framework. If there is anyone who can implement drag 'n drop features (of course I will try too) this would be a nice tool for managing ATARI partitions on PC.
Please test, but be careful. Working with real devices (flashcards) needs root access. I've removed choice of /dev/hda, /dev/hdb, dev/sda and /dev/sdb, but nevertheless there is enough potential for making huge desaster. 8)

DrImg.tar.bz2 -> QTcreator project (source)
DrImgEx.tar.bz2 -> executable + desktop-icon (compiled on kubuntu 17.10 / QT 4.8.7)

some tests later: it seems (at least for ICDpro driven devices) GEM partitions will get damages during file transfer on it, and (these) devices are not bootable any more after trasferring files to BGM partitions on it. Okay, linux sources are V0.85, windows version is V1.35. However - something to do here...
You do not have the required permissions to view the files attached to this post.

mikro
Atari God
Atari God
Posts: 1618
Joined: Sat Sep 10, 2005 11:11 am
Location: Kosice, Slovakia
Contact:

Re: Atari file system support for Linux ?

Postby mikro » Sun Mar 18, 2018 8:21 am

Hi Frank, why not to put the project on github, that way it's easy to help you out with features / bugfixes / code review.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Tue May 29, 2018 8:26 am


Badwolf
Atariator
Atariator
Posts: 28
Joined: Thu Mar 16, 2017 12:09 pm

Re: Atari file system support for Linux ?

Postby Badwolf » Thu Jun 07, 2018 8:54 pm



Thanks, Frank.

I've been doing a lot of image work recently, so will give this a go & let you know how I get on.

Cheers,

BW.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Tue Jul 24, 2018 4:27 pm

Hi Badwolf, I've just commit some changes and reworks. You should check out again, because I did many, many source changes just to get more structured code (by far not ready, but more or less understandable now). I've added a file / directory delete function and directory navigation within the file browser. I've tested it with several files, images and real SD drives - it seems to work.
Next steps are - enhance "AddFile" to handle whole directory trees (I will do), then implement drag'n'drop. Maybe it is possible to get the ST desktop look into the file browser - would be nice. :-)
Furthermore reading and writing SD-Images is boring slow. Maybe you can improve it.

Frank

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1712
Joined: Sun Jul 31, 2011 1:11 pm

Re: Atari file system support for Linux ?

Postby Eero Tamminen » Wed Jul 25, 2018 8:52 pm

frank71 wrote:Furthermore reading and writing SD-Images is boring slow. Maybe you can improve it.


Through what interface you're writing and on what device/media? And what's the block size you're using for the writing?

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Sat Aug 04, 2018 1:19 pm

Hi Eero,
this tool reads/writes directly from/to e.g. /dev/mmcblk0. The reading speed is okay so far, but writing is about 5 times slower than under windows. Bigger block sizes (I use 1M) doesn't help. Asking Google shows me, I'm not the only one with this problem, but unfortunately is shows me no solution.
Even with dd writing half a Gig takes 10 minutes, under windows this tool needs 2 minutes. Some guys suggests to use open() with O_DIRECT flag instead of using fopen(), but this sounds weird to me. Some kernel caching and buffering cannot cause minutes of time loss during 512 writes.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1712
Joined: Sun Jul 31, 2011 1:11 pm

Re: Atari file system support for Linux ?

Postby Eero Tamminen » Sun Aug 05, 2018 10:32 am

When you say that tool takes less time on Windows, is it to this same MMC card, and to same partition on it?

(MMCs may have some faster flash at beginning which is optimized for FAT file systems.)

And do you have same amount of free space in both cases before doing the test? Flash media does wear-leveling and if you've just freed a lot of disk data before doing the writes that are large than before you freed the space, it will need to erase the freed blocks before they can be written. Erasing might happen only after you've written enough new data that the space for previously remove data is needed again.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Tue Aug 07, 2018 6:26 pm

Hi Eero,
after my Windows takes me 1.5 days (evenings) to be usable after I didn't use it for 2 month, I've tested the currently checked in code under Windows and Linux. Same hardware, same SD card, same code: Windows needs 1 minute to write 500M, Linux needs 7 minutes. It is just a raw write to the device - regardless any data, partitions or file systems on it. I can change several times between the systems - always the same result. I'm aware of the internal structure and management of flash memory - that's not the problem here.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Tue Aug 07, 2018 6:32 pm

Maybe this is the reason:

Code: Select all

$ sudo hdparm -tT /dev/mmcblk0

/dev/mmcblk0:
 Timing cached reads:   1974 MB in  2.00 seconds = 987.80 MB/sec
 Timing buffered disk reads:  22 MB in  3.01 seconds =   7.31 MB/sec
 

But to be honest, I cannot believe that's the whole story...

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1712
Joined: Sun Jul 31, 2011 1:11 pm

Re: Atari file system support for Linux ?

Postby Eero Tamminen » Tue Aug 07, 2018 9:38 pm

Writes cannot be cached like reads can. They could be buffered by kernel, but that would mean that writes haven't been pushed to card when the write command has finished. I.e. if you would eject the card, the data wouldn't be there, although file system might show it.

How do you do the "raw" write on Windows and Linux? Are you doing sync after it on both?

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Wed Aug 08, 2018 8:10 am

There is indeed a difference between Windows and Linux. To have a correct relation between progress bar and real written data on device, it is needed to do a fdatasync() from time to time under Linux - otherwise all the data is cached and the progress bar jumps to 99%, and it takes the whole rest of time to close the file - what is in fact a sync. Under Windows writing is obvious synced during the whole process.
Raw writing means, I open e.g. /dev/mmcblk0 with fopen(), write with fwrite() and so on...

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Thu Aug 09, 2018 9:17 pm

During thinking about the slow writing speed under Linux :wink: I've finished the function I want to add: sorted view of directories, deleting files and dir's and adding whole directories from local drive. It's compilable for Windows too, by uncommenting a define in "gemddlg.h" (sure there are better ways...)
I compiled it with QT Creator 2.x - with higher version you will get masses of warnings (rightly, because there are still lots of global vars and dangerous casts and so on) QT-Version is 4.x - but it should work with 5.x too.
You may test it now, and comment.

frank71
Retro freak
Retro freak
Posts: 10
Joined: Sun Jan 22, 2017 12:10 pm

Re: Atari file system support for Linux ?

Postby frank71 » Sat Aug 11, 2018 9:53 pm

Hi Eero, I've tested the tool with other hardware - everything seemed okay. Obviously the SD card reader in my notebook is supported weakly under linux. All in all this tool is working quiet good now.
So I will do some bugfixing (e.g. supporting some special characters in TOS file names, which are not allowed in other file systems...) next time and that's it.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1712
Joined: Sun Jul 31, 2011 1:11 pm

Re: Atari file system support for Linux ?

Postby Eero Tamminen » Sun Aug 12, 2018 6:59 pm

frank71 wrote:Hi Eero, I've tested the tool with other hardware - everything seemed okay. Obviously the SD card reader in my notebook is supported weakly under linux.


Ok, so the driver is using some really slow mode for accessing the card, or it's just written in very inefficient way. That can happen for Linux stuff that's not used on servers, and it's hard to know which of the consumer devices have good drivers (one rarely googles for specific card reader chips, unless one encounters problems, one doesn't do that kind of research for "fringe benefit HW" when looking for device that one might some day use as a Linux box)...

Anyway, great to hear that you got it working good on another HW!


Social Media

     

Return to “Other emulators & tools”

Who is online

Users browsing this forum: No registered users and 1 guest