MacRISC Pre-bootloader clips visible RAM to allocate a RAM disk. hex 70.0.74.77.a unselect-dev " /options" find-package drop constant _options " /memory" find-package drop constant _memory 2.00000 constant reboot-reserved-space : boot-tbxj " &device;:&partition;,"(5c):tbxj" 2dup open-dev if $boot then ." RAMBoot: Deferring to selected physical disk. 2drop mac-boot ; struct 4 field >next-run 4 field >start-addr 4 field >byte-count constant /phys-run variable first-phys-run first-phys-run " reg" _memory get-package-property drop begin ( run addr len ) dup while decode-int >r ( run addr len ) rot ( addr len run ) /phys-run alloc-mem dup >r ( addr len run newrun ) swap ! ( addr len ) r> ( addr len newrun ) r> over >start-addr ! ( addr len newrun ) -rot decode-int >r ( newrun addr len ) rot ( addr len newrun ) r> over >byte-count ! dup >start-addr @ ." Encoded range " . dup >byte-count @ ." , " . cr >next-run -rot repeat 2drop off first-phys-run @ begin dup >next-run @ ?dup while nip repeat >r r@ >byte-count @ reboot-reserved-space - dup r@ >byte-count ! r> >start-addr @ + constant reserved-run-start 0 first-phys-run @ begin tuck >byte-count @ + swap >next-run @ ?dup 0= until constant total-ram " ramboot-disk-size" _options get-package-property if ." RAMBoot: could not get prefs from NVRAM" boot-tbxj then \ decode-int decode-string $number drop constant disk-ram 2drop : encode-int+ encode-int encode+ ; : encode-start >start-addr @ encode-int+ ; : encode-count >byte-count @ encode-int+ ; 0 0 encode-bytes total-ram disk-ram - dup 0< if 3drop ." RAMBoot: specified size larger than installed memory." boot-tbxj then first-phys-run @ begin ( addr len rem run ) tuck >byte-count @ ( addr len run rem count ) over < while ( addr len run rem ) >r >r ( addr len ) r@ encode-start r@ encode-count r> r> ( addr len run rem ) over >byte-count @ - swap ( addr len rem run ) >next-run @ repeat swap >r -rot ( rem addr len ) r@ encode-start 2 pick encode-int+ reserved-run-start encode-int+ reboot-reserved-space encode-int+ " /memory" find-device " reg" 2dup delete-property property unselect-dev ( rem ) ." done with /memory" cr dup r@ >start-addr @ + encode-int rot ( addr len rem ) r@ >byte-count @ swap - ?dup 0<> if encode-int+ else 2drop 0 0 encode-bytes then r> >next-run @ ( addr len run ) begin ?dup while >r r@ encode-start r@ encode-count r> >next-run @ repeat " /chosen" find-device " ramboot-phys-ranges" property unselect-dev " /options" find-device " ramboot-checksum" _options get-package-property 0= if " ramboot-checksum" 2dup delete-property property then unselect-dev boot-tbxj