-- SPDX-License-Identifier: CC0-1.0 -- TODO: Move routes passed to toChild into the Init let Genode = env:DHALL_GENODE let Prelude = Genode.Prelude let XML = Prelude.XML let Init = Genode.Init let Child = Init.Child let Resources = Init.Resources let ServiceRoute = Init.ServiceRoute in λ(params : { bash : Text, coreutils : Text, path : Text }) → let init = Init::{ , verbose = True , routes = Prelude.List.map Text Init.ServiceRoute.Type Init.ServiceRoute.parent [ "Nitpicker", "Rtc", "Timer" ] , children = toMap { nit_fb = Child.flat Child.Attributes::{ , binary = "nit_fb" , config = Init.Config::{ , attributes = toMap { xpos = "10" , ypos = "10" , initial_width = "800" , initial_height = "600" } } , exitPropagate = True , provides = [ "Framebuffer", "Input" ] , resources = Resources::{ ram = Genode.units.MiB 8 } } , terminal = Child.flat Child.Attributes::{ , binary = "terminal" , config = Init.Config::{ , content = [ XML.element { name = "vfs" , attributes = XML.emptyAttributes , content = [ XML.element { name = "dir" , attributes = toMap { name = "fonts" } , content = [ XML.leaf { name = "fs" , attributes = toMap { label = "fonts" } } ] } ] } ] } , provides = [ "Terminal" ] , resources = Resources::{ , caps = 256 , ram = Genode.units.MiB 4 } , routes = [ ServiceRoute.child "Framebuffer" "nit_fb" , ServiceRoute.child "Input" "nit_fb" , ServiceRoute.parent "File_system" ] } , vfs = Child.flat Child.Attributes::{ , binary = "vfs" , config = Init.Config::{ , content = [ Prelude.XML.text '' '' ] } , provides = [ "File_system" ] , resources = Resources::{ , caps = 256 , ram = Genode.units.MiB 8 } , routes = [ Init.ServiceRoute.parent "File_system" , Init.ServiceRoute.child "Terminal" "terminal" ] } , store_rom = Child.flat Child.Attributes::{ , binary = "cached_fs_rom" , provides = [ "ROM" ] , resources = Resources::{ , caps = 256 , ram = Genode.units.MiB 4 } , routes = [ Init.ServiceRoute.child "File_system" "vfs" ] } , shell = Child.flat Child.Attributes::{ , binary = "bash" , config = Genode.Init.Config::{ , content = [ Prelude.XML.text '' '' ] # Prelude.List.map Text XML.Type ( λ(x : Text) → XML.leaf { name = "arg" , attributes = toMap { value = x } } ) [ "bash" ] } , exitPropagate = True , resources = Resources::{ , caps = 256 , ram = Genode.units.MiB 8 } , routes = [ Init.ServiceRoute.child "File_system" "vfs" , { service = { name = "ROM" , label = Init.LabelSelector.Type.Partial { prefix = Some "/nix/store/" , suffix = None Text } } , route = Init.Route.Type.Child { name = "store_rom" , label = None Text , diag = None Bool } } ] } } } in Init.toChild init Init.Attributes::{ , routes = [ ServiceRoute.parent "File_system" , ServiceRoute.parent "Nitpicker" , ServiceRoute.parent "Rtc" , ServiceRoute.parent "Timer" ] }