improve translation scripts

This commit is contained in:
Kartik K. Agaram 2021-08-29 11:25:08 -07:00
parent efae02cf11
commit bd226ccb3a
2 changed files with 38 additions and 8 deletions

View File

@ -3,6 +3,15 @@
set -e
# Map of the Mu code disk
export DISK=20160 # 20*16*63 512-byte sectors = almost 10MB
dd if=/dev/zero of=code.img count=$DISK
# code: sectors 0-10079
# debug: sector 10080 onwards
export DEBUG=10080
## Code
cat $* [0-9]*.mu |linux/mu > a.subx
cat boot.subx font.subx mu-init.subx [0-9]*.subx a.subx |linux/braces > a.braces
@ -24,8 +33,6 @@ cat a.pack |linux/labels_baremeta
cat a.survey |linux/hex > a.bin
# Create code.img containing a.bin
dd if=/dev/zero of=code.img count=20160 # 20*16*63 512-byte sectors = almost 10MB
dd if=a.bin of=code.img conv=notrunc
if [ `stat --printf="%s" a.bin` -ge 492544 ] # 15 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.subx)
@ -40,8 +47,14 @@ then
exit 1
fi
# Latter half of disk is for debug info.
dd if=labels of=code.img seek=10080 conv=notrunc # keep this sync'd with abort.subx
if [ `stat --printf="%s" a.bin` -ge $(($DEBUG*512)) ]
then
echo "a.bin will overwrite debug info on disk"
exit 1
fi
## Latter half of disk is for debug info
if [ `stat --printf="%s" labels` -ge 1048576 ] # 8 reads * 256 sectors * 512 bytes per sector
then
echo "labels won't all be loaded on abort"
@ -53,3 +66,5 @@ then
echo "abort will go into infinite regress"
exit 1
fi
dd if=labels of=code.img seek=$DEBUG conv=notrunc # keep this sync'd with abort.subx

View File

@ -7,6 +7,15 @@
set -e
set -v
# Map of the Mu code disk
export DISK=20160 # 20*16*63 512-byte sectors = almost 10MB
dd if=/dev/zero of=code.img count=$DISK
# code: sectors 0-10079
# debug: sector 10080 onwards
export DEBUG=10080
## Code
cat $* [0-9]*.mu |linux/bootstrap/bootstrap run linux/mu > a.subx
cat boot.subx font.subx mu-init.subx [0-9]*.subx a.subx |linux/bootstrap/bootstrap run linux/braces > a.braces
@ -28,8 +37,6 @@ cat a.pack |linux/bootstrap/boots
cat a.survey |linux/bootstrap/bootstrap run linux/hex > a.bin
# Create code.img containing a.bin
dd if=/dev/zero of=code.img count=20160 # 20*16*63 512-byte sectors = almost 10MB
dd if=a.bin of=code.img conv=notrunc
if [ `stat --printf="%s" a.bin` -ge 492544 ] # 15 tracks * 63 sectors per track * 512 bytes per sector (keep this sync'd with boot.subx)
@ -44,8 +51,14 @@ then
exit 1
fi
# Latter half of disk is for debug info.
dd if=labels of=code.img seek=10080 conv=notrunc # keep this sync'd with abort.subx
if [ `stat --printf="%s" a.bin` -ge $(($DEBUG*512)) ]
then
echo "a.bin will overwrite debug info on disk"
exit 1
fi
## Latter half of disk is for debug info
if [ `stat --printf="%s" labels` -ge 1048576 ] # 8 reads * 256 sectors * 512 bytes per sector
then
echo "labels won't all be loaded on abort"
@ -57,3 +70,5 @@ then
echo "abort will go into infinite regress"
exit 1
fi
dd if=labels of=code.img seek=$DEBUG conv=notrunc # keep this sync'd with abort.subx