sunriseos / SunriseOS

Horizon/NX kernel reimplementation
Apache License 2.0
232 stars 13 forks source link

Stop using GRUB #468

Open roblabla opened 5 years ago

roblabla commented 5 years ago

GRUB is written in the unholy C language, and as such should be expunged from our systems! In order to implement secureboot, we need to run grub-mkimage in order to embed a key in the GRUB bootloader and embed our grub config. This is annoying as it breaks the build for windows users.

We should use our own bootloader. This bootloader should closely follow the design of NX-Bootloader (the bootloader of HOS/NX). Which means it should:

  1. Do some amount of hardware initialization
  2. Find and load the Package2 (containing the Kernel + builtins)
  3. Verify its signature against a hardcoded key (for simplicity's sake, will be the same as the secure boot key)
  4. Jump to the kernel's entrypoint.

This bootloader should compile to an UEFI binary (rust natively supports building UEFI binaries) that will get signed by the secure boot key.

roblabla commented 5 years ago

The most complicated part of this setup will be setting things up to get ourselves a framebuffer. Maybe we should move the framebuffer acquisition in the kernel proper anyways.