307 lines
14 KiB
Plaintext
307 lines
14 KiB
Plaintext
let Genode = env:DHALL_GENODE
|
|
|
|
let Prelude = Genode.Prelude
|
|
|
|
let Init = Genode.Init
|
|
|
|
let Child = Init.Child
|
|
|
|
let Config = Init.Config
|
|
|
|
let ServiceRoute = Init.ServiceRoute
|
|
|
|
in λ ( params
|
|
: { isAarch64 : Bool
|
|
, nic_bridge : Text
|
|
, nic_loopback : Text
|
|
, ping : Text
|
|
, sequence : Text
|
|
, solo5Tests : Text
|
|
, vfs_block : Text
|
|
}
|
|
) →
|
|
let toSimple =
|
|
λ(testName : Text) →
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "${params.solo5Tests}/bin/solo5-test_${testName}"
|
|
, 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" ]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
let children =
|
|
toMap
|
|
{ quiet = toSimple "quiet"
|
|
, hello = toSimple "hello"
|
|
, globals = toSimple "globals"
|
|
, time =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "${params.solo5Tests}/bin/solo5-test_time"
|
|
, exitPropagate = True
|
|
, resources = Init.Resources::{
|
|
, caps = 256
|
|
, ram = Genode.units.MiB 3
|
|
}
|
|
}
|
|
, blk =
|
|
let init =
|
|
Init::{
|
|
, children = toMap
|
|
{ solo5 =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.solo5Tests}/bin/solo5-test_blk"
|
|
, exitPropagate = True
|
|
, resources = Init.Resources::{
|
|
, caps = 256
|
|
, ram = Genode.units.MiB 3
|
|
}
|
|
, routes = [ ServiceRoute.parent "Timer" ]
|
|
}
|
|
, block =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.vfs_block}/bin/vfs_block"
|
|
, provides = [ "Block" ]
|
|
, resources = Init.Resources::{
|
|
, ram = Genode.units.MiB 12
|
|
}
|
|
, config = Init.Config::{
|
|
, content =
|
|
[ Genode.Prelude.XML.text
|
|
''
|
|
<vfs>
|
|
<ram/>
|
|
<import>
|
|
<zero name="block.raw" size="8M"/>
|
|
</import>
|
|
</vfs>
|
|
''
|
|
]
|
|
, policies =
|
|
[ Init.Config.Policy::{
|
|
, service = "Block"
|
|
, attributes = toMap
|
|
{ file = "block.raw"
|
|
, writeable = "yes"
|
|
}
|
|
, label =
|
|
Init.LabelSelector.Type.Partial
|
|
{ prefix = Some "solo5"
|
|
, suffix = None Text
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
in Init.toChild init Init.Attributes.default
|
|
, net =
|
|
let init =
|
|
Init::{
|
|
, routes =
|
|
[ ServiceRoute.parent "Timer"
|
|
, ServiceRoute.child "Nic" "bridge"
|
|
]
|
|
, children = toMap
|
|
{ nic =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.nic_loopback}/bin/nic_loopback"
|
|
, provides = [ "Nic" ]
|
|
}
|
|
, bridge =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.nic_bridge}/bin/nic_bridge"
|
|
, resources = Init.Resources::{
|
|
, 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" }
|
|
, policies =
|
|
[ Init.Config.Policy::{
|
|
, service = "Nic"
|
|
, attributes = toMap
|
|
{ ip_addr = "10.0.0.2" }
|
|
, label =
|
|
Init.LabelSelector.Type.Partial
|
|
{ prefix = Some "solo5"
|
|
, suffix = None Text
|
|
}
|
|
}
|
|
]
|
|
, defaultPolicy = Some Init.Config.DefaultPolicy::{=}
|
|
}
|
|
}
|
|
, solo5 =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.solo5Tests}/bin/solo5-test_net"
|
|
, resources = Init.Resources::{
|
|
, caps = 256
|
|
, ram = Genode.units.MiB 3
|
|
}
|
|
, config = Init.Config::{
|
|
, content =
|
|
[ Genode.Prelude.XML.text
|
|
"<cmdline>limit</cmdline>"
|
|
]
|
|
}
|
|
}
|
|
, ping =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "${params.ping}/bin/ping"
|
|
, exitPropagate = True
|
|
, resources = Init.Resources::{
|
|
, caps = 128
|
|
, ram = Genode.units.MiB 6
|
|
}
|
|
, config = Init.Config::{
|
|
, attributes = toMap
|
|
{ interface = "10.0.0.72/24"
|
|
, dst_ip = "10.0.0.2"
|
|
, period_sec = "1"
|
|
, verbose = "no"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
in Init.toChild init Init.Attributes.default
|
|
, net_2if =
|
|
let init =
|
|
Init::{
|
|
, routes =
|
|
[ ServiceRoute.parent "Timer"
|
|
, ServiceRoute.child "Nic" "bridge"
|
|
]
|
|
, children = toMap
|
|
{ nic =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.nic_loopback}/bin/nic_loopback"
|
|
, provides = [ "Nic" ]
|
|
}
|
|
, bridge =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.nic_bridge}/bin/nic_bridge"
|
|
, resources = Init.Resources::{
|
|
, caps = 200
|
|
, ram = Genode.units.MiB 8
|
|
}
|
|
, provides = [ "Nic" ]
|
|
, routes =
|
|
[ ServiceRoute.child "Nic" "nic" ]
|
|
, config = Init.Config::{
|
|
, defaultPolicy = Some Init.Config.DefaultPolicy::{=}
|
|
, policies =
|
|
[ Init.Config.Policy::{
|
|
, service = "Nic"
|
|
, attributes = toMap
|
|
{ ip_addr = "10.0.0.2" }
|
|
, label =
|
|
Init.LabelSelector.Type.Scoped
|
|
"solo5 -> service0"
|
|
}
|
|
, Init.Config.Policy::{
|
|
, service = "Nic"
|
|
, attributes = toMap
|
|
{ ip_addr = "10.1.0.2" }
|
|
, label =
|
|
Init.LabelSelector.Type.Scoped
|
|
"solo5 -> service1"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
, solo5 =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary =
|
|
"${params.solo5Tests}/bin/solo5-test_net_2if"
|
|
, resources = Init.Resources::{
|
|
, caps = 256
|
|
, ram = Genode.units.MiB 5
|
|
}
|
|
, config = Init.Config::{
|
|
, content =
|
|
[ Genode.Prelude.XML.text
|
|
''
|
|
"<cmdline>limit</cmdline>"
|
|
''
|
|
]
|
|
}
|
|
}
|
|
, clients =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "${params.sequence}/bin/sequence"
|
|
, exitPropagate = True
|
|
, resources = Init.Resources::{
|
|
, caps = 256
|
|
, ram = Genode.units.MiB 8
|
|
}
|
|
, config = Init.Config::{
|
|
, content =
|
|
[ Genode.Prelude.XML.text
|
|
''
|
|
<start name="ping0">
|
|
<binary name="ping"/>
|
|
<config interface="10.0.0.72/24" dst_ip="10.0.0.2" period_sec="1" count="4"/>
|
|
</start>
|
|
<start name="ping1">
|
|
<binary name="ping"/>
|
|
<config interface="10.1.0.72/24" dst_ip="10.1.0.2" period_sec="1" count="4"/>
|
|
</start>
|
|
''
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
in Init.toChild init Init.Attributes.default
|
|
}
|
|
# ( if params.isAarch64
|
|
then Prelude.Map.empty Text Child.Type
|
|
else toMap { fpu = toSimple "fpu" }
|
|
)
|
|
|
|
in Init.Child.nested
|
|
children
|
|
Init.Child.Attributes::{
|
|
, binary = "${params.sequence}/bin/sequence"
|
|
, routes =
|
|
[ ServiceRoute.parent "Timer", ServiceRoute.parent "Rtc" ]
|
|
}
|