Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.42 KB

File metadata and controls

57 lines (40 loc) · 1.42 KB

swift_os

An operating system written in Swift.

Prerequisites

  • QEMU 9.0 or later
    • Arch Linux: sudo pacman -S qemu-system-aarch64
    • Fedora 41 or later: sudo dnf install qemu-system-aarch64-core
    • Fedora 40: Build from source
    • Ubuntu 24.04/22.04: Build from source
    • Debian 13 or later: run0 apt install qemu-system-arm
    • Debian 12: sudo apt install -t bookwarm-backports qemu-system-arm (you need to add backports to sources.list)
    • macOS 14 or later: brew install qemu
  • Swiftly
  • Swift toolchain: Just run swiftly install after installing Swiftly

Building for emulators

swift build -c release --triple aarch64-none-none-elf --toolset toolset.json

Running on QEMU

swift run -c release --triple aarch64-none-none-elf --toolset toolset.json

Building for real hardwares

swift build -c release --triple aarch64-none-none-elf --toolset toolset.json
llvm-objcopy .build/release/Kernel -O binary .build/kernel8.img

Cleaning build outputs

swift package clean

swift-format

This project is using swift-format for formatting and linting.

Format:

swift format format -rip .

Lint:

swift format lint -rsp .