136 lines
5.3 KiB
Plaintext
136 lines
5.3 KiB
Plaintext
-- SPDX-License-Identifier: CC0-1.0
|
|
|
|
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 Genode.Boot::{
|
|
, config = Init::{
|
|
, verbose = True
|
|
, children =
|
|
let blockTest =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "test-block-client"
|
|
, resources = Resources::{ ram = Genode.units.MiB 5 }
|
|
, routes =
|
|
[ ServiceRoute.parent "Timer"
|
|
, ServiceRoute.child "Block" "block_router"
|
|
]
|
|
}
|
|
|
|
in toMap
|
|
{ block_device =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "ram_block"
|
|
, config = Init.Config::{
|
|
, attributes = toMap
|
|
{ file = "gpt.rom", block_size = "512" }
|
|
}
|
|
, provides = [ "Block" ]
|
|
, resources = Resources::{ ram = Genode.units.MiB 8 }
|
|
}
|
|
, part_block =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "part_block"
|
|
, config = Init.Config::{
|
|
, attributes = toMap { use_gpt = "yes" }
|
|
, content =
|
|
Prelude.List.map
|
|
Natural
|
|
XML.Type
|
|
( λ(i : Natural)
|
|
→ XML.leaf
|
|
{ name = "policy"
|
|
, attributes =
|
|
let partition =
|
|
Prelude.Natural.show (i + 1)
|
|
|
|
in toMap
|
|
{ label_suffix = " ${partition}"
|
|
, partition = partition
|
|
, writeable = "yes"
|
|
}
|
|
}
|
|
)
|
|
(Prelude.Natural.enumerate 128)
|
|
# [ XML.leaf
|
|
{ name = "report"
|
|
, attributes = toMap { partitions = "yes" }
|
|
}
|
|
]
|
|
}
|
|
, resources = Resources::{ ram = Genode.units.MiB 10 }
|
|
, provides = [ "Block" ]
|
|
, routes =
|
|
[ ServiceRoute.child "Block" "block_device"
|
|
, ServiceRoute.child "Report" "block_router"
|
|
]
|
|
}
|
|
, block_router =
|
|
Child.flat
|
|
Child.Attributes::{
|
|
, binary = "block_router"
|
|
, config = Init.Config::{
|
|
, content =
|
|
[ XML.element
|
|
{ name = "policy"
|
|
, attributes = toMap
|
|
{ label_prefix = "test-part1" }
|
|
, content =
|
|
[ XML.leaf
|
|
{ name = "partition"
|
|
, attributes = toMap
|
|
{ name = "best partition ever" }
|
|
}
|
|
, XML.leaf
|
|
{ name = "partition"
|
|
, attributes = toMap
|
|
{ name = "first-test-partition"
|
|
, timeout = "2"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
, XML.element
|
|
{ name = "policy"
|
|
, attributes = toMap
|
|
{ label_prefix = "test-part2" }
|
|
, content =
|
|
[ XML.leaf
|
|
{ name = "partition"
|
|
, attributes = toMap
|
|
{ name = "second-test-partition" }
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
, resources = Resources::{ ram = Genode.units.MiB 10 }
|
|
, provides = [ "Block", "Report" ]
|
|
, routes =
|
|
[ ServiceRoute.parent "Timer"
|
|
, ServiceRoute.child "Block" "part_block"
|
|
]
|
|
}
|
|
, test-part1 = blockTest
|
|
, test-part2 = blockTest
|
|
}
|
|
}
|
|
, rom =
|
|
Genode.BootModules.toRomPaths
|
|
[ { mapKey = "gpt.rom", mapValue = "./gpt.raw" } ]
|
|
}
|