Retrieve ROMs in the common case by full store path. This reduces the need for route policies for driving relative requests into absolute package paths. Making library requests by absolute path required libraries to be stored in the core image as such, and it follows that program binaries should be handled in the same way. This makes requests to core and to a file-system store more consistent, and makes dependency detection more robust.
86 lines
2.4 KiB
Nix
86 lines
2.4 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
imports = [ ./ahci.nix ./framebuffer.nix ./nic.nix ./usb.nix ];
|
|
|
|
options.hardware.genode.platform.policies = lib.mkOption {
|
|
type = with types; listOf path;
|
|
default = [ ];
|
|
description = ''
|
|
List of policies to append to the Genode platform driver.
|
|
Type is Init.Config.Policy.Type.
|
|
'';
|
|
};
|
|
|
|
config = {
|
|
|
|
genode.core.basePackages = with pkgs.genodePackages; [
|
|
acpi_drv
|
|
platform_drv
|
|
];
|
|
|
|
genode.core.children.acpi_drv = {
|
|
coreROMs = [ "acpi_drv" ];
|
|
configFile = pkgs.writeText "acpi_drv.dhall" ''
|
|
let Genode = env:DHALL_GENODE
|
|
|
|
let Init = Genode.Init
|
|
|
|
let label = λ(_ : Text) → { local = _, route = _ }
|
|
|
|
in Init.Child.flat
|
|
Init.Child.Attributes::{
|
|
, binary = "${pkgs.genodePackages.acpi_drv}/bin/acpi_drv"
|
|
, resources = Init.Resources::{
|
|
, caps = 400
|
|
, ram = Genode.units.MiB 4
|
|
, constrainPhys = True
|
|
}
|
|
, romReports = [ label "acpi", label "smbios_table" ]
|
|
, routes =
|
|
[ Init.ServiceRoute.parent "IRQ"
|
|
, Init.ServiceRoute.parent "IO_MEM"
|
|
, Init.ServiceRoute.parent "IO_PORT"
|
|
]
|
|
}
|
|
'';
|
|
};
|
|
|
|
genode.core.children.platform_drv = {
|
|
coreROMs = [ "platform_drv" ];
|
|
configFile = let
|
|
policies =
|
|
map (policy: ", ${policy}") config.hardware.genode.platform.policies;
|
|
in pkgs.writeText "platform_drv.dhall" ''
|
|
let Genode = env:DHALL_GENODE
|
|
|
|
let Init = Genode.Init
|
|
|
|
in Init.Child.flat
|
|
Init.Child.Attributes::{
|
|
, binary = "${pkgs.genodePackages.platform_drv}/bin/platform_drv"
|
|
, resources = Init.Resources::{
|
|
, caps = 800
|
|
, ram = Genode.units.MiB 4
|
|
, constrainPhys = True
|
|
}
|
|
, reportRoms = let label = "acpi" in [ { local = label, route = label } ]
|
|
, provides = [ "Platform" ]
|
|
, routes =
|
|
[ Init.ServiceRoute.parent "IRQ"
|
|
, Init.ServiceRoute.parent "IO_MEM"
|
|
, Init.ServiceRoute.parent "IO_PORT"
|
|
]
|
|
, config = Init.Config::{
|
|
, policies = [ ${toString policies} ]
|
|
}
|
|
}
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
}
|