From a451b2e14f06c19eaf98f32dcc2b45e2940a570b Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 22 Jan 2021 23:09:30 -0800 Subject: 7546 - baremetal: disk size check --- translate_subx_baremetal_emulated | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'translate_subx_baremetal_emulated') diff --git a/translate_subx_baremetal_emulated b/translate_subx_baremetal_emulated index 6a75cac7..f73f09a5 100755 --- a/translate_subx_baremetal_emulated +++ b/translate_subx_baremetal_emulated @@ -32,3 +32,9 @@ dd if=/dev/zero of=disk.img count=20160 # 512-byte sectors, so 10MB ./bootstrap run apps/hex < baremetal/boot.hex > boot.bin cat boot.bin a.bin > disk.bin dd if=disk.bin of=disk.img conv=notrunc + +if [ `stat --printf="%s" disk.bin` -ge 32256 ] # 63 sectors * 512 bytes per sector +then + echo "disk.bin won't all be loaded on boot" + exit 1 +fi -- cgit 1.4.1-2-gfad0