Table of Contents
Mounting a MicroSD card
Overview
Jason Mac Mullan
kindly develops and maintains the SAGA SDCard Driver to be used with the MicroSD slot
of the Vampire
boards. This device can be used as an additional disk for use with your AmigaOS 3.x
setup.
- The driver is still in a
beta
stage. Always BACK UP your data before using such a piece of software, until you are sure that everything works as expected.
MicroSD slot
using a simple adapter (explained here). Therefore, for brevity, the “Micro” prefix will be omitted, and only “SD card” will be used in this article.
Important notes
The current SAGA SD Driver does NOT implement - in its current version - the AUTOMATIC
disk drive geometry methods that would allow AmigaOS DOSDrivers MountLists to use some handy default values. As a consequence, keep in mind that:
MountList
attributes such asLowCyl
,HighCyl
and some others must be explicitly specified. For example,LowCyl = 0
will NOT work!- Each SD card must use its own MountList. NEVER use a MountList dedicated to a given SD card with another SD card.
- Use a third-party program, such as GiggleDisk, to create correct
MountList
by reading the lowlevel geometry of the disk.
1) Install the required files
The installation of the SDCard on the Vampire requires some files, provided in the SAGA driver package and some additional tools available on Aminet. Please, follow the following procedure step by step:
1.1) Install the SAGA SD Driver
- Run the installer provided in the SAGADriver package.
1.2) Install SCSIQuery (optional)
- Download SCSIQuery, available on Aminet.
- Copy the file
SCSIQuery/SCSIQuery
toC:SCSIQuery
1.3) Install the desired filesystem
Recommended filesystem: PFS3 All-In-One
- Download PFS3AIO, available on Aminet.
- Copy the file
pfs3_aio-handler
toL:pfs3_aio-handler
. - Download PFS3_53, available on Aminet.
- Copy the file
PFS3/tools/pfsformat
toC:pfsformat
. - Optionally, you can copy the other PFS tools (
pfsdoctor
,setfnsize
, …) toC:
.
Other filesystems to consider:
- FAT32 (already included in the SAGA driver package)
1.4) Reboot your computer
2) Check the SD card
The SAGA SD Driver (sagasd.device
) provides a method to READ GEOMETRY
of the disk. First step is to check if your SD card is compatible or not.
- Insert your card into the dedicated Vampire
MicroSD slot
. - Open a CLI (
newcli
). - Type
SDDiag
.- If you get an error, then your card will NOT work with the driver.
- If you get information such as
Block Size
,Blocks
andCapacity
, then your card should work with the driver.
- Additionally, type
SCSIQuery
to double-check the geometry of your SDCard.- Check if
Capacity in blocks
is the same asBlocks
shown inSDDiag
. - Check if
Block length
is the same asBlock Size
shown inSDDiag
. - If there are differences, something is wrong and should be reported in the Apollo Forum.
3) Prepare the SD card
Different options for different uses:
- Prepare the card on
Vampire
usingHDToolBox
with a given filesystem.- See “Tutorial: Preparing the SD card on a Vampire” below for a detailed guide.
- Prepare the card on
WinUAE
orFS-UAE
usingHDToolBox
with a given filesystem. - Prepare the card on
Windows
with theFAT32
filesystem. - Prepare the card on
Linux
with theext2
orext3
filesystem.- If you want to prepare the card on
Linux
with theFAT32
filesystem, see “Issue: Preparing the SD card with FAT32 on Linux” below.
4) Prepare and run MountLists for the SD card
- Insert your card into the dedicated Vampire
MicroSD slot
. - Open a CLI (
newcli
). - Type
Execute SYS:System/SDMountOnOff
.- This script uses
C:GiggleDisk
to read the SD partitions table, and creates one MountList per partition inT:SDMount
directory. - GiggleDisk should detect each partition's filesystem automatically, as long as you have that filesystem installed.
- The script then attempts to mount each partition.
- Type
CD T:SDMount
. - Type
Dir
. - Type
Ed SD0
.- Ensure that the
FileSystem
attribute has been set correctly. - Repeat this verification for the other partitions in that directory (
SD1
,SD2
, etc.).
- Type
Copy ALL TO SYS:Storage/DOSDrivers/
to store the MountLists permanently. - After every reboot, you will need to re-mount the SD partitions by running
Mount SYS:Storage/DOSDrivers/SD?
. If you want to mount them automatically during boot, typeCopy ALL TO DEVS:DOSDrivers/
while you are still in theT:SDMount
directory. - Reboot.
- If the partitions have not already been formatted, they will appear
Uninitialized
after mounting them, and you will need to format them.
Tutorial: Preparing the SD card on a Vampire
For this tutorial, we will create a single partition, and format it with the PFS3 filesystem.
- Insert your card into the dedicated Vampire
MicroSD slot
. - Open a CLI (
newcli
). - Type
SYS:Tools/HDToolBox device=sagasd.device
. HDToolBox
should open the GUI and showSAGASD
,Vampire SAGA-SD
.- Click on this item in the list and then click the
Install Drive
button. - Confirm the Warning requester.
- Click
New
in the requester if the disk already has an RDB. - The program now shows the Drive Definition for SAGASD.
- Information is read by the
sagasd.device
and should be correct, no need to modify anything.
- Click
Install
button and wait for a small delay. - Click
Partition Drive
button. - Select '1' in the
Default Setup
ComboBox, for a single partition. - Change
Buffers
to '150'. - Change
Partition Name
toSD0
. - Ensure
Bootable
is NOT checked. - Click
Add / Update
button. - Delete all items (filesystems) in the list.
- Click
Add new File System…
and selectL:pfs3_aio-handler
. - Modify the Identifier
0x444F5303
to0x50445303
. - Ensure
Version
is '18.0'. - Click
Ok
button. - Click
Change…
button. - Select
PDS\03
in theFile System
ComboBox. - Click
Save
button. - Click
Exit
button. - Reboot.
- Follow the instructions under “Prepare and run MountLists for the SD card” above.
- For formatting the mounted partition, open a CLI (
newcli
) and typeC:PFSFormat DEVICE=SD0 NAME=SDCARD1 QUICK FNSIZE=107
.- ALWAYS use
QUICK
option on SDCard devices (true for all non-mechanical devices, including CompactFlash). FNSIZE
stands for 'FileName Size'; max is 107 chars with PFS.
Issue: Preparing the SD card with FAT32 on Linux
If you are using mkfs
on Linux to create an SD card partition with the FAT32
filesystem, then mkfs.vfat
will write the string mkfs.fat
into the OEM Name
field of the boot sector (superblock). However, GiggleDisk on the Amiga expects to see either the MSWIN?.?
pattern or the MSDOS?.?
pattern in that field, where ?
can be any character.
The OEM Name
field is an 8-byte string that starts at byte location 3 (the 4th byte) of the boot sector. If you could overwrite this field with an “expected” string, then your SD card partition would be recognized by GiggleDisk correctly. This can be accomplished using the dd
command on Linux.
dd
command is dangerous. It could lead to data loss if used incorrectly. You are at your own risk.
Example:
echo -n "MSWIN4.1" | sudo dd of=<sd_partition_device_path> bs=1 seek=3 count=8
where <sd_partition_device_path>
is the Linux device path to the correct partition on your SD card, like /dev/mmcblk0p1
.
Finding the device path to the SD card partition:
- If you have mounted the SD card partition manually, then you already know the device path.
- If Linux has automatically mounted the SD card partition, then you can find out the device path by examining the output of the
mount
command:- Any modern Linux distribution will mount the partition using either the “volume label” (if set) or the “volume serial number”.
- For example, if the volume label (or serial number) is
C8D5-2EC3
, you can run the following:$ mount | grep "C8D5-2EC3" /dev/mmcblk0p1 on /media/steve/C8D5-2EC3 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
- The device path is in the first column (
/dev/mmcblk0p1
).
Additional information
- Peripheral information: MicroSD Card Slot
- Technical information: SAGA SDCard Core
- SAGA SD Driver sources: sagasd.device
- Covered under the
MIT License
.
- Forum: SAGA SD Driver News
- Video: PFSDoctor test
- Video: SD-Card Filesystem Test
Roadmap
- Add
Automatic disk drive geometry
, for much friendlier usage. - Handle on-the-fly
Removable disk
. Such feature is NOT supported natively byAmigaOS3.x
. - Make it
Romable
so that the OS can boot from SD.
You are here: start » system_tools » microsd