Welcome, Guest. Please login or register.

Author Topic: FAT95 and removable SD Card  (Read 1773 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline AndyFCTopic starter

FAT95 and removable SD Card
« on: June 08, 2019, 04:34:21 PM »
I've got Fat95 running which I'm using to read and write files to an SD Card, using an SD to IDE adapter. I've mounted this so the card slot is accessible from the front of the tower. My mountlist in DEVS (built using MountDOS12) is called SD0

The only 'problem' is that if I don't have an SD Card in the adapter when WB loads I get SD0:NDOS and putting the card in after this means it isn't recognised. Similarly, if I have a card inserted when I boot it is seen but if I remove it, the icon stays and workbench hangs if I double-click it.

Is it possible to dynamically mount and unmount the SD card when it is inserted and removed?
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro
 

Offline kolla

Re: FAT95 and removable SD Card
« Reply #1 on: June 10, 2019, 11:17:06 PM »
Set "mount" or "active" tooltype for SD0 to "0", then it will not be actively mounted on boot, and instead be mounted when you first access "SD0:" somehow (for example from CLI) after you have inserted a card. To "eject" a card, you need to issue two commands... "assign SD0: dismoaunt", and "assign <volume>: dismount", where volume is the voume name of whatever filesystem that is mounted in SD0:

Sadly there is no straight forward command in the OS to ask what the volume name of a specific device is (well, C:Info, but then parsing is needed), but there is an ugly workaround you can do... try saving the below as S:Dismount, for example, and do "protect S:Dismount +s"

Code: [Select]
.key DEVICE/A
.bra [
.ket ]
FailAt 10
CD [DEVICE]
If NOT WARN
  Set _volume `cd`
  CD ram:
  Assign ${_volume} dismount
  Assign [DEVICE] dismount
  UnSet _volume
EndIF

Then you test it with "S:Dismount DS0:"

(the whole "if not warn ... endif" is a work-around for a bug in shell v46, in case you are using OS 3.1.4)
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
A600/A6095
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM440 and Mac minis with MorphOS
 

Offline AndyFCTopic starter

Re: FAT95 and removable SD Card
« Reply #2 on: June 11, 2019, 07:22:02 PM »
Thanks Kolla - I'll have a look later in the week when I get a chance.

Last night I tried automount from aminet but although it ran and detected the drive there was no status change when the card was added or removed (I tried with and without the mountlist in devs). I suspect the issue is that the SD to IDE adapter is always being seen as the 'drive' and so removing the SD Card isn't taking the whole device out, therefore 'SD0:' still exists.
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro
 

Offline AndyFCTopic starter

Re: FAT95 and removable SD Card
« Reply #3 on: June 13, 2019, 07:51:51 PM »
I've had a look at this tonight and:

- Changing the Activate tooltype to 0 does allow me to only see the card when accessed
- Using the Assign ... dismount commands mean the card can be removed - this is fine for me if I just stick with the same card

There is still an issue if I boot to WB without the card inserted or if I remove the card and re-insert. Trying to access it if the physical card is put in the SD card slot after WB is loaded means stops it being mounted - this is probably a hardware limitation.

However I am happy with the fact that there's no longer an SD0:NDOS icon if I boot without the card so that's good enough for me.

Thanks again for your help.
A1200 in DIY Tower. 3.2 ROMs (softkicking 3.2.2), OS 3.2.2 with ClassicWB, CF card, CD RW and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Pistorm 32 lite with Pi4/2GB/Emu68 or Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX.
MorphOS on PowerMac G5 and ATI 9600 pro