default.nix (1355B)
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 QEMU Aarch64 14 ************ 15 16 This target produces an image for 17 the `QEMU "virt" platform <https://www.qemu.org/docs/master/system/arm/virt.html>`_ using a 64 bit CPU type. 18 19 ARM targets differ from MIPS in that the kernel format expected 20 by QEMU is an "Image" (raw binary file) rather than an ELF 21 file, but this is taken care of by :command:`run.sh`. Check the 22 documentation for the :ref:`QEMU` (MIPS) target for more information. 23 24 ''; 25 26 # this device is described by the "qemu" device 27 installer = "vmroot"; 28 29 module = {pkgs, config, lim, ... }: { 30 imports = [ 31 ../../modules/arch/aarch64.nix 32 ../families/qemu.nix 33 ]; 34 kernel = { 35 config = { 36 VIRTUALIZATION = "y"; 37 PCI_HOST_GENERIC="y"; 38 39 SERIAL_AMBA_PL011 = "y"; 40 SERIAL_AMBA_PL011_CONSOLE = "y"; 41 }; 42 }; 43 boot.commandLine = [ 44 "console=ttyAMA0,38400" 45 ]; 46 hardware = let addr = lim.parseInt "0x40010000"; in { 47 loadAddress = addr; 48 entryPoint = addr; 49 }; 50 }; 51 }