|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
|
|
|
|
|
let Sigil = env:DHALL_SIGIL
|
|
|
|
|
let Sigil =
|
|
|
|
|
env:DHALL_SIGIL
|
|
|
|
|
? https://git.sr.ht/~ehmry/dhall-sigil/blob/trunk/package.dhall
|
|
|
|
|
|
|
|
|
|
let Prelude = Sigil.Prelude
|
|
|
|
|
|
|
|
|
@ -8,10 +9,10 @@ let BootModules = Sigil.BootModules
|
|
|
|
|
let RomEntry = Prelude.Map.Entry Text BootModules.ROM.Type
|
|
|
|
|
|
|
|
|
|
let compile =
|
|
|
|
|
λ(addressType : Text)
|
|
|
|
|
→ λ(boot : Sigil.Boot.Type)
|
|
|
|
|
→ λ(out : Text)
|
|
|
|
|
→ let NaturalIndex = { index : Natural, value : Text }
|
|
|
|
|
λ(addressType : Text) →
|
|
|
|
|
λ(boot : Sigil.Boot.Type) →
|
|
|
|
|
λ(out : Text) →
|
|
|
|
|
let NaturalIndex = { index : Natural, value : Text }
|
|
|
|
|
|
|
|
|
|
let TextIndex = { index : Text, value : Text }
|
|
|
|
|
|
|
|
|
@ -20,8 +21,8 @@ let compile =
|
|
|
|
|
|
|
|
|
|
let moduleValues =
|
|
|
|
|
let f =
|
|
|
|
|
λ(e : RomEntry)
|
|
|
|
|
→ merge
|
|
|
|
|
λ(e : RomEntry) →
|
|
|
|
|
merge
|
|
|
|
|
{ RomText = λ(text : Text) → ".ascii ${Text/show text}"
|
|
|
|
|
, RomPath = λ(path : Text) → ".incbin ${Text/show path}"
|
|
|
|
|
}
|
|
|
|
@ -31,16 +32,16 @@ let compile =
|
|
|
|
|
# [ ".incbin \"${out}/config\"" ]
|
|
|
|
|
|
|
|
|
|
let map =
|
|
|
|
|
λ(list : List Text)
|
|
|
|
|
→ λ(f : TextIndex → Text)
|
|
|
|
|
→ let indexedNatural = Prelude.List.indexed Text list
|
|
|
|
|
λ(list : List Text) →
|
|
|
|
|
λ(f : TextIndex → Text) →
|
|
|
|
|
let indexedNatural = Prelude.List.indexed Text list
|
|
|
|
|
|
|
|
|
|
let indexed =
|
|
|
|
|
Prelude.List.map
|
|
|
|
|
NaturalIndex
|
|
|
|
|
TextIndex
|
|
|
|
|
( λ(x : NaturalIndex)
|
|
|
|
|
→ { index = Prelude.Natural.show x.index
|
|
|
|
|
( λ(x : NaturalIndex) →
|
|
|
|
|
{ index = Prelude.Natural.show x.index
|
|
|
|
|
, value = x.value
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
@ -67,8 +68,8 @@ let compile =
|
|
|
|
|
|
|
|
|
|
''
|
|
|
|
|
++ mapNames
|
|
|
|
|
( λ(m : TextIndex)
|
|
|
|
|
→ ''
|
|
|
|
|
( λ(m : TextIndex) →
|
|
|
|
|
''
|
|
|
|
|
${addressType} _boot_module_${m.index}_name
|
|
|
|
|
${addressType} _boot_module_${m.index}_begin
|
|
|
|
|
${addressType} _boot_module_${m.index}_end - _boot_module_${m.index}_begin
|
|
|
|
@ -80,8 +81,8 @@ let compile =
|
|
|
|
|
|
|
|
|
|
''
|
|
|
|
|
++ mapNames
|
|
|
|
|
( λ(m : TextIndex)
|
|
|
|
|
→ ''
|
|
|
|
|
( λ(m : TextIndex) →
|
|
|
|
|
''
|
|
|
|
|
.p2align DATA_ACCESS_ALIGNM_LOG2
|
|
|
|
|
_boot_module_${m.index}_name:
|
|
|
|
|
.string "${m.value}"
|
|
|
|
@ -97,8 +98,8 @@ let compile =
|
|
|
|
|
|
|
|
|
|
''
|
|
|
|
|
++ mapValues
|
|
|
|
|
( λ(m : TextIndex)
|
|
|
|
|
→ ''
|
|
|
|
|
( λ(m : TextIndex) →
|
|
|
|
|
''
|
|
|
|
|
.p2align MIN_PAGE_SIZE_LOG2
|
|
|
|
|
_boot_module_${m.index}_begin:
|
|
|
|
|
${m.value}
|
|
|
|
|