Skip to content

Boot configuration ​

The UniXNU boot manager reads \EFI\UniXNU\unixnu.toml from the volume it was started from, then from every other volume. A kit directory contains Kit.toml with the same match and injection sections.

Boot arguments are stored in the payload's EFI/UniXNU/unixnu.toml. After changing them, run ./unixnu payload and ./unixnu bootimg, then boot the new image. See apply boot arguments for precedence and inspection commands.

Procedure ​

  1. Locate the configuration on the payload volume: EFI/UniXNU/unixnu.toml. For generated device payloads, edit the source [payload] settings in board.toml or local build inputs before rebuilding.
  2. Use the unixnu.toml fields to define the entry and its paths. Check that each referenced kernel, sidecar, driver and initrd is present in the volume.
  3. For a kit, fill Kit.toml and verify every match rule against the target. Keep paths relative to the configuration or kit as specified below.
  4. Rebuild the payload and boot image. Inspect the packaged configuration with mtype -i <payload.img> ::/EFI/UniXNU/unixnu.toml, then check menu behavior on boot.

unixnu.toml ​

toml
version = 1

[boot]
timeout = 5
rotate = 0
fallback_timeout = 10
connect_all = true
default = "xnu"

[ui]
title = "UniXNU"
scale = 0
logo = true
layout = "auto"
portrait_below = 800
console = "auto"
theme = "default"

[boot] ​

KeyDefaultMeaning
timeout5Seconds. Negative waits for input
rotate0Idle highlight rotation in seconds. 0 disables it
fallback_timeout10Timeout when no input device exists
connect_alltrueCalls ConnectController on every handle
defaultfirst entryEntry id or index

[ui] ​

KeyDefaultMeaning
titleUniXNUMenu title
scale0Glyph scale. 0 selects automatically
logotrueDraws the logo
layoutautoauto, landscape or portrait
portrait_below800With auto, portrait when width / height times 1000 is below this value
consoleautoauto, graphics, text or none
themedefaultdefault or oc-like (case-insensitive)

The portrait layout is a column for a tall panel such as a phone. The logo floats at the top, the entries are numbered cards at the bottom, and the status lines wrap under a rule. The logo carries the UniXNU wordmark, so the title text appears only when logo is false or title is not UniXNU. With auto, a 1080x2400 panel (ratio 450) is portrait, a 3:4 tablet (750) is portrait, and a 4:5 panel (800) or any wider one keeps the landscape layout. Without a scale value, the portrait layout picks a glyph scale of width / 270, so a 1080 pixel wide panel shows about 33 characters per line.

Set theme = "oc-like" to switch graphics mode to the TUI card layout with the top-left uniXNU pixel wordmark, purple selection highlight, Silkscreen header/footer glyphs, Fusion Pixel 10px menu entries, and Spleen 8x16 error lines. Unknown values fall back to default and record a config error.

[[driver]] ​

toml
[[driver]]
path = "Drivers/MyDriver.efi"
args = "board=1"
connect = true
enabled = true
KeyDefaultMeaning
pathrequiredFile path or fv:<GUID>
argsLoad options
connecttrueConnects controllers after the driver starts
enabledtruefalse skips the entry

A kit driver uses file instead of path.

[[dt_patch]] ​

toml
[[dt_patch]]
op = "set"
node = "/chosen"
prop = "bootargs"
value = "console=ttyAMA0"
type = "string"
KeyMeaning
opset, delete-prop, add-node, delete-node or overlay
nodeAbsolute node path
propProperty name for set and delete-prop
valueValue for set
typestring, stringlist, u32, u64, bytes or empty
fileOverlay file for overlay

Patches apply to EFI and Linux entries. The Darwin path uses the .adt sidecar.

[[block_slice]] ​

toml
[[block_slice]]
partition = "<GPT name>"
name = "<slice name>"
offset = 0
length = 0
writable = false
enabled = true
KeyMeaning
partitionGPT partition name
nameLabel in the device path
offsetByte offset from the partition start
lengthByte length. 0 means to the end
writablePublishes a writable block device
enabledfalse skips the slice

The slice appears as a whole disk with its own device path. A child partition scheme or file system driver can bind to it.

ACPI ​

toml
[acpi]
add = ["Tables/DSDT.aml", "Tables/SSDT.aml"]

