diff --git a/apps/default.nix b/apps/default.nix
index 147b523..83d93bb 100644
--- a/apps/default.nix
+++ b/apps/default.nix
@@ -1,20 +1,62 @@
# SPDX-License-Identifier: CC0-1.0
-{ nixpkgs, dhallApps, packages }:
+{ self, nixpkgs, nixpkgsLocal, packages }:
-rec {
-
- linux-image =
- let drv = import ./linux-image { inherit nixpkgs dhallApps packages; };
- in {
- type = "app";
- program = "${drv}/bin/linux-image";
+let
+ dhallApps = let
+ mkApp = { drv, name ? drv.pname or drv.name, exe ? name }: {
+ inherit name;
+ value = {
+ type = "app";
+ program = "${drv}/bin/${exe}";
+ };
};
+ in builtins.listToAttrs [
+ (mkApp { drv = nixpkgsLocal.dhall; })
+
+ (mkApp {
+ drv = nixpkgsLocal.dhall-bash;
+ name = "dhall-to-bash";
+ })
+
+ (mkApp {
+ drv = nixpkgsLocal.dhall-json;
+ name = "dhall-to-json";
+ })
+
+ (mkApp {
+ drv = nixpkgsLocal.dhall-json;
+ name = "json-to-dhall";
+ })
+
+ (mkApp {
+ drv = nixpkgsLocal.dhall-json;
+ name = "dhall-to-yaml";
+ })
+
+ (mkApp {
+ drv = nixpkgsLocal.dhall-json;
+ name = "yaml-to-dhall";
+ })
+
+ ];
+
+in dhallApps // {
+
+ linux-image = let
+ drv = import ./linux-image {
+ apps = self;
+ inherit nixpkgs packages;
+ };
+ in {
+ type = "app";
+ program = "${drv}/bin/linux-image";
+ };
generate-manifest = let
drv = import ./generate-manifest {
stdenv = packages.stdenv;
- inherit nixpkgs dhallApps;
+ inherit nixpkgs;
};
in {
type = "app";
@@ -24,7 +66,8 @@ rec {
hw-image = let
drv = import ./hw-image {
stdenv = packages.stdenv;
- inherit nixpkgs dhallApps packages;
+ apps = self;
+ inherit nixpkgs packages;
};
in {
type = "app";
@@ -37,7 +80,8 @@ rec {
nova-image = let
drv = import ./nova-image {
stdenv = packages.stdenv;
- inherit nixpkgs dhallApps packages;
+ apps = self;
+ inherit nixpkgs packages;
};
in {
type = "app";
@@ -50,7 +94,8 @@ rec {
hw-iso = let
drv = import ./hw-iso {
stdenv = packages.stdenv;
- inherit nixpkgs packages hw-image;
+ inherit nixpkgs packages;
+ inherit (self) hw-image;
};
in {
type = "app";
@@ -63,7 +108,8 @@ rec {
nova-iso = let
drv = import ./nova-iso {
stdenv = packages.stdenv;
- inherit nixpkgs packages nova-image;
+ inherit nixpkgs packages;
+ inherit (self) nova-image;
};
in {
type = "app";
@@ -73,11 +119,14 @@ rec {
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-iso "${bootDesc}" > $out'';
};
- render-init =
- let drv = import ./render-init { inherit nixpkgs dhallApps packages; };
- in {
- type = "app";
- program = "${drv}/bin/render-init";
+ render-init = let
+ drv = import ./render-init {
+ apps = self;
+ inherit nixpkgs packages;
};
+ in {
+ type = "app";
+ program = "${drv}/bin/render-init";
+ };
}
diff --git a/apps/generate-manifest/default.nix b/apps/generate-manifest/default.nix
index 7c5605c..f63c278 100644
--- a/apps/generate-manifest/default.nix
+++ b/apps/generate-manifest/default.nix
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
-{ stdenv, nixpkgs, dhallApps }:
+{ stdenv, nixpkgs }:
with nixpkgs.buildPackages;
diff --git a/apps/hw-image/default.nix b/apps/hw-image/default.nix
index b86d7a4..1277568 100644
--- a/apps/hw-image/default.nix
+++ b/apps/hw-image/default.nix
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
-{ stdenv, nixpkgs, dhallApps, packages }:
+{ stdenv, nixpkgs, apps, packages }:
let inherit (packages) genodeSources base-hw-pc;
in nixpkgs.writeScriptBin "hw-image" (with nixpkgs.buildPackages;
@@ -16,14 +16,13 @@ in nixpkgs.writeScriptBin "hw-image" (with nixpkgs.buildPackages;
TMPDIR="$(${coreutils}/bin/mktemp -d)"
trap "rm -rf $TMPDIR" err exit
- export DHALL_PRELUDE=${packages.dhallPrelude}/package.dhall
- export DHALL_GENODE=${packages.dhallGenode}/package.dhall
+ export DHALL_GENODE=${packages.dhallGenode}/source.dhall
build_core() {
local lib="$1"
local modules="$2"
local link_address="$3"
- ${dhallApps.dhall.program} text <<< \
+ ${apps.dhall.program} text <<< \
"(${../modules.as.dhall}).to64bitImage ($modules)" \
> "$TMPDIR/modules.as"
@@ -40,14 +39,14 @@ in nixpkgs.writeScriptBin "hw-image" (with nixpkgs.buildPackages;
cat a.out
}
- ${dhallApps.dhall.program} text \
+ ${apps.dhall.program} text \
<<< "(env:DHALL_GENODE).Init.render ($@).config" \
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
-schema ${packages.genodeSources}/repos/os/src/init/config.xsd - \
| sed 's/>/>/g' \
> $TMPDIR/config
- ${dhallApps.dhall.program} \
+ ${apps.dhall.program} \
<<< "${../insert-config-rom.dhall} \"$TMPDIR/config\" ($@).rom" \
> "$TMPDIR/modules.dhall"
diff --git a/apps/linux-image/default.nix b/apps/linux-image/default.nix
index d8e9e45..f812fc4 100644
--- a/apps/linux-image/default.nix
+++ b/apps/linux-image/default.nix
@@ -1,13 +1,12 @@
# SPDX-License-Identifier: CC0-1.0
-{ nixpkgs, dhallApps, packages }:
+{ nixpkgs, apps, packages }:
nixpkgs.writeScriptBin "linux-image" (with nixpkgs.buildPackages; ''
#!${runtimeShell}
set -eu
- export DHALL_PRELUDE=''${DHALL_PRELUDE:-${packages.dhallPrelude}/package.dhall}
- export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/package.dhall}
- ${dhallApps.dhall.program} text <<< "${./script.dhall} ($@)" > boot.sh
+ export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/source.dhall}
+ ${apps.dhall.program} text <<< "${./script.dhall} ($@)" > boot.sh
source boot.sh
rm boot.sh
'')
diff --git a/apps/modules.as.dhall b/apps/modules.as.dhall
index 42ff906..ceafd02 100644
--- a/apps/modules.as.dhall
+++ b/apps/modules.as.dhall
@@ -9,17 +9,14 @@ let BootModules = Genode.BootModules
let RomEntry = Prelude.Map.Entry Text BootModules.ROM.Type
let compile =
- λ ( addressType
- : Text
- )
+ λ(addressType : Text)
→ λ(rom : Prelude.Map.Type Text BootModules.ROM.Type)
- → let NaturalIndex =
- { index : Natural, value : Text }
-
+ → let NaturalIndex = { index : Natural, value : Text }
+
let TextIndex = { index : Text, value : Text }
-
+
let moduleKeys = Prelude.Map.keys Text BootModules.ROM.Type rom
-
+
let moduleValues =
let f =
λ(e : RomEntry)
@@ -28,14 +25,14 @@ let compile =
, RomPath = λ(path : Text) → ".incbin ${Text/show path}"
}
e.mapValue
-
+
in Prelude.List.map RomEntry Text f rom
-
+
let map =
λ(list : List Text)
→ λ(f : TextIndex → Text)
→ let indexedNatural = Prelude.List.indexed Text list
-
+
let indexed =
Prelude.List.map
NaturalIndex
@@ -46,30 +43,28 @@ let compile =
}
)
indexedNatural
-
+
let texts = Prelude.List.map TextIndex Text f indexed
-
+
in Prelude.Text.concatSep "\n" texts
-
+
let mapNames = map moduleKeys
-
+
let mapValues = map moduleValues
-
+
in ''
.set MIN_PAGE_SIZE_LOG2, 12
.set DATA_ACCESS_ALIGNM_LOG2, 3
-
+
.section .data
-
+
.p2align DATA_ACCESS_ALIGNM_LOG2
.global _boot_modules_headers_begin
_boot_modules_headers_begin:
-
+
''
++ mapNames
- ( λ ( m
- : TextIndex
- )
+ ( λ(m : TextIndex)
→ ''
${addressType} _boot_module_${m.index}_name
${addressType} _boot_module_${m.index}_begin
@@ -79,7 +74,7 @@ let compile =
++ ''
.global _boot_modules_headers_end
_boot_modules_headers_end:
-
+
''
++ mapNames
( λ(m : TextIndex)
@@ -88,15 +83,15 @@ let compile =
_boot_module_${m.index}_name:
.string "${m.value}"
.byte 0
-
+
''
)
++ ''
.section .data.boot_modules_binaries
-
+
.global _boot_modules_binaries_begin
_boot_modules_binaries_begin:
-
+
''
++ mapValues
( λ(m : TextIndex)
diff --git a/apps/nova-image/default.nix b/apps/nova-image/default.nix
index 5f3f8d2..8f281de 100644
--- a/apps/nova-image/default.nix
+++ b/apps/nova-image/default.nix
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: CC0-1.0
-{ stdenv, nixpkgs, dhallApps, packages }:
+{ stdenv, nixpkgs, apps, packages }:
let inherit (packages) genodeSources base-nova;
in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
@@ -16,17 +16,16 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
TMPDIR="$(${coreutils}/bin/mktemp -d)"
trap "rm -rf $TMPDIR" err exit
- export DHALL_PRELUDE=${packages.dhallPrelude}/package.dhall
- export DHALL_GENODE=${packages.dhallGenode}/package.dhall
+ export DHALL_GENODE=${packages.dhallGenode}/source.dhall
- ${dhallApps.dhall.program} text \
+ ${apps.dhall.program} text \
<<< "(env:DHALL_GENODE).Init.render ($@).config" \
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
-schema ${packages.genodeSources}/repos/os/src/init/config.xsd - \
| sed 's/>/>/g' \
> $TMPDIR/config
- ${dhallApps.dhall.program} text \
+ ${apps.dhall.program} text \
<<< "(${../modules.as.dhall}).to64bitImage (${
../insert-config-rom.dhall
} \"$TMPDIR/config\" ($@).rom)" \
diff --git a/apps/render-init/default.nix b/apps/render-init/default.nix
index 1317c0a..174704f 100644
--- a/apps/render-init/default.nix
+++ b/apps/render-init/default.nix
@@ -1,13 +1,12 @@
# SPDX-License-Identifier: CC0-1.0
-{ nixpkgs, dhallApps, packages }:
+{ nixpkgs, apps, packages }:
nixpkgs.writeScriptBin "render-init" (with nixpkgs.buildPackages; ''
#!${runtimeShell}
set -eu
- export DHALL_PRELUDE=''${DHALL_PRELUDE:-${packages.dhallPrelude}/package.dhall}
- export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/package.dhall}
- ${dhallApps.dhall.program} text \
+ export DHALL_GENODE=''${DHALL_GENODE:-${packages.dhallGenode}/source.dhall}
+ ${apps.dhall.program} text \
<<< "(env:DHALL_GENODE).Init.render ($(cat))" \
| ${nixpkgs.buildPackages.libxml2}/bin/xmllint \
-format \
diff --git a/apps/render-rom.dhall b/apps/render-rom.dhall
index ba432a5..f30a60c 100644
--- a/apps/render-rom.dhall
+++ b/apps/render-rom.dhall
@@ -8,7 +8,7 @@ let render =
Genode.BootModules.toRomTexts
(toMap { config = Genode.Init.render boot.config })
# boot.rom
-
+
in rom
in render
diff --git a/compositions/pc-drivers.dhall b/compositions/pc-drivers.dhall
index 5982ada..4b9ef3b 100644
--- a/compositions/pc-drivers.dhall
+++ b/compositions/pc-drivers.dhall
@@ -26,236 +26,238 @@ let relabel =
let drivers =
Init::{
, services =
- [ ServiceRoute.child "Framebuffer" "dynamic"
- , ServiceRoute.child "Block" "dynamic"
- , ServiceRoute.child "Usb" "usb_drv"
- , ServiceRoute.child "Platform" "platform_drv"
- , ServiceRoute.child "Input" "input_filter"
- , ServiceRoute.child "Rtc" "rtc"
- ]
- , children =
- toMap
- { rtc =
- Child.flat
- Child.Attributes::{
- , binary = "rtc_drv"
- , provides = [ "Rtc" ]
- , routes =
- [ ServiceRoute.parent "IO_PORT"
- , ServiceRoute.parent "IO_MEM"
- ]
+ [ ServiceRoute.child "Framebuffer" "dynamic"
+ , ServiceRoute.child "Block" "dynamic"
+ , ServiceRoute.child "Usb" "usb_drv"
+ , ServiceRoute.child "Platform" "platform_drv"
+ , ServiceRoute.child "Input" "input_filter"
+ , ServiceRoute.child "Rtc" "rtc"
+ ]
+ , children = toMap
+ { rtc =
+ Child.flat
+ Child.Attributes::{
+ , binary = "rtc_drv"
+ , provides = [ "Rtc" ]
+ , routes =
+ [ ServiceRoute.parent "IO_PORT"
+ , ServiceRoute.parent "IO_MEM"
+ ]
+ }
+ , rom_reporter =
+ Child.flat
+ Child.Attributes::{
+ , binary = "rom_reporter"
+ , config = Init.Config::{
+ , content =
+ [ XML.text
+ ''
+
+
+
+ ''
+ ]
}
- , rom_reporter =
- Child.flat
- Child.Attributes::{
- , binary = "rom_reporter"
- , config =
- Init.Config::{
- , content =
- [ XML.text
- ''
-
-
-
- ''
- ]
- }
- , reportRoms =
- [ label "acpi", label "pci_devices", label "usb_devices" ]
- , routes =
- let routeReportToParent =
- λ(label : Text)
- → ServiceRoute.parentLabel
- "Report"
- (Some label)
- (Some label)
-
- in [ routeReportToParent "acpi"
- , routeReportToParent "pci_devices"
- , routeReportToParent "usb_devices"
- ]
+ , reportRoms =
+ [ label "acpi", label "pci_devices", label "usb_devices" ]
+ , routes =
+ let routeReportToParent =
+ λ(label : Text)
+ → ServiceRoute.parentLabel
+ "Report"
+ (Some label)
+ (Some label)
+
+ in [ routeReportToParent "acpi"
+ , routeReportToParent "pci_devices"
+ , routeReportToParent "usb_devices"
+ ]
+ }
+ , acpi_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "acpi_drv"
+ , priority = 1
+ , resources = Resources::{
+ , caps = 350
+ , ram = Genode.units.MiB 4
}
- , acpi_drv =
- Child.flat
- Child.Attributes::{
- , binary = "acpi_drv"
- , priority = 1
- , resources =
- Resources::{ caps = 350, ram = Genode.units.MiB 4 }
- , romReports = [ label "acpi" ]
- , routes =
- [ ServiceRoute.parent "IO_MEM"
- , ServiceRoute.parentLabel
- "Report"
- (Some "smbios_table")
- (Some "smbios_table")
- ]
+ , romReports = [ label "acpi" ]
+ , routes =
+ [ ServiceRoute.parent "IO_MEM"
+ , ServiceRoute.parentLabel
+ "Report"
+ (Some "smbios_table")
+ (Some "smbios_table")
+ ]
+ }
+ , platform_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "platform_drv"
+ , resources = Resources::{
+ , caps = 400
+ , ram = Genode.units.MiB 4
+ , constrainPhys = True
}
- , platform_drv =
- Child.flat
- Child.Attributes::{
- , binary = "platform_drv"
- , resources =
- Resources::{
- , caps = 400
- , ram = Genode.units.MiB 4
- , constrainPhys = True
- }
- , provides = [ "Acpi", "Platform" ]
- , reportRoms = [ label "acpi" ]
- , romReports = [ relabel "pci" "pci_devices" ]
- , routes =
- [ ServiceRoute.parent "IRQ"
- , ServiceRoute.parent "IO_MEM"
- , ServiceRoute.parent "IO_PORT"
- , ServiceRoute.parent "Timer"
- , ServiceRoute.parentLabel
- "ROM"
- (Some "system")
- (Some "system")
- ]
- , config =
- Init.Config::{
- , attributes = toMap { system = "yes" }
- , content =
- [ XML.text
- ''
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ''
- ]
- }
+ , provides = [ "Acpi", "Platform" ]
+ , reportRoms = [ label "acpi" ]
+ , romReports = [ relabel "pci" "pci_devices" ]
+ , routes =
+ [ ServiceRoute.parent "IRQ"
+ , ServiceRoute.parent "IO_MEM"
+ , ServiceRoute.parent "IO_PORT"
+ , ServiceRoute.parent "Timer"
+ , ServiceRoute.parentLabel
+ "ROM"
+ (Some "system")
+ (Some "system")
+ ]
+ , config = Init.Config::{
+ , attributes = toMap { system = "yes" }
+ , content =
+ [ XML.text
+ ''
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ''
+ ]
}
- , usb_drv =
- Child.flat
- Child.Attributes::{
- , binary = "usb_drv"
- , priority = 1
- , resources =
- Resources::{ caps = 200, ram = Genode.units.MiB 16 }
- , provides = [ "Input", "Usb" ]
- , reportRoms = [ relabel "config" "usb_drv.config" ]
- , romReports = [ relabel "devices" "usb_devices" ]
- , routes =
- [ ServiceRoute.child "Platform" "platform_drv"
- , ServiceRoute.parentLabel
- "Report"
- (Some "config")
- (Some "usb_active_config")
- , ServiceRoute.parent "Timer"
- ]
+ }
+ , usb_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "usb_drv"
+ , priority = 1
+ , resources = Resources::{
+ , caps = 200
+ , ram = Genode.units.MiB 16
}
- , ps2_drv =
- Child.flat
- Child.Attributes::{
- , binary = "ps2_drv"
- , provides = [ "Input" ]
- , routes =
- [ ServiceRoute.child "Platform" "platform_drv"
- , ServiceRoute.parent "Timer"
- ]
+ , provides = [ "Input", "Usb" ]
+ , reportRoms = [ relabel "config" "usb_drv.config" ]
+ , romReports = [ relabel "devices" "usb_devices" ]
+ , routes =
+ [ ServiceRoute.child "Platform" "platform_drv"
+ , ServiceRoute.parentLabel
+ "Report"
+ (Some "config")
+ (Some "usb_active_config")
+ , ServiceRoute.parent "Timer"
+ ]
+ }
+ , ps2_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "ps2_drv"
+ , provides = [ "Input" ]
+ , routes =
+ [ ServiceRoute.child "Platform" "platform_drv"
+ , ServiceRoute.parent "Timer"
+ ]
+ }
+ , input_filter =
+ Child.flat
+ Child.Attributes::{
+ , binary = "input_filter"
+ , priority = 1
+ , resources = Resources::{ ram = Genode.units.MiB 2 }
+ , provides = [ "Input" ]
+ , routes =
+ [ ServiceRoute.parent "Timer"
+ , ServiceRoute.parentLabel
+ "ROM"
+ (Some "config")
+ (Some "input_filter.config")
+ , ServiceRoute.childLabel
+ "Input"
+ "ps2_drv"
+ (Some "ps2")
+ (None Text)
+ , ServiceRoute.childLabel
+ "Input"
+ "usb_drv"
+ (Some "usb")
+ (None Text)
+ ]
+ }
+ , driver_manager =
+ Child.flat
+ Child.Attributes::{
+ , binary = "driver_manager"
+ , priority = 1
+ , reportRoms =
+ [ label "ahci_ports"
+ , label "nvme_ns"
+ , label "pci_devices"
+ , label "usb_devices"
+ ]
+ , romReports =
+ [ relabel "init.config" "dynamic.config"
+ , label "usb_drv.config"
+ ]
+ , routes =
+ [ ServiceRoute.parentLabel
+ "Report"
+ (Some "block_devices")
+ (Some "block_devices")
+ , ServiceRoute.parentLabel
+ "ROM"
+ (Some "usb_policy")
+ (Some "usb_policy")
+ ]
+ }
+ , dynamic =
+ Child.flat
+ Child.Attributes::{
+ , binary = "init"
+ , priority = 1
+ , resources = Resources::{
+ , caps = 1400
+ , ram = Genode.units.MiB 64
}
- , input_filter =
- Child.flat
- Child.Attributes::{
- , binary = "input_filter"
- , priority = 1
- , resources = Resources::{ ram = Genode.units.MiB 2 }
- , provides = [ "Input" ]
- , routes =
- [ ServiceRoute.parent "Timer"
- , ServiceRoute.parentLabel
- "ROM"
- (Some "config")
- (Some "input_filter.config")
- , ServiceRoute.childLabel
- "Input"
- "ps2_drv"
- (Some "ps2")
- (None Text)
- , ServiceRoute.childLabel
- "Input"
- "usb_drv"
- (Some "usb")
- (None Text)
- ]
- }
- , driver_manager =
- Child.flat
- Child.Attributes::{
- , binary = "driver_manager"
- , priority = 1
- , reportRoms =
- [ label "ahci_ports"
- , label "nvme_ns"
- , label "pci_devices"
- , label "usb_devices"
- ]
- , romReports =
- [ relabel "init.config" "dynamic.config"
- , label "usb_drv.config"
- ]
- , routes =
- [ ServiceRoute.parentLabel
- "Report"
- (Some "block_devices")
- (Some "block_devices")
- , ServiceRoute.parentLabel
- "ROM"
- (Some "usb_policy")
- (Some "usb_policy")
- ]
- }
- , dynamic =
- Child.flat
- Child.Attributes::{
- , binary = "init"
- , priority = 1
- , resources =
- Resources::{ caps = 1400, ram = Genode.units.MiB 64 }
- , provides = [ "Framebuffer", "Block" ]
- , romReports = [ label "ahci_ports", label "nvme_ns" ]
- , reportRoms = [ relabel "config" "dynamic.config" ]
- , routes =
- [ ServiceRoute.child "Platform" "platform_drv"
- , ServiceRoute.child "Usb" "usb_drv"
- , ServiceRoute.parent "Timer"
- , ServiceRoute.parent "Report"
- , ServiceRoute.parent "IO_MEM"
- , ServiceRoute.parent "IO_PORT"
- ]
- }
- }
+ , provides = [ "Framebuffer", "Block" ]
+ , romReports = [ label "ahci_ports", label "nvme_ns" ]
+ , reportRoms = [ relabel "config" "dynamic.config" ]
+ , routes =
+ [ ServiceRoute.child "Platform" "platform_drv"
+ , ServiceRoute.child "Usb" "usb_drv"
+ , ServiceRoute.parent "Timer"
+ , ServiceRoute.parent "Report"
+ , ServiceRoute.parent "IO_MEM"
+ , ServiceRoute.parent "IO_PORT"
+ ]
+ }
+ }
}
in drivers
diff --git a/flake.lock b/flake.lock
index fae53d4..02b848c 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,58 +1,5 @@
{
- "inputs": {
- "dhall-haskell": {
- "info": {
- "narHash": "sha256-KJl9ZLcMcEsLSPcwcWoc0Ac74/6HKC9LkVMeLwhyhlg="
- },
- "inputs": {
- "nixpkgs": {
- "info": {
- "narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY="
- },
- "inputs": {},
- "locked": {
- "ref": "18.09-beta",
- "rev": "1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
- "type": "git",
- "url": "https://github.com/nixos/nixpkgs.git"
- },
- "original": {
- "ref": "18.09-beta",
- "rev": "1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
- "type": "git",
- "url": "https://github.com/nixos/nixpkgs.git"
- }
- },
- "nixpkgsStaticLinux": {
- "info": {
- "narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8="
- },
- "inputs": {},
- "locked": {
- "ref": "static-haskell-nix-stack-dhall-working",
- "rev": "925aac04f4ca58aceb83beef18cb7dae0715421b",
- "type": "git",
- "url": "https://github.com/nh2/nixpkgs.git"
- },
- "original": {
- "ref": "static-haskell-nix-stack-dhall-working",
- "type": "git",
- "url": "https://github.com/nh2/nixpkgs.git"
- }
- }
- },
- "locked": {
- "ref": "flake",
- "rev": "aea28adf3d10ff1982aa4ddd176d1476251b932f",
- "type": "git",
- "url": "https://github.com/dhall-lang/dhall-haskell"
- },
- "original": {
- "ref": "flake",
- "type": "git",
- "url": "https://github.com/dhall-lang/dhall-haskell"
- }
- },
+ "nodes": {
"genode-depot": {
"info": {
"lastModified": 1584019323,
@@ -60,23 +7,7 @@
"revCount": 8
},
"inputs": {
- "nixpkgs": {
- "info": {
- "lastModified": 1584015812,
- "narHash": "sha256-oDj4g9nL3fp3xh0jAPZSHiucDxkLXA/rO3uM8L6kE0Y="
- },
- "inputs": {},
- "locked": {
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "a3735dcbd7b2530ae3bcf73fd91e1ca6aa9449e7",
- "type": "github"
- },
- "original": {
- "id": "nixpkgs",
- "type": "indirect"
- }
- }
+ "nixpkgs": "nixpkgs"
},
"locked": {
"ref": "master",
@@ -90,11 +21,43 @@
}
},
"nixpkgs": {
+ "info": {
+ "lastModified": 1584015812,
+ "narHash": "sha256-oDj4g9nL3fp3xh0jAPZSHiucDxkLXA/rO3uM8L6kE0Y="
+ },
+ "locked": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "a3735dcbd7b2530ae3bcf73fd91e1ca6aa9449e7",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "nixpkgsUpstream": {
+ "info": {
+ "lastModified": 1584464280,
+ "narHash": "sha256-ovYhaoANbsuIRik2zOe5Sxhn0eu5PnExP4IhAJxRUW0="
+ },
+ "locked": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "7806df1e5f5d49864d917497a4cd2f5ec1a359f8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "nixpkgs_2": {
"info": {
"lastModified": 1583160598,
"narHash": "sha256-jiBSr7JK/xy7pIXFVhjdxpWy0pudDDRDW5XjzmDXPjA="
},
- "inputs": {},
"locked": {
"owner": "ehmry",
"repo": "nixpkgs",
@@ -106,7 +69,15 @@
"repo": "nixpkgs",
"type": "github"
}
+ },
+ "root": {
+ "inputs": {
+ "genode-depot": "genode-depot",
+ "nixpkgs": "nixpkgs_2",
+ "nixpkgsUpstream": "nixpkgsUpstream"
+ }
}
},
- "version": 4
+ "root": "root",
+ "version": 5
}
diff --git a/flake.nix b/flake.nix
index 7225c7f..f8091ea 100644
--- a/flake.nix
+++ b/flake.nix
@@ -6,13 +6,12 @@
description = "Genode packages";
inputs = {
- dhall-haskell.uri =
- "git+https://github.com/dhall-lang/dhall-haskell?ref=flake";
genode-depot.uri = "git+https://git.sr.ht/~ehmry/genode-depot";
nixpkgs.uri = "github:ehmry/nixpkgs";
+ nixpkgsUpstream.uri = "github:NixOS/nixpkgs";
};
- outputs = { self, dhall-haskell, genode-depot, nixpkgs }:
+ outputs = { self, genode-depot, nixpkgs, nixpkgsUpstream }:
let
mkOutput = { system, localSystem, crossSystem }:
let thisSystem = builtins.getAttr system;
@@ -20,7 +19,7 @@
lib = (nixpkgs.lib) // (import ./lib {
inherit system localSystem crossSystem;
- inherit nixpkgs dhall-haskell genode-depot;
+ inherit apps nixpkgs genode-depot;
genodepkgs = self;
});
@@ -28,31 +27,29 @@
# pass thru Nixpkgs
packages = import ./packages {
- inherit system legacyPackages;
+ inherit system legacyPackages apps;
+ localPackages = nixpkgsUpstream.legacyPackages.${localSystem};
depot = thisSystem genode-depot.packages;
- apps = self.apps.${localSystem};
- dhallApps = dhall-haskell.apps.${localSystem};
};
devShell = legacyPackages.mkShell {
- nativeBuildInputs = [ dhall-haskell.packages.${localSystem}.dhall ];
- shellHook = ''
- export DHALL_PRELUDE="${packages.dhallPrelude}/package.dhall"
- export DHALL_GENODE="${packages.dhallGenode}/package.dhall"
- '';
+ nativeBuildInputs = [
+ nixpkgs.legacyPackages.${localSystem}.dhall
+ packages.dhallGenode
+ ];
};
apps = import ./apps {
+ self = self.apps.${localSystem};
nixpkgs = legacyPackages;
- dhallApps = dhall-haskell.apps.${localSystem};
+ nixpkgsLocal = nixpkgsUpstream.legacyPackages.${localSystem};
inherit packages;
};
checks = import ./tests {
inherit system localSystem crossSystem;
- apps = dhall-haskell.apps.${localSystem} // apps;
inherit self nixpkgs genode-depot;
- inherit lib;
+ inherit apps lib;
genodepkgs = thisSystem self.packages;
};
diff --git a/lib/default.nix b/lib/default.nix
index c7836b3..9fc69a3 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -1,18 +1,10 @@
# SPDX-License-Identifier: CC0-1.0
-{ system, localSystem, crossSystem, genodepkgs, nixpkgs, dhall-haskell
-, genode-depot }:
+{ system, localSystem, crossSystem, genodepkgs, nixpkgs, genode-depot, apps }:
let
thisSystem = builtins.getAttr system;
- hostPkgs = import nixpkgs {
- system = localSystem;
- overlays = [
- (self: super: {
- inherit (builtins.getAttr localSystem dhall-haskell.packages) dhall;
- })
- ];
- };
+ hostPkgs = nixpkgs.legacyPackages.${localSystem};
testPkgs = thisSystem genodepkgs.packages;
depot = thisSystem genode-depot.packages;
diff --git a/packages/default.nix b/packages/default.nix
index 4784402..9989e21 100644
--- a/packages/default.nix
+++ b/packages/default.nix
@@ -1,12 +1,9 @@
# SPDX-License-Identifier: CC0-1.0
-{ system, legacyPackages, depot, apps, dhallApps }:
+{ system, legacyPackages, localPackages, depot, apps }:
let
- inherit (legacyPackages) callPackage;
-
- dhallPackages = legacyPackages.dhallPackages
- // (callPackage ./dhall { inherit dhallApps; });
+ dhallPackages = import ./dhall { inherit (localPackages) callPackage; };
mkDhallManifest = drv:
legacyPackages.runCommand "${drv.name}.dhall" { inherit drv; }
@@ -90,8 +87,6 @@ in rec {
dhallGenode = dhallPackages.genode;
- dhallPrelude = dhallPackages.prelude;
-
NOVA = legacyPackages.callPackage ./NOVA { };
libc = callPackage' ./libc { inherit depot; };
diff --git a/packages/dhall/default.nix b/packages/dhall/default.nix
index e19587f..6d6e73c 100644
--- a/packages/dhall/default.nix
+++ b/packages/dhall/default.nix
@@ -1,10 +1,7 @@
# SPDX-License-Identifier: CC0-1.0
-{ callPackage, dhallApps }:
+{ callPackage }:
-rec {
- prelude = prelude_11_0_0;
- prelude_11_0_0 = callPackage ./prelude-11.0.0.nix { };
- prelude_9_0_0 = callPackage ./prelude-9.0.0.nix { };
- genode = callPackage ./genode.nix { inherit dhallApps prelude; };
+{
+ genode = callPackage ./genode.nix { };
}
diff --git a/packages/dhall/genode.nix b/packages/dhall/genode.nix
index e4c72e4..02cf499 100644
--- a/packages/dhall/genode.nix
+++ b/packages/dhall/genode.nix
@@ -1,21 +1,19 @@
# SPDX-License-Identifier: CC0-1.0
-{ stdenv, fetchgit, dhallApps, prelude }:
+{ stdenv, fetchgit, dhallPackages }:
-stdenv.mkDerivation {
+dhallPackages.buildDhallPackage {
name = "dhall-genode";
- src = fetchgit {
- url = "https://git.sr.ht/~ehmry/dhall-genode";
- rev = "16cad9fbbee3fbd1c167377c93ee1d60f9d21e37";
- sha256 = "0gjad37zd1kb5dlnkb3m8pd1ibzcc9yqf6vgyv3imffj1vhdl14n";
- };
- DHALL_PRELUDE = prelude + "/package.dhall";
- buildCommand = ''
- export XDG_CACHE_HOME=$TMPDIR
- cp -r $src $out
- chmod +w -R $out
- echo $DHALL_PRELUDE > $out/Prelude.dhall
- find $out -type f -exec \
- ${dhallApps.dhall.program} freeze --all --inplace {} \;
- '';
+
+ code = let
+ src = fetchgit {
+ url = "https://git.sr.ht/~ehmry/dhall-genode";
+ rev = "f05a2dbd8b675757d5d24276feaa66f4e5ab78a7";
+ sha256 = "0l3pjkcd3kajlkdwckggr9l9jxcjrkc86gngpmvfmvl5gkvz12k3";
+ };
+ in src + "/package.dhall";
+
+ dependencies = [ dhallPackages.Prelude."13.0.0" ];
+
+ source = true;
}
diff --git a/packages/dhall/prelude-11.0.0.nix b/packages/dhall/prelude-11.0.0.nix
deleted file mode 100644
index 8d17020..0000000
--- a/packages/dhall/prelude-11.0.0.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-# SPDX-License-Identifier: CC0-1.0
-
-{ stdenvNoCC, lib, fetchgit }:
-
-stdenvNoCC.mkDerivation {
- name = "dhall-prelude";
- version = " 11.0.0";
-
- src = fetchgit {
- url = "https://github.com/dhall-lang/dhall-lang";
- rev = "8098184d17c3aecc82674a7b874077a7641be05a";
- sha256 = "0rdvyxq7mvas82wsfzzpk6imzm8ax4q58l522mx0ks69pacpr3yi";
- };
-
- phases = [ "unpackPhase" "installPhase" ];
-
- installPhase = ''
- cp -r Prelude $out
- '';
-
- meta = {
- license = lib.licenses.bsd3;
- maintainers = with lib.maintainers; [ ehmry ];
- };
-}
diff --git a/packages/dhall/prelude-9.0.0.nix b/packages/dhall/prelude-9.0.0.nix
deleted file mode 100644
index 6cec94f..0000000
--- a/packages/dhall/prelude-9.0.0.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-# SPDX-License-Identifier: CC0-1.0
-
-{ stdenvNoCC, lib, fetchFromGitHub }:
-
-stdenvNoCC.mkDerivation {
- name = "dhall-prelude";
- version = " 10.0.0";
-
- src = fetchFromGitHub {
- owner = "dhall-lang";
- repo = "dhall-lang";
- rev = "ef644a00e77a3c2c6c503e18e65865fd6d74fc2a";
- sha256 = "1md16ri1l6iid2p1zg17n3ap3813v0f43vrbxc280qgxhq617sdk";
- };
-
- phases = [ "unpackPhase" "installPhase" ];
-
- installPhase = ''
- cp -r Prelude $out
- '';
-
- meta = {
- license = lib.licenses.bsd3;
- maintainers = with lib.maintainers; [ ehmry ];
- };
-}
diff --git a/tests/driver-hw.nix b/tests/driver-hw.nix
index b8d8fb0..dd298e7 100644
--- a/tests/driver-hw.nix
+++ b/tests/driver-hw.nix
@@ -45,8 +45,7 @@ let
++ testInputs);
testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
testEnv' = {
- DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
- DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall";
+ DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
MANIFEST = manifest;
XDG_CACHE_HOME = "/tmp";
} // testEnv;
diff --git a/tests/driver-linux.nix b/tests/driver-linux.nix
index cac0821..b0d679a 100644
--- a/tests/driver-linux.nix
+++ b/tests/driver-linux.nix
@@ -42,8 +42,7 @@ let
(with testPkgs; [ base-linux init sotest-producer ] ++ testInputs);
testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
env' = {
- DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
- DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall";
+ DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
MANIFEST = manifest;
XDG_CACHE_HOME = "/tmp";
} // env;
diff --git a/tests/driver-nova.nix b/tests/driver-nova.nix
index 71bbe5b..0aa3b9f 100644
--- a/tests/driver-nova.nix
+++ b/tests/driver-nova.nix
@@ -45,8 +45,7 @@ let
++ testInputs);
testConfig' = "${./test-wrapper.dhall} ${testConfig} (toMap ${manifest})";
testEnv' = {
- DHALL_PRELUDE = "${testPkgs.dhallPrelude}/package.dhall";
- DHALL_GENODE = "${testPkgs.dhallGenode}/package.dhall";
+ DHALL_GENODE = "${testPkgs.dhallGenode}/source.dhall";
MANIFEST = manifest;
XDG_CACHE_HOME = "/tmp";
} // testEnv;
diff --git a/tests/driver_manager.dhall b/tests/driver_manager.dhall
index 5b511d5..172104b 100644
--- a/tests/driver_manager.dhall
+++ b/tests/driver_manager.dhall
@@ -25,78 +25,72 @@ let childRomRoute =
let label = λ(_ : Text) → { local = _, route = _ }
in Genode.Boot::{
- , config =
- Init::{
- , verbose = True
- , children =
- toMap
- { drivers =
- Init.toChild
- drivers
- Init.Attributes::{
- , provides = [ "Block", "Framebuffer", "Input" ]
- , resources = Init.Resources::{ ram = Genode.units.MiB 4 }
- , romReports = [ label "block_devices" ]
- , routes =
- [ parentRomRoute
- "managed/input_filter"
- "input_filter.config"
- , parentRomRoute " numlock_remap" "numlock_remap.config"
- , childRomRoute "dynamic_rom" "capslock"
- , childRomRoute "dynamic_rom" "numlock"
- , childRomRoute "dynamic_rom" "system"
- , ServiceRoute.child "Report" "_report_rom"
- , ServiceRoute.parent "Timer"
- , Genode.Init.ServiceRoute.parent "IRQ"
- , Genode.Init.ServiceRoute.parent "IO_MEM"
- , Genode.Init.ServiceRoute.parent "IO_PORT"
- ]
- }
- , dynamic_rom =
- Child.flat
- Child.Attributes::{
- , binary = "dynamic_rom"
- , resources = Resources::{ ram = Genode.units.MiB 4 }
- , provides = [ "ROM" ]
- , config =
- Genode.Init.Config::{
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
-
-
-
-
- ''
- ]
- }
- }
- , test-driver_manager =
- Child.flat
- Child.Attributes::{
- , binary = "test-driver_manager"
- , config =
- Init.Config::{
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
-
- ''
- ]
- }
- , reportRoms = [ label "block_devices" ]
- , routes =
- [ ServiceRoute.child "Block" "drivers"
- , ServiceRoute.child "Framebuffer" "drivers"
- , ServiceRoute.child "Input" "drivers"
- ]
- }
- }
- }
+ , config = Init::{
+ , verbose = True
+ , children = toMap
+ { drivers =
+ Init.toChild
+ drivers
+ Init.Attributes::{
+ , provides = [ "Block", "Framebuffer", "Input" ]
+ , resources = Init.Resources::{ ram = Genode.units.MiB 4 }
+ , romReports = [ label "block_devices" ]
+ , routes =
+ [ parentRomRoute "managed/input_filter" "input_filter.config"
+ , parentRomRoute " numlock_remap" "numlock_remap.config"
+ , childRomRoute "dynamic_rom" "capslock"
+ , childRomRoute "dynamic_rom" "numlock"
+ , childRomRoute "dynamic_rom" "system"
+ , ServiceRoute.child "Report" "_report_rom"
+ , ServiceRoute.parent "Timer"
+ , Genode.Init.ServiceRoute.parent "IRQ"
+ , Genode.Init.ServiceRoute.parent "IO_MEM"
+ , Genode.Init.ServiceRoute.parent "IO_PORT"
+ ]
+ }
+ , dynamic_rom =
+ Child.flat
+ Child.Attributes::{
+ , binary = "dynamic_rom"
+ , resources = Resources::{ ram = Genode.units.MiB 4 }
+ , provides = [ "ROM" ]
+ , config = Genode.Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+
+
+
+
+ ''
+ ]
+ }
+ }
+ , test-driver_manager =
+ Child.flat
+ Child.Attributes::{
+ , binary = "test-driver_manager"
+ , config = Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+
+ ''
+ ]
+ }
+ , reportRoms = [ label "block_devices" ]
+ , routes =
+ [ ServiceRoute.child "Block" "drivers"
+ , ServiceRoute.child "Framebuffer" "drivers"
+ , ServiceRoute.child "Input" "drivers"
+ ]
+ }
+ }
+ }
, rom =
Genode.Boot.toRomTexts
( toMap
@@ -104,8 +98,7 @@ in Genode.Boot::{
, numlock = ""
, usb_policy = ""
}
- # [ { mapKey =
- "fb_drv.config"
+ # [ { mapKey = "fb_drv.config"
, mapValue =
''
@@ -113,8 +106,7 @@ in Genode.Boot::{
''
}
- , { mapKey =
- "input_filter.config"
+ , { mapKey = "input_filter.config"
, mapValue =
''
diff --git a/tests/log.dhall b/tests/log.dhall
index 5b70fa1..d54d882 100644
--- a/tests/log.dhall
+++ b/tests/log.dhall
@@ -5,22 +5,19 @@ let Genode = env:DHALL_GENODE
let Child = Genode.Init.Child
in Genode.Boot::{
- , config =
- Genode.Init::{
- , children =
- toMap
- { test-log =
- Child.flat
- Child.Attributes::{
- , binary = "test-log"
- , exitPropagate = True
- , resources =
- Genode.Init.Resources::{
- , caps = 500
- , ram = Genode.units.MiB 10
- }
- , routes = [ Genode.Init.ServiceRoute.parent "Timer" ]
- }
- }
- }
+ , config = Genode.Init::{
+ , children = toMap
+ { test-log =
+ Child.flat
+ Child.Attributes::{
+ , binary = "test-log"
+ , exitPropagate = True
+ , resources = Genode.Init.Resources::{
+ , caps = 500
+ , ram = Genode.units.MiB 10
+ }
+ , routes = [ Genode.Init.ServiceRoute.parent "Timer" ]
+ }
+ }
+ }
}
diff --git a/tests/noux.dhall b/tests/noux.dhall
index 2232e75..d9e3e7e 100644
--- a/tests/noux.dhall
+++ b/tests/noux.dhall
@@ -5,47 +5,42 @@ let Genode = env:DHALL_GENODE
let Child = Genode.Init.Child
in Genode.Boot::{
- , config =
- Genode.Init::{
- , children =
- toMap
- { noux =
- Child.flat
- Child.Attributes::{
- , binary = "noux"
- , exitPropagate = True
- , resources =
- Genode.Init.Resources::{
- , caps = 500
- , ram = Genode.units.MiB 10
- }
- , routes = [ Genode.Init.ServiceRoute.parent "Timer" ]
- , config =
- Genode.Init.Config::{
- , attributes =
- toMap
- { stdin = "/script"
- , stdout = "/dev/log"
- , stderr = "/dev/log"
- }
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
-
-
-
- echo "hello world"
-
-
-
-
-
- ''
- ]
- }
- }
- }
- }
+ , config = Genode.Init::{
+ , children = toMap
+ { noux =
+ Child.flat
+ Child.Attributes::{
+ , binary = "noux"
+ , exitPropagate = True
+ , resources = Genode.Init.Resources::{
+ , caps = 500
+ , ram = Genode.units.MiB 10
+ }
+ , routes = [ Genode.Init.ServiceRoute.parent "Timer" ]
+ , config = Genode.Init.Config::{
+ , attributes = toMap
+ { stdin = "/script"
+ , stdout = "/dev/log"
+ , stderr = "/dev/log"
+ }
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+
+
+
+ echo "hello world"
+
+
+
+
+
+ ''
+ ]
+ }
+ }
+ }
+ }
}
diff --git a/tests/pci.dhall b/tests/pci.dhall
index 16246f2..fa458e9 100644
--- a/tests/pci.dhall
+++ b/tests/pci.dhall
@@ -15,65 +15,60 @@ let ServiceRoute = Init.ServiceRoute
let label = λ(_ : Text) → { local = _, route = _ } : Child.Attributes.Label
in Genode.Boot::{
- , config =
- Init::{
- , verbose = True
- , children =
- toMap
- { test-pci =
- Child.flat
- Child.Attributes::{
- , binary = "test-pci"
- , exitPropagate = True
- , resources = Resources::{ ram = Genode.units.MiB 3 }
- , routes = [ ServiceRoute.child "Platform" "platform_drv" ]
- }
- , acpi_drv =
- Child.flat
- Child.Attributes::{
- , binary = "acpi_drv"
- , resources =
- Resources::{
- , caps = 400
- , ram = Genode.units.MiB 4
- , constrainPhys = True
- }
- , provides = [ "Platform", "Acpi" ]
- , romReports = [ label "acpi", label "smbios_table" ]
- , routes =
- [ ServiceRoute.parent "IRQ"
- , ServiceRoute.parent "IO_MEM"
- , ServiceRoute.parent "IO_PORT"
- ]
- }
- , platform_drv =
- Child.flat
- Child.Attributes::{
- , binary = "platform_drv"
- , resources =
- Resources::{
- , caps = 800
- , ram = Genode.units.MiB 4
- , constrainPhys = True
- }
- , reportRoms = [ label "acpi" ]
- , provides = [ "Platform", "Acpi" ]
- , routes =
- [ ServiceRoute.parent "Timer"
- , ServiceRoute.parent "IRQ"
- , ServiceRoute.parent "IO_MEM"
- , ServiceRoute.parent "IO_PORT"
- ]
- , config =
- Init.Config::{
- , content =
- [ XML.text
- ''
-
- ''
- ]
- }
- }
- }
- }
+ , config = Init::{
+ , verbose = True
+ , children = toMap
+ { test-pci =
+ Child.flat
+ Child.Attributes::{
+ , binary = "test-pci"
+ , exitPropagate = True
+ , resources = Resources::{ ram = Genode.units.MiB 3 }
+ , routes = [ ServiceRoute.child "Platform" "platform_drv" ]
+ }
+ , acpi_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "acpi_drv"
+ , resources = Resources::{
+ , caps = 400
+ , ram = Genode.units.MiB 4
+ , constrainPhys = True
+ }
+ , provides = [ "Platform", "Acpi" ]
+ , romReports = [ label "acpi", label "smbios_table" ]
+ , routes =
+ [ ServiceRoute.parent "IRQ"
+ , ServiceRoute.parent "IO_MEM"
+ , ServiceRoute.parent "IO_PORT"
+ ]
+ }
+ , platform_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "platform_drv"
+ , resources = Resources::{
+ , caps = 800
+ , ram = Genode.units.MiB 4
+ , constrainPhys = True
+ }
+ , reportRoms = [ label "acpi" ]
+ , provides = [ "Platform", "Acpi" ]
+ , routes =
+ [ ServiceRoute.parent "Timer"
+ , ServiceRoute.parent "IRQ"
+ , ServiceRoute.parent "IO_MEM"
+ , ServiceRoute.parent "IO_PORT"
+ ]
+ , config = Init.Config::{
+ , content =
+ [ XML.text
+ ''
+
+ ''
+ ]
+ }
+ }
+ }
+ }
}
diff --git a/tests/rtc.dhall b/tests/rtc.dhall
index efa02ef..83c33e4 100644
--- a/tests/rtc.dhall
+++ b/tests/rtc.dhall
@@ -5,27 +5,25 @@ let Genode = env:DHALL_GENODE
let Child = Genode.Init.Child
in Genode.Boot::{
- , config =
- Genode.Init::{
- , children =
- toMap
- { test-rtc =
- Child.flat
- Child.Attributes::{
- , binary = "test-rtc"
- , exitPropagate = True
- , routes =
- [ Genode.Init.ServiceRoute.parent "Timer"
- , Genode.Init.ServiceRoute.child "Rtc" "rtc_drv"
- ]
- }
- , rtc_drv =
- Child.flat
- Child.Attributes::{
- , binary = "rtc_drv"
- , provides = [ "Rtc" ]
- , routes = [ Genode.Init.ServiceRoute.parent "IO_PORT" ]
- }
- }
- }
+ , config = Genode.Init::{
+ , children = toMap
+ { test-rtc =
+ Child.flat
+ Child.Attributes::{
+ , binary = "test-rtc"
+ , exitPropagate = True
+ , routes =
+ [ Genode.Init.ServiceRoute.parent "Timer"
+ , Genode.Init.ServiceRoute.child "Rtc" "rtc_drv"
+ ]
+ }
+ , rtc_drv =
+ Child.flat
+ Child.Attributes::{
+ , binary = "rtc_drv"
+ , provides = [ "Rtc" ]
+ , routes = [ Genode.Init.ServiceRoute.parent "IO_PORT" ]
+ }
+ }
+ }
}
diff --git a/tests/signal.dhall b/tests/signal.dhall
index b606a80..d634a12 100644
--- a/tests/signal.dhall
+++ b/tests/signal.dhall
@@ -7,23 +7,20 @@ let Init = Genode.Init
let Child = Init.Child
in Genode.Boot::{
- , config =
- Init::{
- , children =
- toMap
- { test-signal =
- Child.flat
- Child.Attributes::{
- , binary = "test-signal"
- , exitPropagate = True
- , priority = 5
- , resources =
- Init.Resources::{
- , caps = 500
- , ram = Genode.units.MiB 10
- }
- , routes = [ Init.ServiceRoute.parent "Timer" ]
- }
- }
- }
+ , config = Init::{
+ , children = toMap
+ { test-signal =
+ Child.flat
+ Child.Attributes::{
+ , binary = "test-signal"
+ , exitPropagate = True
+ , priority = 5
+ , resources = Init.Resources::{
+ , caps = 500
+ , ram = Genode.units.MiB 10
+ }
+ , routes = [ Init.ServiceRoute.parent "Timer" ]
+ }
+ }
+ }
}
diff --git a/tests/solo5/blk.dhall b/tests/solo5/blk.dhall
index f6e2dbb..e50e7fa 100644
--- a/tests/solo5/blk.dhall
+++ b/tests/solo5/blk.dhall
@@ -7,34 +7,32 @@ let Init = Genode.Init
let Child = Init.Child
in Genode.Boot::{
- , config =
- Init::{
- , children =
- toMap
- { solo5 =
- Child.flat
- Child.Attributes::{
- , binary = "solo5-test_blk"
- , exitPropagate = True
- , resources =
- Init.Resources::{ caps = 256, ram = Genode.units.MiB 3 }
- , routes =
- [ Init.ServiceRoute.parent "Timer"
- , Init.ServiceRoute.child "Block" "block"
- ]
- }
- , block =
- Child.flat
- Child.Attributes::{
- , binary = "ram_block"
- , provides = [ "Block" ]
- , resources = Init.Resources::{ ram = Genode.units.MiB 9 }
- , config =
- Init.Config::{
- , attributes =
- toMap { size = "8M", block_size = "4096" }
- }
- }
- }
- }
+ , config = Init::{
+ , children = toMap
+ { solo5 =
+ Child.flat
+ Child.Attributes::{
+ , binary = "solo5-test_blk"
+ , exitPropagate = True
+ , resources = Init.Resources::{
+ , caps = 256
+ , ram = Genode.units.MiB 3
+ }
+ , routes =
+ [ Init.ServiceRoute.parent "Timer"
+ , Init.ServiceRoute.child "Block" "block"
+ ]
+ }
+ , block =
+ Child.flat
+ Child.Attributes::{
+ , binary = "ram_block"
+ , provides = [ "Block" ]
+ , resources = Init.Resources::{ ram = Genode.units.MiB 9 }
+ , config = Init.Config::{
+ , attributes = toMap { size = "8M", block_size = "4096" }
+ }
+ }
+ }
+ }
}
diff --git a/tests/solo5/net.dhall b/tests/solo5/net.dhall
index dc557a1..b5a4f9b 100644
--- a/tests/solo5/net.dhall
+++ b/tests/solo5/net.dhall
@@ -11,72 +11,65 @@ let Res = Init.Resources
let ServiceRoute = Init.ServiceRoute
in Genode.Boot::{
- , config =
- Init::{
- , children =
- toMap
- { nic =
- Child.flat
- Child.Attributes::{
- , binary = "nic_loopback"
- , provides = [ "Nic" ]
- }
- , bridge =
- Child.flat
- Child.Attributes::{
- , binary = "nic_bridge"
- , resources = Res::{ caps = 200, ram = Genode.units.MiB 6 }
- , provides = [ "Nic" ]
- , routes = [ ServiceRoute.child "Nic" "nic" ]
- , config =
- Init.Config::{
- , attributes = toMap { mac = "02:02:02:02:03:00" }
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
- ''
- ]
- }
- }
- , solo5 =
- Child.flat
- Child.Attributes::{
- , binary = "solo5-test_net"
- , resources = Res::{ caps = 256, ram = Genode.units.MiB 3 }
- , routes =
- [ ServiceRoute.parent "Timer"
- , ServiceRoute.child "Nic" "bridge"
- ]
- , config =
- Init.Config::{
- , content =
- [ Genode.Prelude.XML.text "limit"
- ]
- }
- }
- , ping =
- Child.flat
- Child.Attributes::{
- , binary = "ping"
- , exitPropagate = True
- , resources = Res::{ caps = 128, ram = Genode.units.MiB 6 }
- , routes =
- [ ServiceRoute.parent "Timer"
- , ServiceRoute.child "Nic" "bridge"
- ]
- , config =
- Init.Config::{
- , attributes =
- toMap
- { interface = "10.0.0.72/24"
- , dst_ip = "10.0.0.2"
- , period_sec = "1"
- , verbose = "no"
- }
- }
- }
- }
- }
+ , config = Init::{
+ , children = toMap
+ { nic =
+ Child.flat
+ Child.Attributes::{
+ , binary = "nic_loopback"
+ , provides = [ "Nic" ]
+ }
+ , bridge =
+ Child.flat
+ Child.Attributes::{
+ , binary = "nic_bridge"
+ , resources = Res::{ caps = 200, ram = Genode.units.MiB 6 }
+ , provides = [ "Nic" ]
+ , routes = [ ServiceRoute.child "Nic" "nic" ]
+ , config = Init.Config::{
+ , attributes = toMap { mac = "02:02:02:02:03:00" }
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+ ''
+ ]
+ }
+ }
+ , solo5 =
+ Child.flat
+ Child.Attributes::{
+ , binary = "solo5-test_net"
+ , resources = Res::{ caps = 256, ram = Genode.units.MiB 3 }
+ , routes =
+ [ ServiceRoute.parent "Timer"
+ , ServiceRoute.child "Nic" "bridge"
+ ]
+ , config = Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text "limit" ]
+ }
+ }
+ , ping =
+ Child.flat
+ Child.Attributes::{
+ , binary = "ping"
+ , exitPropagate = True
+ , resources = Res::{ caps = 128, ram = Genode.units.MiB 6 }
+ , routes =
+ [ ServiceRoute.parent "Timer"
+ , ServiceRoute.child "Nic" "bridge"
+ ]
+ , config = Init.Config::{
+ , attributes = toMap
+ { interface = "10.0.0.72/24"
+ , dst_ip = "10.0.0.2"
+ , period_sec = "1"
+ , verbose = "no"
+ }
+ }
+ }
+ }
+ }
}
diff --git a/tests/solo5/net_2if.dhall b/tests/solo5/net_2if.dhall
index b8e9c3b..8a9a337 100644
--- a/tests/solo5/net_2if.dhall
+++ b/tests/solo5/net_2if.dhall
@@ -9,81 +9,76 @@ let Child = Init.Child
let Res = Init.Resources
in Genode.Boot::{
- , config =
- Init::{
- , children =
- toMap
- { nic =
- Child.flat
- Child.Attributes::{
- , binary = "nic_loopback"
- , provides = [ "Nic" ]
- }
- , bridge =
- Child.flat
- Child.Attributes::{
- , binary = "nic_bridge"
- , resources = Res::{ caps = 200, ram = Genode.units.MiB 8 }
- , provides = [ "Nic" ]
- , routes = [ Genode.Init.ServiceRoute.child "Nic" "nic" ]
- , config =
- Init.Config::{
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
-
- ''
- ]
- }
- }
- , solo5 =
- Child.flat
- Child.Attributes::{
- , binary = "solo5-test_net_2if"
- , resources = Res::{ caps = 256, ram = Genode.units.MiB 5 }
- , routes =
- [ Genode.Init.ServiceRoute.parent "Timer"
- , Genode.Init.ServiceRoute.child "Nic" "bridge"
- ]
- , config =
- Init.Config::{
- , content =
- [ Genode.Prelude.XML.text
- ''
- "limit"
- ''
- ]
- }
- }
- , clients =
- Child.flat
- Child.Attributes::{
- , binary = "sequence"
- , exitPropagate = True
- , resources = Res::{ caps = 256, ram = Genode.units.MiB 8 }
- , routes =
- [ Genode.Init.ServiceRoute.parent "Timer"
- , Genode.Init.ServiceRoute.child "Nic" "bridge"
- ]
- , config =
- Init.Config::{
- , content =
- [ Genode.Prelude.XML.text
- ''
-
-
-
-
-
-
-
-
- ''
- ]
- }
- }
- }
- }
+ , config = Init::{
+ , children = toMap
+ { nic =
+ Child.flat
+ Child.Attributes::{
+ , binary = "nic_loopback"
+ , provides = [ "Nic" ]
+ }
+ , bridge =
+ Child.flat
+ Child.Attributes::{
+ , binary = "nic_bridge"
+ , resources = Res::{ caps = 200, ram = Genode.units.MiB 8 }
+ , provides = [ "Nic" ]
+ , routes = [ Genode.Init.ServiceRoute.child "Nic" "nic" ]
+ , config = Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+
+ ''
+ ]
+ }
+ }
+ , solo5 =
+ Child.flat
+ Child.Attributes::{
+ , binary = "solo5-test_net_2if"
+ , resources = Res::{ caps = 256, ram = Genode.units.MiB 5 }
+ , routes =
+ [ Genode.Init.ServiceRoute.parent "Timer"
+ , Genode.Init.ServiceRoute.child "Nic" "bridge"
+ ]
+ , config = Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+ "limit"
+ ''
+ ]
+ }
+ }
+ , clients =
+ Child.flat
+ Child.Attributes::{
+ , binary = "sequence"
+ , exitPropagate = True
+ , resources = Res::{ caps = 256, ram = Genode.units.MiB 8 }
+ , routes =
+ [ Genode.Init.ServiceRoute.parent "Timer"
+ , Genode.Init.ServiceRoute.child "Nic" "bridge"
+ ]
+ , config = Init.Config::{
+ , content =
+ [ Genode.Prelude.XML.text
+ ''
+
+
+
+
+
+
+
+
+ ''
+ ]
+ }
+ }
+ }
+ }
}
diff --git a/tests/solo5/simple.dhall b/tests/solo5/simple.dhall
index 4aaad5d..fb3ba5b 100644
--- a/tests/solo5/simple.dhall
+++ b/tests/solo5/simple.dhall
@@ -12,32 +12,28 @@ let Config = Init.Config
in λ(testBinary : Text)
→ Genode.Boot::{
- , config =
- Init::{
- , children =
- toMap
- { solo5 =
- Child.flat
- Child.Attributes::{
- , binary = testBinary
- , exitPropagate = True
- , resources =
- Init.Resources::{
- , caps = 256
- , ram = Genode.units.MiB 3
+ , config = Init::{
+ , children = toMap
+ { solo5 =
+ Child.flat
+ Child.Attributes::{
+ , binary = testBinary
+ , exitPropagate = True
+ , resources = Init.Resources::{
+ , caps = 256
+ , ram = Genode.units.MiB 3
+ }
+ , config = Config::{
+ , content =
+ [ Prelude.XML.element
+ { name = "cmdline"
+ , attributes = Prelude.XML.emptyAttributes
+ , content = [ Prelude.XML.text "Hello_Solo5" ]
}
- , config =
- Config::{
- , content =
- [ Prelude.XML.element
- { name = "cmdline"
- , attributes = Prelude.XML.emptyAttributes
- , content = [ Prelude.XML.text "Hello_Solo5" ]
- }
- ]
- }
- , routes = [ Init.ServiceRoute.parent "Timer" ]
- }
- }
- }
+ ]
+ }
+ , routes = [ Init.ServiceRoute.parent "Timer" ]
+ }
+ }
+ }
}
diff --git a/tests/solo5/time.dhall b/tests/solo5/time.dhall
index fa2b11c..87a62a8 100644
--- a/tests/solo5/time.dhall
+++ b/tests/solo5/time.dhall
@@ -5,32 +5,29 @@ let Genode = env:DHALL_GENODE
let Child = Genode.Init.Child
in Genode.Boot::{
- , config =
- Genode.Init::{
- , children =
- toMap
- { solo5 =
- Child.flat
- Child.Attributes::{
- , binary = "solo5-test_time"
- , exitPropagate = True
- , resources =
- Genode.Init.Resources::{
- , caps = 256
- , ram = Genode.units.MiB 3
- }
- , routes =
- [ Genode.Init.ServiceRoute.parent "Timer"
- , Genode.Init.ServiceRoute.child "Rtc" "clock"
- ]
- }
- , clock =
- Child.flat
- Child.Attributes::{
- , binary = "rtc_drv"
- , provides = [ "Rtc" ]
- , routes = [ Genode.Init.ServiceRoute.parent "IO_PORT" ]
- }
- }
- }
+ , config = Genode.Init::{
+ , children = toMap
+ { solo5 =
+ Child.flat
+ Child.Attributes::{
+ , binary = "solo5-test_time"
+ , exitPropagate = True
+ , resources = Genode.Init.Resources::{
+ , caps = 256
+ , ram = Genode.units.MiB 3
+ }
+ , routes =
+ [ Genode.Init.ServiceRoute.parent "Timer"
+ , Genode.Init.ServiceRoute.child "Rtc" "clock"
+ ]
+ }
+ , clock =
+ Child.flat
+ Child.Attributes::{
+ , binary = "rtc_drv"
+ , provides = [ "Rtc" ]
+ , routes = [ Genode.Init.ServiceRoute.parent "IO_PORT" ]
+ }
+ }
+ }
}
diff --git a/tests/sotest_config.dhall b/tests/sotest_config.dhall
index 373ad56..ec6295e 100644
--- a/tests/sotest_config.dhall
+++ b/tests/sotest_config.dhall
@@ -1,8 +1,8 @@
{ boot_items =
- [ { exec = "bender"
- , load = [ "hypervisor serial novga iommu", "image.elf" ]
- , name = "NOVA with Genode"
- }
- ]
+ [ { exec = "bender"
+ , load = [ "hypervisor serial novga iommu", "image.elf" ]
+ , name = "NOVA with Genode"
+ }
+ ]
, boot_panic_patterns = [ "Error: init", "PAGE-FAULT IN CORE" ]
}
diff --git a/tests/sotest_hw_config.dhall b/tests/sotest_hw_config.dhall
index 8021f2e..809fc41 100644
--- a/tests/sotest_hw_config.dhall
+++ b/tests/sotest_hw_config.dhall
@@ -1,4 +1,4 @@
{ boot_items =
- [ { exec = "bender", load = [ "image.elf" ], name = "Genode base-hw" } ]
+ [ { exec = "bender", load = [ "image.elf" ], name = "Genode base-hw" } ]
, boot_panic_patterns = [ "Error: init", "PAGE-FAULT IN CORE" ]
}
diff --git a/tests/test-wrapper.dhall b/tests/test-wrapper.dhall
index dc85dd3..b303c5e 100644
--- a/tests/test-wrapper.dhall
+++ b/tests/test-wrapper.dhall
@@ -17,15 +17,15 @@ let wrapHarness
, binary = "sotest-harness"
, resources = Init.Resources::{ ram = Genode.units.MiB 4 }
, routes =
- [ Init.ServiceRoute.parentLabel
- "LOG"
- (Some "SOTEST")
- (Some "unlabeled")
- , Init.ServiceRoute.parent "IO_MEM"
- , Init.ServiceRoute.parent "IO_PORT"
- , Init.ServiceRoute.parent "IRQ"
- , Init.ServiceRoute.child "Timer" "timer"
- ]
+ [ Init.ServiceRoute.parentLabel
+ "LOG"
+ (Some "SOTEST")
+ (Some "unlabeled")
+ , Init.ServiceRoute.parent "IO_MEM"
+ , Init.ServiceRoute.parent "IO_PORT"
+ , Init.ServiceRoute.parent "IRQ"
+ , Init.ServiceRoute.child "Timer" "timer"
+ ]
}
let TextMapType = Prelude.Map.Type Text
@@ -33,20 +33,19 @@ let TextMapType = Prelude.Map.Type Text
in λ(boot : Genode.Boot.Type)
→ λ(inputsManifest : TextMapType (TextMapType Text))
→ boot
- ⫽ { config =
- Init::{
- , children =
- [ { mapKey = "timer"
- , mapValue =
- Child.flat
- Child.Attributes::{
- , binary = "timer_drv"
- , provides = [ "Timer" ]
- }
- }
- , { mapKey = "harness", mapValue = wrapHarness boot.config }
- ]
- }
+ ⫽ { config = Init::{
+ , children =
+ [ { mapKey = "timer"
+ , mapValue =
+ Child.flat
+ Child.Attributes::{
+ , binary = "timer_drv"
+ , provides = [ "Timer" ]
+ }
+ }
+ , { mapKey = "harness", mapValue = wrapHarness boot.config }
+ ]
+ }
, rom =
let inputRoms =
Genode.BootModules.toRomPaths
@@ -58,6 +57,6 @@ in λ(boot : Genode.Boot.Type)
inputsManifest
)
)
-
+
in boot.rom # inputRoms
}