A simple bare metal test to run on Apple Silicon Macs that sets up identity paging in the lower half (TTBR0) using either 4K or 16K page sizes.
Requirements:
aarch64-elf-gcccross compiler (brew install aarch64-elf-gcc)macvdmtool(plus a USB SuperSpeed cable) to view serial output on real hardware
| 4K (1GB blocks) | 4K (2MB blocks) | 16K | |
|---|---|---|---|
| VMAPPLE on M1 Pro | ✅ | ✅ | ✅ |
| M1 Bare Metal | ❌ | ✅ | ✅ |
| M4 Bare Metal | ❌ | ✅ | ✅ |
Bare metal systems don't seem to like 1GB blocks, but are fine with 2MB ones.
First, pick your mode (4k or 16k page sizes) in config.h.
Then, make sure your serial port is correct for your platform in serial.h.
Finally, follow these steps to build and run:
make- Copy
demo.binsomewhere you can access it in 1TR / your VM - Boot into 1TR and downgrade to permissive security
- Install this with
kmutil configure-boot -v /Volumes/[YOUR VOLUME] -c demo.bin -r --entry-point 0 --lowest-virtual-address 0 - Use
macvdmtoolor watch your VM's serial port to see output