default.nix (1409B)
1 # This "device" generates images that can be used with the QEMU 2 # emulator. The default output is a directory containing separate 3 # kernel ("Image" format) and root filesystem (squashfs or jffs2) 4 # images 5 { 6 system = { 7 crossSystem = { 8 config = "aarch64-unknown-linux-musl"; 9 }; 10 }; 11 12 description = '' 13 14 == QEMU Aarch64 15 16 This target produces an image for the 17 https://www.qemu.org/docs/master/system/arm/virt.html[QEMU "virt" 18 platform] using a 64 bit CPU type. 19 20 ARM targets differ from MIPS in that the kernel format expected by QEMU 21 is an "Image" (raw binary file) rather than an ELF file, but this is 22 taken care of by `+run.sh+`. Check the documentation for the `+qemu+` 23 target for more information. 24 ''; 25 26 # this device is described by the "qemu" device 27 installer = "vmroot"; 28 29 module = 30 { config, lim, ... }: 31 { 32 imports = [ 33 ../../modules/arch/aarch64.nix 34 ../families/qemu.nix 35 ]; 36 kernel = { 37 config = { 38 VIRTUALIZATION = "y"; 39 PCI_HOST_GENERIC = "y"; 40 41 SERIAL_AMBA_PL011 = "y"; 42 SERIAL_AMBA_PL011_CONSOLE = "y"; 43 }; 44 }; 45 boot.commandLine = [ 46 "console=ttyAMA0,38400" 47 ]; 48 hardware = 49 let 50 addr = lim.parseInt "0x40010000"; 51 in 52 { 53 loadAddress = addr; 54 entryPoint = addr; 55 }; 56 }; 57 }