Each table is installed through EFI_ACPI_TABLE_PROTOCOL. The header length must match the file size.

Kits ​

toml
[[kit]]
path = "Kits/MyKit.kit"
enabled = true

[kits]
autoload = true
directory = "Kits"

Explicit kits load first. With autoload, every *.kit directory under directory loads in name order.

[[entry]] ​

toml
[[entry]]
id = "xnu"
title = "UniXNU"
type = "xnu"
path = "Payloads/kernel.macho"
args = "-v serial=3"
initrd = "Payloads/scratch-data.img"
confirm = "Boot the kernel?"
confirm_titles = ["Normal", "Verbose"]
confirm_args = ["", "debug=0x14e"]
enabled = true
KeyMeaning
idEntry identifier
titleMenu title
typeefi, linux, action or xnu
pathEFI image, Linux image or kernel path
argsLoad options or kernel command line
dtbfirmware, a file path, or absent
initrdInitrd path
confirmQuestion shown before the entry boots. The entry never boots by countdown
confirm_titlesOptional choice titles. Requires confirm and confirm_args
confirm_argsOne argument string per choice. The chosen string is appended to args
actionreset, shutdown, exit or tools for action entries
enabledfalse skips the entry

An entry with confirm boots only when Enter is pressed. Without choices, any other key cancels, and a machine without an input device cancels. With confirm_titles, Up and Down step through the choices and Cancel is selected first. The chosen confirm_args entry is appended to a copy of the entry's args.

When the default entry requires confirmation, the countdown falls back to the first entry that does not.

The built-in configuration has exit, reset, shutdown and tools entries. tools opens a second-level menu listing the installed menu plugins. When no file is found, removable loaders are added in front of them.

[entry.chosen] ​

toml
[entry.chosen]
bootargs = "console=ttyAMA0"

Every key becomes a /chosen property. These patches apply after the entry patches.

[[entry.kext]] ​

toml
[[entry.kext]]
bundle = "Kexts/MyDriver.kext"
plist = "Contents/Info.plist"
executable = "Contents/MacOS/MyDriver"
enabled = true

Entry kexts apply only to the entry that declares them.

[[entry.variable]] ​

toml
[[entry.variable]]
guid = "00000000-0000-0000-0000-000000000000"
name = "MyVariable"
value = "hello"
type = "ascii"
volatile = true
KeyMeaning
guidVariable GUID
nameVariable name
valueValue
typeascii, ucs2, u8, u16, u32, u64 or bytes
volatilefalse adds EFI_VARIABLE_NON_VOLATILE

The variables are set before the entry starts.

[[entry.dt_patch]] ​

The entry accepts its own [[dt_patch]] array. Entry patches apply after global patches.

Kit.toml ​

toml
schema = 1

[kit]
name = "MyKit"
version = "1.0.0"
description = "Board support"

[match]
arch = "AARCH64"
fdt_compatible = ["vendor,board"]
firmware_vendor = ["Vendor"]
requires_protocol = ["00000000-0000-0000-0000-000000000000"]

[[driver]]
file = "MyDriver.efi"
args = "from-kit"

[[overlay]]
file = "board.dtbo"

[[dt_patch]]
op = "set"
node = "/chosen"
prop = "from-kit"
value = "1"
type = "u32"

[[acpi]]
file = "DSDT.aml"

[[kext]]
bundle = "MyDriver.kext"
entry = "xnu"
SectionMeaning
[kit]Name, version and description
[match]All present keys must match
[[driver]]Driver file relative to the kit
[[overlay]]Device tree overlay relative to the kit
[[dt_patch]]Device tree patch
[[acpi]]ACPI table relative to the kit
[[kext]]Kext bundle scoped to an entry id

Match keys:

KeyMeaning
archAARCH64
fdt_compatibleStrings in the firmware root compatible list
firmware_vendorSubstring of gST->FirmwareVendor
requires_protocolGUIDs that must be installed

Within a key, any listed value matches. Across keys, every key must match.

ConditionResult
Input device presentCountdown runs to the timeout
No input devicefallback_timeout applies
Negative timeout with inputWaits for a key
Negative timeout without inputfallback_timeout applies
Failed bootReturns to the menu without a countdown

The menu shows the configuration source, the entry list, the injection summary and the first error.

Next steps ​

Released under the BSD-2-Clause-Patent License.