MEGA65 / mega65-freezemenu

Freeze Menu Program for the MEGA65
GNU General Public License v3.0
8 stars 11 forks source link

SD card nav can go into a subdir but can't come out again #58

Closed dansanderson closed 1 year ago

dansanderson commented 1 year ago

When mounting a disk image from the Freeze menu, I can navigate into subdirectories, but there's no way to navigate to a parent directory. Moreover, if I Run/Stop to return to the Freeze menu then try to mount a disk image again, it starts in the subdir where I left off. I have to completely exit the Freeze menu then re-enter it to reset the working directory to the top level of the SD card.

Let me know if I'm just missing something. :)

Core 20221008.23,2f545d1. Freeze menu v0.2.0.

lydon42 commented 1 year ago

Please try with Release 0.95.

dansanderson commented 1 year ago

This is interesting. You showed me that there's a /.. entry in your instance when visiting a subdirectory, but I don't have that. I attempted to rectify this as follows:

1) I upgraded to the 0.95 stable release core (93d55f0) in slot 1, and sdcard-files. (My slot 0 is a 0.95 release candidate.) This alone did not fix it with my existing SD card. 2) I copied my files off, then used the SD card utility of the core in slot 1 (confirmed the version on boot) to format the SD card and copy the system files embedded in the core. This produced a working card, but naturally did not have a subdir on it. 3) I moved the freshly formatted card to my macOS machine, used a terminal to cd /Volumes/Untitled, mkdir work, cp (some D81 files) work/, then ejected the SD card. I moved it back to my MEGA65. 4) I booted my MEGA65 to core 93d55f0, opened the Freezer, started to mount a disk, then navigated to the work/ subdirectory.

I still don't have a /.. entry.

IMG_1226 Medium

I wonder if macOS's FAT32 support isn't creating the /.. entry in the directory table the way the MEGA65 expects when I mkdir??

Here's a 4GB capture of my SD card just before I formatted it (created with sudo dd bs=4M if=/dev/disk4 of=dddaaannn_m65sd_20220106.img on macOS if it matters): dddaaannn_m65sd_20220106.img

dansanderson commented 1 year ago

Woo, Gurce found it! macOS is setting the "hidden" bit on the . and .. directory entries (offset $0B, bit $02), while other implementations (e.g. mega65_ftp) apparently do not. (I haven't tested Windows or Linux.) So maybe Hyppo needs to special case .. and treat it as not hidden.

dansanderson commented 1 year ago

Fixed by Hyppo change: https://github.com/MEGA65/mega65-core/pull/643