Files
super6502/sw/script/format_disk.sh
Byron Lathi 069ae5db4b Update format script
I think there may still be some issues with a drive that is formatted
wrong, but it works consistently right now.

When modifying the boot sector, it now leaves alone the partition tables
and the bios parameter block. This does reduce the amount of code from
510 bytes to 380, but this is find as it only takes about 29 bytes to
load a sector into memory.
2023-08-09 22:46:18 -07:00

20 lines
489 B
Bash

#!/bin/bash
BOOTLOADER=../bios/bootloader.bin
DEVICE=/dev/mmcblk0
TMPBOOTSECT=/tmp/bootsect
TMPMOUNT=/tmp/sd
V=-v
STATUS="status=none"
echo "$(tput bold setaf 11)Creating Filesystem$(tput sgr 0)"
sudo mkfs.vfat -F32 $DEVICE -n SUPER6502 $V
echo
echo "$(tput bold setaf 11)Modifying Boot Sector$(tput sgr 0)"
sudo dd if=$BOOTLOADER of=$DEVICE bs=1 count=11 $STATUS
sudo dd if=$BOOTLOADER of=$DEVICE bs=1 count=380 seek=71 skip=71 $STATUS
echo "$(tput bold setaf 10)Done!$(tput sgr 0)"