GitXplorerGitXplorer
k

daintree

public
47 stars
4 forks
0 issues

Commits

List of commits on branch main.
Unverified
a5b20a28390fcf453945ed40b1accaa5e8f17f0f

all running again, and both fail! lol

kkivikakk committed 2 months ago
Unverified
193250c9c9af35c1c7662ed76a152424d0050605

dainkrnl: builds all 3.

kkivikakk committed 2 months ago
Unverified
fc784976e00ce18ad0cdc183e1847fa20e1a9c3d

dainboot: now builds for all 3 targets.

kkivikakk committed 2 months ago
Unverified
0bec29ff02418caa304eee50c2a0c058e9695e89

building again wip; starting on dainboot.

kkivikakk committed 2 months ago
Unverified
16b5c84dcbc020bebd66c1849cca3df7f68298ba

roms: update opensbi

kkivikakk committed a year ago
Unverified
038a591307f899cd6d692f32aeb09235ba318a4d

riscv: getting to main again

kkivikakk committed a year ago

README

The README file for this repository.

daintree

An operating system plus a UEFI bootloader, all written in Zig. Currently targetting and testing on:

  • QEMU (arm64 + riscv64) with U-Boot
  • ROCKPro64 (arm64) with U-Boot
    • A mainline build is okay, but it must contain this EFI loader fix. At time of writing it has not been included in any release.

Planned support for:

  • HiFive Unmatched with U-Boot

There's a little dev blog I hope to maintain as I go. See also my personal blog:

dainboot

A gentle introduction to Zig's UEFI support. Boots like this:

  • Checks loaded image options.
    • You can pass kernel 0x12345678 0x1234 to give it the location of the kernel already loaded in RAM. Useful for TFTP boot, which itself is handy for faster development cycles on bare metal.
    • You may also pass dtb 0x12345678 0x1234 to give information about a DTB/FDT (device tree blob/flattened device tree) already in memory.
    • Separate successive options with spaces, i.e. kernel <addr> <len> dtb <addr> <len>.
  • If DTB wasn't loaded from memory, checks to see if one was passed in via UEFI.
  • If kernel or DTB (or both) were not loaded from memory, scans filesystems the UEFI system knows about, looking in the root directories for files named dainkrnl and dtb.
  • Picks the biggest unused slab of conventional memory and places the kernel there.
  • Clears data and instruction caches for loaded memory.
  • Parses the DTB and attempts to locate the serial UART port.
  • Exits UEFI boot services.
  • If necessary, disables a whole lot of traps and goes to EL1.
  • Jumps to the kernel, passing the memory map, UART write port, and framebuffer prepared by UEFI.

dainkrnl

  • Uses the UART write port to debug before the MMU is enabled.
  • Sets up the MMU, mapping the kernel, stack, framebuffer, DTB, UART device, etc. into high addresses.
  • Parses the DTB to understand what kind of serial device is connected and how to access PSCI.
  • Implements a console using a classic VGA font.
  • A shell lets you reset or poweroff the system. You can only use serial for input, but the output is muxed to the framebuffer if one is available.

license

MIT.

Some included binaries are GPL-2+ or GPL-2.0+ -- copyright notices retained and sources noted where so.

The roms/ directory contains an arm64 build of U-Boot, (C) Wolfgang Denk and licensed under GPL 2. See U-Boot's Licensing page for details. The source can be found at https://git.src.kameliya.ee/~kameliya/u-boot/log/qfw-ramfb.

It also contains a riscv64 build of same at https://git.src.kameliya.ee/~kameliya/u-boot/log/qfw-ramfb-riscv. It is embedded in a build of OpenSBI, (C) 2019 Western Digital Corporation, licensed under BSD-2-Clause.