Add script for creating verilog filesystem image
This commit is contained in:
3
sw/.gitignore
vendored
3
sw/.gitignore
vendored
@@ -53,3 +53,6 @@ modules.order
|
|||||||
Module.symvers
|
Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
|
|
||||||
|
# Filesystem Images
|
||||||
|
*.fat
|
||||||
|
|||||||
42
sw/script/create_verilog_image.sh
Normal file
42
sw/script/create_verilog_image.sh
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
BOOTLOADER=../bios/bootloader.bin
|
||||||
|
FILE=fs.fat
|
||||||
|
|
||||||
|
TMPMOUNT=/tmp/lo
|
||||||
|
FSDIR=../fsdir
|
||||||
|
|
||||||
|
V=-v
|
||||||
|
|
||||||
|
# Smallest number of blocks where mkfs doesn't complain
|
||||||
|
BLOCKS=33296
|
||||||
|
|
||||||
|
rm $FILE
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Creating Filesystem$(tput sgr 0)"
|
||||||
|
mkfs.vfat $V -I -F32 -C $FILE -n SUPER6502 $BLOCKS
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Modifying Boot Sector$(tput sgr 0)"
|
||||||
|
dd if=$BOOTLOADER of=$FILE bs=1 conv=notrunc count=11 $STATUS
|
||||||
|
dd if=$BOOTLOADER of=$FILE bs=1 conv=notrunc count=380 seek=71 skip=71 $STATUS
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Mounting Device$(tput sgr 0)"
|
||||||
|
mkdir $V -p $TMPMOUNT
|
||||||
|
sudo mount $FILE $TMPMOUNT
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Copying Files$(tput sgr 0)"
|
||||||
|
sudo cp $V -r $FSDIR/* $TMPMOUNT
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Unmounting Device$(tput sgr 0)"
|
||||||
|
sudo umount $V $FILE
|
||||||
|
rmdir $V $TMPMOUNT
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo "$(tput bold setaf 11)Converting Image to Verilog$(tput sgr 0)"
|
||||||
|
objcopy --input-target=binary --output-target=verilog $FILE $FILE.hex
|
||||||
|
echo "$(tput bold setaf 10)Done!$(tput sgr 0)"
|
||||||
|
|
||||||
Reference in New Issue
Block a user