liminix

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

default.nix (1468B)


      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 = "armv7l-unknown-linux-musleabihf";
      9     };
     10   };
     11 
     12   # this device is described by the "qemu" device
     13   description = ''
     14     == QEMU ARM v7
     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 32 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     (MIPS) target for more information. '';
     24   installer = "vmroot";
     25 
     26   module =
     27     { config, lim, ... }:
     28     {
     29       imports = [
     30         ../../modules/arch/arm.nix
     31         ../families/qemu.nix
     32       ];
     33       kernel = {
     34         config = {
     35           PCI_HOST_GENERIC = "y";
     36           ARCH_VIRT = "y";
     37 
     38           VFP = "y";
     39           NEON = "y";
     40           AEABI = "y";
     41 
     42           SERIAL_AMBA_PL011 = "y";
     43           SERIAL_AMBA_PL011_CONSOLE = "y";
     44         };
     45       };
     46       boot.commandLine = [
     47         "console=ttyAMA0"
     48       ];
     49       hardware =
     50         let
     51           addr = lim.parseInt "0x40008000";
     52         in
     53         {
     54           loadAddress = addr;
     55           entryPoint = addr;
     56         };
     57     };
     58 }