2
0
Fork 0

nova-image: remove Arch union type

This commit is contained in:
Ehmry - 2020-01-27 01:54:43 +01:00
parent 66db226f44
commit 0afe6af54d
5 changed files with 159 additions and 163 deletions

View File

@ -31,7 +31,7 @@ rec {
program = "${drv}/bin/nova-image";
function = attrs: bootDesc:
nixpkgs.runCommand "nova-iso" (attrs // { inherit bootDesc; })
"${drv}/bin/nova-image $bootDesc > $out";
"XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-image $bootDesc > $out";
};
nova-iso = let
@ -44,7 +44,7 @@ rec {
program = "${drv}/bin/nova-iso";
function = attrs: bootDesc:
nixpkgs.runCommand "nova.iso" attrs
''${drv}/bin/nova-iso "${bootDesc}" > $out'';
''XDG_CACHE_HOME=$TMPDIR ${drv}/bin/nova-iso "${bootDesc}" > $out'';
};
render-init =

View File

@ -26,9 +26,9 @@ in nixpkgs.writeScriptBin "nova-image" (with nixpkgs.buildPackages;
export DHALL_PRELUDE=${packages.dhallPrelude}/package.dhall
export DHALL_GENODE=${packages.dhallGenode}/package.dhall
${dhallApps.dhall.program} text <<< "${
./nova-modules.as.dhall
} ($@)" > "$TMPDIR/modules.as"
${dhallApps.dhall.program} text <<< \
"(${./nova-modules.as.dhall}).to32bitImage ($@)" \
> "$TMPDIR/modules.as"
# compile the boot modules into one object file
$CC -c -x assembler -o "$TMPDIR/boot_modules.o" "$TMPDIR/modules.as"

View File

@ -4,17 +4,13 @@ let Genode = env:DHALL_GENODE
let Prelude = Genode.Prelude
let RomMap = Prelude.Map.Type Text Genode.Boot.Rom
let RomEntry = Prelude.Map.Entry Text Genode.Boot.Rom
let Configuration =
{ arch : < x86_32 | x86_64 >, config : Genode.Init.Type, rom : RomMap }
: Type
in λ ( boot
: Configuration
let compile =
λ ( addressType
: Text
)
→ λ(boot : Genode.Boot.Type)
→ let NaturalIndex =
{ index : Natural, value : Text }
@ -65,8 +61,6 @@ in λ ( boot
let mapValues = map moduleValues
let addressType = merge { x86_32 = ".long", x86_64 = ".quad" } boot.arch
in ''
.set MIN_PAGE_SIZE_LOG2, 12
.set DATA_ACCESS_ALIGNM_LOG2, 3
@ -124,3 +118,5 @@ in λ ( boot
.global _boot_modules_binaries_end
_boot_modules_binaries_end:
''
in { to32bitImage = compile ".long", to64bitImage = compile ".quad" }

View File

@ -2,15 +2,8 @@
let Genode = env:DHALL_GENODE
let Prelude = Genode.Prelude
let RomMap = Prelude.Map.Type Text Genode.Boot.Rom
let Args = { config : Genode.Init.Type, rom : RomMap } : Type
in λ(args : Args)
→ { arch = let Arch = < x86_32 | x86_64 > in Arch.x86_64
, config =
in λ(args : Genode.Boot.Type)
→ { config =
Genode.Init::{
, verbose = True
, defaultRoutes =

View File

@ -2,10 +2,8 @@
let Genode = env:DHALL_GENODE
in λ ( _
: {}
)
→ Genode.Init::{
in { config =
Genode.Init::{
, verbose = True
, children =
toMap
@ -34,3 +32,12 @@ in λ ( _
: Genode.Init.Start.Type
}
}
, rom =
let manifest = env:MANIFEST
in Genode.Boot.toRomPaths
[ manifest.libc.lib.libc
manifest.libc.lib.libm
manifest.test-libc.bin.test-libc
]
}