Skip to content

Installation

kazah-png edited this page Aug 25, 2026 · 1 revision

Installing NyxOS to a disk

NyxOS can install itself onto a real disk from inside a running NyxOS and boot standalone afterwards — partition the disk, format a filesystem, copy the OS, and write a bootloader, all with the in-OS tools. No host, no external installer. It targets both ATA and NVMe disks, and produces both BIOS (MBR + GRUB) and UEFI (GPT + ESP + GRUB-EFI) bootable installs.

This is the v6.4.223v6.4.276 arc, driven end to end by the nyxinstall command.

See also: Drivers, Building, Boot-Process, Filesystem, Command-Reference

Note

This is a hobby installer. It writes real partition tables and bootloaders, so point it only at a disk you are willing to erase. It has been proven under QEMU (BIOS and OVMF/UEFI) and exercised against real NVMe hardware with write-cache/FUA handling, but it is not a hardened, general-purpose installer.

One command

nyxinstall            # install to the default disk
nyxinstall n0         # install to NVMe namespace n0
nyxinstall --uefi     # UEFI-bootable install (GPT + ESP + ext2)

nyxinstall runs the whole pipeline: enumerate → partition → format → mount → copy the OS → write the bootloader. It writes /boot/grub/grub.cfg, installs a bootable kernel, and (for standalone boot) embeds GRUB. The bootable-disk recipe is proven in QEMU, and the UEFI variant boots under OVMF.

The pipeline, tool by tool

Each step is also a standalone command, so you can drive the install manually or inspect it.

Step Tool Does
Enumerate lspci, disks / lsblk List PCI/PCIe devices; enumerate disks and parse the MBR partition table (also lists the NVMe namespace)
Partition (BIOS) nyxpart Write an MBR partition table
Partition (UEFI) nyxgpt Write and parse a GPT (UEFI), sgdisk-clean
Format mkfs In-OS ext2 formatter — fsck-clean, multi-block-group, partitions up to 256 MB
Format (ESP) nyxfat In-OS FAT32 ESP formatter; populates /EFI/BOOT with a real GRUB x86_64-efi loader
Mount mount Mount the new filesystem (see Filesystem)
Copy cp -r Recursive tree copy of the OS onto the fresh filesystem
Bootloader nyxgrub In-OS GRUB install — embeds boot.img/core.img so the disk boots standalone (BIOS)
Verify nyxverify Read the installed kernel back (ext2 + raw) and check it is a valid ELF + Multiboot 2

The NVMe driver

Real-hardware install needed a block device beyond ATA, so a from-scratch NVMe driver (kernel/drivers/misc/nvme.c) was brought up rung by rung:

  • Controller bring-up — discover the device via lspci, map its BAR (map_mmio_range for high addresses), reset and enable, create the admin queue.
  • IDENTIFY — admin command submission returns model/serial and the namespace capacity + LBA size.
  • I/O queues — create an I/O submission/completion queue pair (set-features + create IO CQ/SQ).
  • Block I/O — read/write through the I/O queue, with PRP-list batching for multi-block transfers (which cut a nyxinstall from ~1 min to 0.3 s).
  • Real-SSD durability — because real SSDs lose cached writes on power-off, the driver flushes the write cache after installs (blk_flush), can disable the volatile write cache (write-through), and sets FUA on every write so data reaches the medium even on drives that ignore Flush/WCE. nvme writetest and nvme persisttest are the cross-power-cycle diagnostics.

The blockdev layer routes the installer (nyxpart/mkfs/mount + ext2 I/O) to either ATA or the NVMe namespace (n0). On the ATA side, batching the write-cache flush per operation took a 4 MB disk write from ~120 s to ~0.4 s (v6.4.256).

Real-hardware boot

Installing is only half the story — the installed system also has to boot on real machines, which the same arc delivered (see Boot-Process):

  • UEFI boot via a GRUB-EFI ISO and the bootloader-provided GOP framebuffer (v6.4.222v6.4.223).
  • Fixes for real-hardware boot hangs — bounding the PS/2 and RTC polling loops with timeouts, reading the Multiboot 2 info correctly (it had been read as Multiboot 1), and fixing module-memory reuse that corrupted large modules.
  • Input fallbacks for machines where IRQ12 is not delivered: poll the PS/2 mouse from the getters, and MouseKeys (drive the pointer from the keyboard).
  • Display rotation for portrait-mounted panels (rotate= cmdline, 90/180/270).

See also

  • Drivers — the ATA and NVMe block drivers underneath
  • Boot-Process — how the installed disk boots (BIOS and UEFI)
  • Filesystem — the ext2 and FAT filesystems the installer writes
  • Building — building the image that gets installed

External resources

Clone this wiki locally