Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Iridium Banner AMIStore App Store A600 Memory

AuthorTopic: FAT95 and removable SD Card  (Read 517 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyFC

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.0 ROMS (but 3.1 in RAM), 3.5" HD, CD Rom and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX. https://www.youtube.com/watch?v=1PrGdL6XjmE
 

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
 

Offline AndyFC

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.0 ROMS (but 3.1 in RAM), 3.5" HD, CD Rom and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX. https://www.youtube.com/watch?v=1PrGdL6XjmE
 

Offline AndyFC

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.0 ROMS (but 3.1 in RAM), 3.5" HD, CD Rom and IDE to SD adapter running off the internal IDE port (using the A4000 4-port IDE adapter from Amigakit), Blizzard 1230-IV, with 32MB 60ns RAM and 50MHz 68882 FPU. 3COM PCMCIA Network card running with Miami DX. https://www.youtube.com/watch?v=1PrGdL6XjmE