diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-07-22 03:58:54 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-07-22 03:58:54 -0700 |
commit | 5aea0c11b762a860b59e664dbd4bc3b9185934e0 (patch) | |
tree | b254131081659f6406c2acb3138d9ad31b12e16f | |
parent | d0f39e75ca761bb9c5fa6889ea0703e3700990a2 (diff) | |
download | mu-5aea0c11b762a860b59e664dbd4bc3b9185934e0.tar.gz |
update memory map doc and anticipate a gotcha
-rw-r--r-- | boot.subx | 6 | ||||
-rwxr-xr-x | translate_subx | 6 | ||||
-rwxr-xr-x | translate_subx_emulated | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/boot.subx b/boot.subx index 18f54748..f8e04a09 100644 --- a/boot.subx +++ b/boot.subx @@ -15,10 +15,10 @@ # understand hardware interfaces well enough to explain to others. # Memory map of a Mu computer: -# code: currently 4 tracks loaded from the primary disk to [0x00007c00, 0x00048600) +# code: some tracks loaded from primary disk to [0x00007c00, 0x00080000) # stack: grows down from 0x02000000 to 0x01000000 -# heap: [0x02000000, 0x08000000) -# see 120allocate.subx; Qemu initializes with 128MB RAM by default +# heap: [0x02000000, 0x80000000) +# see 120allocate.subx; Qemu initializes with 128MB RAM by default; simulating 2GB RAM is known to work # Consult https://wiki.osdev.org/Memory_Map_(x86) before modifying any of # this. And don't forget to keep *stack-debug.subx in sync. diff --git a/translate_subx b/translate_subx index 1d4565c4..2fc62671 100755 --- a/translate_subx +++ b/translate_subx @@ -41,6 +41,12 @@ then exit 1 fi +if [ `stat --printf="%s" a.bin` -ge 492544 ] # 15 tracks * 63 sectors per track * 512 bytes per sector +then + echo "a.bin will overwrite BIOS/Video memory; you'll need to adjust boot.subx to load code to some other non-contiguous area of memory" + 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" labels` -ge 524288 ] # 4 reads * 256 sectors * 512 bytes per sector diff --git a/translate_subx_emulated b/translate_subx_emulated index a101c336..d6fc009b 100755 --- a/translate_subx_emulated +++ b/translate_subx_emulated @@ -45,6 +45,12 @@ then exit 1 fi +if [ `stat --printf="%s" a.bin` -ge 492544 ] # 15 tracks * 63 sectors per track * 512 bytes per sector +then + echo "a.bin will overwrite BIOS/Video memory; you'll need to adjust boot.subx to load code to some other non-contiguous area of memory" + 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" labels` -ge 524288 ] # 4 reads * 256 sectors * 512 bytes per sector |