An operating system written in Swift.
- 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 12:
sudo apt install -t bookwarm-backports qemu-system-arm
(you need to add backports tosources.list
) - macOS 14 or later:
brew install qemu
- Arch Linux:
- Swiftly
- Swift toolchain: Just run
swiftly install
after installing Swiftly
swift build -c release --triple aarch64-none-none-elf --toolset toolset.json
Tip
If you want to reduce the binary size significantly, you can use a -experimental-hermetic-seal-at-link
flag. However, when using it, swift_os may not work as expected.
swift build -c release --triple aarch64-none-none-elf --toolset toolset.json --experimental-lto-mode=full -Xswiftc -experimental-hermetic-seal-at-link
swift run -c release --triple aarch64-none-none-elf --toolset toolset.json
Tip
If you want to reduce the binary size significantly, you can use a -experimental-hermetic-seal-at-link
flag. However, when using it, swift_os may not work as expected.
swift run -c release --triple aarch64-none-none-elf --toolset toolset.json --experimental-lto-mode=full -Xswiftc -experimental-hermetic-seal-at-link
swift build -c release --triple aarch64-none-none-elf --toolset toolset.json
llvm-objcopy .build/release/Kernel -O binary .build/kernel8.img
Tip
If you want to reduce the binary size significantly, you can use a -experimental-hermetic-seal-at-link
flag. However, when using it, swift_os may not work as expected.
swift build -c release --triple aarch64-none-none-elf --toolset toolset.json --experimental-lto-mode=full -Xswiftc -experimental-hermetic-seal-at-link
llvm-objcopy .build/release/Kernel -O binary .build/kernel8.img
swift package clean
This project is using swift-format for formatting and linting.
Format:
swift format format -rip .
Lint:
swift format lint -rsp .