sdbox
Publicjbilander/sdbox
Loading…
Imported from GitHub: jbilander/sdbox · commit ae7f414 · license GPL-3.0
Description
A parallel to sd-card project for the Amiga
README
SD card module
An SD card module can be used with the SPI adapter in order to mount the SD card as a volume in AmigaOS. This driver uses the code written by Mike Sterling: https://github.com/mikestir/k1208-drivers/tree/master/sd. Thanks Mike!
The file sd.c does all the heavy lifiting and remains largely unchanged compared to Mike's original.
Typing make will produce the binary spisd.device which should go into the DEVS: directory.
Install the fat95 file system handler in L: and copy the mountfile SD0 (available in the amiga folder of this repo) to some suitable place e.g. Devs where it can be used to mount the SD card on demand by simply double-clicking the icon (read more about how this works in other places, e.g. the fat95 documentation). For automatic mount on boot put the SD0 file in the Devs/DOSDrivers folder.
Build the spisd.device driver with gcc-2.95.3 https://github.com/adtools/amigaos-cross-toolchain in path:
jbilander@apollo:~/projects/sdbox$ make
make -C sd
make[1]: Entering directory '/home/jbilander/projects/sdbox/sd'
mkdir build-device
m68k-amigaos-gcc -m68000 -s -O2 -Wall -fomit-frame-pointer -noixemul -fbaserel -I. -I../common -ramiga-dev -c -o build-device/device.o device.c
m68k-amigaos-gcc -m68000 -s -O2 -Wall -fomit-frame-pointer -noixemul -fbaserel -I. -I../common -ramiga-dev -c -o build-device/spi-par.o ../common/spi-par.c
m68k-amigaos-as -m68000 -o build-device/spi-par-low.o ../common/spi-par-low.s
m68k-amigaos-gcc -m68000 -s -O2 -Wall -fomit-frame-pointer -noixemul -fbaserel -I. -I../common -ramiga-dev -c -o build-device/sd.o sd.c
m68k-amigaos-gcc -m68000 -s -O2 -Wall -fomit-frame-pointer -noixemul -fbaserel -I. -I../common -ramiga-dev -c -o build-device/timer.o ../common/timer.c
m68k-amigaos-gcc -m68000 -s -O2 -Wall -fomit-frame-pointer -noixemul -fbaserel -I. -I../common -ramiga-dev -Wl,-Map=build-device/spisd.device.map -o build-device/spisd.device build-device/device.o build-device/spi-par.o build-device/spi-par-low.o build-device/sd.o build-device/timer.o
make[1]: Leaving directory '/home/jbilander/projects/sdbox/sd'
jbilander@apollo:~/projects/sdbox$ cd sd/build-device/
jbilander@apollo:~/projects/sdbox/sd/build-device$ ls -al
total 61
drwxrwxr-x 2 jbilander jbilander 9 Jun 7 23:43 .
drwxrwxr-x 3 jbilander jbilander 9 Jun 7 23:43 ..
-rw-rw-r-- 1 jbilander jbilander 1810 Jun 7 23:43 device.o
-rw-rw-r-- 1 jbilander jbilander 2995 Jun 7 23:43 sd.o
-rw-rw-r-- 1 jbilander jbilander 1059 Jun 7 23:43 spi-par-low.o
-rw-rw-r-- 1 jbilander jbilander 1375 Jun 7 23:43 spi-par.o
-rwxrwxr-x 1 jbilander jbilander 5044 Jun 7 23:43 spisd.device
-rw-rw-r-- 1 jbilander jbilander 9521 Jun 7 23:43 spisd.device.map
-rw-rw-r-- 1 jbilander jbilander 294 Jun 7 23:43 timer.o
jbilander@apollo:~/projects/sdbox/sd/build-device$
Mounting SD0: on demand by double clicking the SD0 file, you can also type mount SD0: in a shell-prompt.
Running sdbox on a stock A500 with wb 1.3 on KS 1.3 booting from floppy with drivers installed
Running sdbox on a stock A500 with wb 1.3 on KS 1.3 original mask rom v34.5 and booting wb adf (via gotek) with sdbox-drivers included. I removed the printer.device and the printers directory in order to get free space to fit the drivers on the floppy image.
Verifed working :
wb 1.3 (v34.20)(BlockSize = 512needs to be removed and the entryReserved = 0to be in the mountfileSD0)wb 1.3.2 (v34.28)(RequiresBlockSize = 512entry in mountfile)wb 1.3.3 (v34.34)(RequiresBlockSize = 512entry in mountfile)
Each entry must begin with the device name (in this case, SD0:) and must end with a number sign #.
SD0: FileSystem = l:fat95
Device = spisd.device
Unit = 0
Flags = 0
LowCyl = 0
HighCyl = 0
Surfaces = 1
BlocksPerTrack = 1
BlockSize = 512
Reserved = 0
Buffers = 20
BufMemType = 1
BootPri = 0
StackSize = 4096
Priority = 5
GlobVec = -1
DosType = 0x46415401
#
Please note, in order to see files and folders appear as icons in wb 1.3 you need *.info files of correct type that matches the names of your folder or file since 1.3 doesn't seem to have a "show all folder and files" option.
Running sdbox on a stock A500 with wb 3.1 on KS 3.1 booting from floppy with drivers installed
You can mount either via command line or double-click the SD0 file:
Running sdbox on a A1200
Copying driver file over via Kermit (cki196.exe for Amiga 3.1) and a null modem cable:
If you get the bad numbererror when trying to access SDO: after mounting the SD0 file it may be an indication that your card isn't compatible with the sdbox for some reason. Probably you need a 10k pull-up resistor on the MISO-line, check under the Issues tab for how to do this. You can follow SukkoPera's instructions of where to solder the pull-up resistor. Many thanks to SukkoPera for contributing. You can check for activity on MISO/MOSI if you have access to an oscilloscope or a logic analyzer.
No comments yet. Be the first to ask about this board.