Jump to content
  • 0
Sign in to follow this  
Stefan

sdcard corruption

Question

Hi,

I've been testing to write sequential files to the sdcard image using the standard KERNAL routines (SETNAM, SETLFS, OPEN, CHKOUT and CHROUT) in emulator R38.

I've noticed that files sometimes get corrupted. It seems to happen if the sdcard is mounted on the host computer's file system at the same time as it's attached to the emulator.

However, writing to the sdcard seems stable if it's not mounted to the host system at the same time. I'm running macOS Catalina.

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Yeah, it's never recommended to open a disk image with anything while it's mounted in the host filesystem, mostly due to caching and weird stuff the operating system do. It's not just an emulator problem, I'd say.

  • Like 3

Share this post


Link to post
Share on other sites
  • 0

Yep, I would not consider that a bug, other than that the emulator should exclusively mount it to avoid such tries. 

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Yeah, there's no file contention management in the emulator OR in the host operating system. Disk images are not meant to be mounted by two different processes at once. In fact, I'm not sure how you actually managed that - the emulator and MacOS should have both set an exclusive lock on the file. The fact that you WERE able to open the image in the emulator while it was mounted in MacOS is actually the bug... MacOS should not have let you.

 

Share this post


Link to post
Share on other sites
  • 0

You can open with lock or without ... systemcalls for both exist and there is nothing wrong with it. But maybe the emulator should use a locked opening.

Share this post


Link to post
Share on other sites
  • 0
59 minutes ago, SerErris said:

You can open with lock or without ... systemcalls for both exist and there is nothing wrong with it. But maybe the emulator should use a locked opening.

Yes.

However, I think you may call it a feature, and keep the emulator as is 🙂 No problem, as long as you're aware.

Share this post


Link to post
Share on other sites
  • 0
19 hours ago, Stefan said:

Yes.

However, I think you may call it a feature, and keep the emulator as is 🙂 No problem, as long as you're aware.

Agreed ... as long as you do not write to it at the same time ... you might use it to read some debugging from PC side from it. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

Please review our Terms of Use