liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (1433B)


      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` target for more information.
     23 
     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 }