nixos/gui: terminal is now a Gui client

This commit is contained in:
Ehmry - 2021-04-16 13:19:59 +02:00
parent af796dd627
commit fb35449420
2 changed files with 15 additions and 60 deletions

View File

@ -14,12 +14,15 @@ let Resources = Init.Resources
let ServiceRoute = Init.ServiceRoute let ServiceRoute = Init.ServiceRoute
let routeLog =
λ(label : Text) →
ServiceRoute.childLabel "terminal_log" "LOG" (None Text) (Some label)
let routeRom = let routeRom =
λ(label : Text) → ServiceRoute.parentLabel "ROM" (Some "log") (Some label) λ(label : Text) → ServiceRoute.parentLabel "ROM" (Some "log") (Some label)
in λ ( params in λ ( params
: { gui_fb : Text : { fontFile : Text
, fontFile : Text
, log_core : Text , log_core : Text
, terminal : Text , terminal : Text
, terminal_log : Text , terminal_log : Text
@ -30,33 +33,8 @@ in λ ( params
Init.toChild Init.toChild
Init::{ Init::{
, routes = [ Init.ServiceRoute.parent "Timer" ] , routes = [ Init.ServiceRoute.parent "Timer" ]
, children = , children = toMap
[ { mapKey = "gui_fb" { terminal =
, mapValue =
Child.flat
Child.Attributes::{
, binary = params.gui_fb
, exitPropagate = True
, resources = Resources::{ ram = Sigil.units.MiB 8 }
, routes = [ Init.ServiceRoute.parent "Gui" ]
, config = Init.Config::{
, attributes = toMap
{ origin = "top_left", xpos = "0", ypos = "0" }
, policies =
[ Init.Config.Policy::{
, service = "Framebuffer"
, label = Init.LabelSelector.prefix "terminal"
}
, Init.Config.Policy::{
, service = "Input"
, label = Init.LabelSelector.prefix "terminal"
}
]
}
}
}
, { mapKey = "terminal"
, mapValue =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = params.terminal , binary = params.terminal
@ -66,8 +44,7 @@ in λ ( params
, ram = Sigil.units.MiB 4 , ram = Sigil.units.MiB 4
} }
, routes = , routes =
[ ServiceRoute.child "Framebuffer" "gui_fb" [ ServiceRoute.parent "Gui"
, ServiceRoute.child "Input" "gui_fb"
, ServiceRoute.parentLabel , ServiceRoute.parentLabel
"ROM" "ROM"
(Some "vfs_ttf.lib.so") (Some "vfs_ttf.lib.so")
@ -139,44 +116,22 @@ in λ ( params
] ]
} }
} }
} , terminal_log =
, { mapKey = "terminal_log" Child.flat Child.Attributes::{ binary = params.terminal_log }
, mapValue = , core_log =
Child.flat
Child.Attributes::{
, binary = params.terminal_log
, config = Init.Config::{
, policies =
[ Init.Config.Policy::{
, service = "LOG"
, label = Init.LabelSelector.prefix "core_log"
}
, Init.Config.Policy::{
, service = "LOG"
, label = Init.LabelSelector.prefix "kernel_log"
}
]
}
}
}
, { mapKey = "core_log"
, mapValue =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = params.log_core , binary = params.log_core
, priorityOffset = 1 , priorityOffset = 1
, routes = [ routeRom "core_log" ] , routes = [ routeLog "core", routeRom "core_log" ]
} }
} , kernel_log =
, { mapKey = "kernel_log"
, mapValue =
Child.flat Child.flat
Child.Attributes::{ Child.Attributes::{
, binary = params.log_core , binary = params.log_core
, priorityOffset = 1 , priorityOffset = 1
, routes = [ routeRom "kernel_log" ] , routes = [ routeLog "kernel", routeRom "kernel_log" ]
} }
} }
]
} }
Init.Attributes.default Init.Attributes.default

View File

@ -98,7 +98,7 @@ in {
genode.core.children.consoleLog = lib.mkIf cfg.consoleLog.enable (let genode.core.children.consoleLog = lib.mkIf cfg.consoleLog.enable (let
erisInputs = (lib.attrsets.mapAttrs (_: lib.getEris "bin") { erisInputs = (lib.attrsets.mapAttrs (_: lib.getEris "bin") {
inherit (pkgs.genodePackages) gui_fb log_core terminal terminal_log; inherit (pkgs.genodePackages) log_core terminal terminal_log;
}) // (lib.attrsets.mapAttrs (_: lib.getEris "lib") { }) // (lib.attrsets.mapAttrs (_: lib.getEris "lib") {
inherit (pkgs.genodePackages) vfs_ttf; inherit (pkgs.genodePackages) vfs_ttf;
}); });