Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

188 rader
7.5 KiB

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
''
<vfs>
<dir name="dev">
<log name="stderr" label="stderr"/>
<log name="stdout" label="stdout"/>
<null/>
<pipe/>
<rtc/>
<terminal/>
<zero/>
</dir>
<dir name="usr"><dir name="bin"><symlink name="env" target="${params.coreutils}/bin/env"/></dir></dir>
<dir name="tmp"><ram/></dir>
<dir name="nix"><dir name="store"><fs label="nix/store" writeable="no"/></dir></dir>
</vfs>
<default-policy root="/" writeable="yes"/>
''
]
}
, 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
''
<libc stdin="/dev/terminal" stdout="/dev/terminal" stderr="/dev/terminal" pipe="/dev/pipe" rtc="/dev/rtc"/>
<vfs> <fs/> </vfs>
<env key="TERM" value="screen"/>
<env key="PATH" value="${params.path}" />
<env key="PS1" value="system:$PWD> " />
''
]
# 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"
]
}