-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use 'towbootctl' to create bootable images; Remove GRUB support; Inte…
…grate 'run.sh' functionality into 'Makefile.toml'
- Loading branch information
Showing
15 changed files
with
324 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,30 +5,46 @@ jobs: | |
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Rust | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install packages | ||
uses: amitie10g/[email protected] | ||
with: | ||
apt: build-essential nasm wget | ||
|
||
- name: Install Rust for x86-64 Linux | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
override: true | ||
target: x86_64-unknown-linux-gnu | ||
components: rust-src | ||
- name: Install Rust for x86_64 UEFI | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
target: x86_64-unknown-uefi | ||
- name: Install Rust for i686 UEFI | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
target: i686-unknown-uefi | ||
- name: Install Rust for x86_64 UEFI | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: nightly | ||
target: x86_64-unknown-uefi | ||
|
||
- name: Install cargo-make | ||
run: cargo install --no-default-features cargo-make | ||
|
||
- uses: awalsh128/cache-apt-pkgs-action@v1 | ||
with: | ||
packages: make nasm dosfstools mtools zstd unzip wget | ||
- name: Install towbootctl | ||
run: cargo install --git https://github.com/hhuOS/towboot --features=binary -Z bindeps towbootctl | ||
|
||
- name: Build | ||
run: cargo make --no-workspace | ||
|
||
- name: Create artifact | ||
run: tar -czvf d3os.tar.gz d3os.img run.sh README.md | ||
run: cargo make --no-workspace image | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: D3OS | ||
path: d3os.tar.gz | ||
path: d3os.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,76 @@ | ||
[env] | ||
BOOTLOADER_DIRECTORY = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/loader" | ||
INITRD_DIRECTORY = "${BOOTLOADER_DIRECTORY}/initrd" | ||
OVMF_URL = "https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF.fd" | ||
LINKER = "ld" | ||
LINKER_MAC = "x86_64-elf-ld" | ||
PATH = "${PATH}:~/.cargo/bin" | ||
|
||
[tasks.default] | ||
alias = "towboot" | ||
alias = "qemu" | ||
|
||
# Run tasks | ||
|
||
[tasks.debug] | ||
command = "qemu-system-x86_64" | ||
args = [ "-S", "-gdb", "tcp::1234", "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=pa" ] | ||
dependencies = [ "debug-signal-vscode" ] | ||
|
||
[tasks.debug.mac] | ||
args = [ "-S", "-gdb", "tcp::1234", "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=coreaudio" ] | ||
|
||
[tasks.debug-signal-vscode] | ||
command = "echo" | ||
args = [ "Ready to debug" ] | ||
dependencies = [ "image", "ovmf" ] | ||
|
||
[tasks.qemu] | ||
command = "qemu-system-x86_64" | ||
args = [ "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=pa" ] | ||
dependencies = [ "image", "ovmf" ] | ||
|
||
[tasks.qemu.mac] | ||
args = [ "-machine", "q35,pcspk-audiodev=audio0", "-m", "128M", "-cpu", "qemu64", "-bios", "RELEASEX64_OVMF.fd", "-boot", "d", "-vga", "std", "-rtc", "base=localtime", "-drive", "driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img", "-audiodev", "id=audio0,driver=coreaudio" ] | ||
|
||
[tasks.ovmf] | ||
command = "wget" | ||
args = [ "-N", "${OVMF_URL}" ] | ||
|
||
# Build tasks | ||
|
||
[tasks.link_members] | ||
[tasks.link-members] | ||
run_task = { name = "link", fork = true } | ||
dependencies = [ "create-initrd-directory" ] | ||
|
||
[tasks.create-initrd-directory] | ||
command = "mkdir" | ||
args = [ "-p", "${INITRD_DIRECTORY}" ] | ||
|
||
[tasks.towboot] | ||
cwd = "${BOOTLOADER_DIRECTORY}/towboot" | ||
command = "./build.sh" | ||
dependencies = [ "link_members", "initrd" ] | ||
|
||
[tasks.grub] | ||
cwd = "${BOOTLOADER_DIRECTORY}/grub" | ||
command = "grub-mkrescue" | ||
args = [ "-o", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/d3os.iso", "iso/" ] | ||
dependencies = [ "grub-copy-files" ] | ||
|
||
[tasks.grub-copy-files] | ||
cwd = "${BOOTLOADER_DIRECTORY}" | ||
command = "cp" | ||
args = [ "kernel.elf", "initrd.tar", "grub/iso/boot" ] | ||
dependencies = [ "link_members", "initrd" ] | ||
|
||
[tasks.initrd] | ||
cwd = "${INITRD_DIRECTORY}" | ||
command = "tar" | ||
args = [ "-cf", "${BOOTLOADER_DIRECTORY}/initrd.tar", "hello", "shell", "uptime", "date" ] | ||
dependencies = [ "link_members" ] | ||
dependencies = [ "link-members" ] | ||
|
||
[tasks.image] | ||
cwd = "${BOOTLOADER_DIRECTORY}" | ||
command = "towbootctl" | ||
args = [ "image", "--target", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/d3os.img", "--", "-config", "towboot.toml"] | ||
dependencies = [ "link-members", "initrd" ] | ||
|
||
# Cleanup tasks | ||
|
||
[tasks.clean] | ||
dependencies = [ "clean_workspace", "clean_members" ] | ||
dependencies = [ "clean-workspace", "clean-members" ] | ||
|
||
[tasks.clean_workspace] | ||
[tasks.clean-workspace] | ||
command = "rm" | ||
args = [ "-rf", | ||
"${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/d3os.img", | ||
"${BOOTLOADER_DIRECTORY}/kernel.elf", | ||
"${BOOTLOADER_DIRECTORY}/initrd.tar", | ||
"${BOOTLOADER_DIRECTORY}/grub/iso/boot/kernel.elf", | ||
"${BOOTLOADER_DIRECTORY}/grub/iso/boot/initrd.tar" ] | ||
"${INITRD_DIRECTORY}", | ||
"RELEASEX64_OVMF.fd" ] | ||
|
||
[tasks.clean_members] | ||
[tasks.clean-members] | ||
run_task = { name = "clean", fork = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,54 @@ | ||
# D3OS | ||
A new research operating system, developed by the [operating systems group](https://www.cs.hhu.de/en/research-groups/operating-systems.html) of the department of computer science at [Heinrich Heine University Düsseldorf](https://www.hhu.de) | ||
|
||
## Requirements | ||
<p align="center"> | ||
<a href="https://www.uni-duesseldorf.de/home/en/home.html"><img src="media/hhu.svg" width=300></a> | ||
</p> | ||
|
||
For building D3OS, a _rust nightly_ toolchain is needed. To install _rust_ use [rustup](https://rustup.rs/). | ||
<p align="center"> | ||
<a href="https://github.com/hhu-bsinfo/D3OS/actions/workflows/build.yml"><img src="https://github.com/hhu-bsinfo/D3OS/actions/workflows/build.yml/badge.svg"></a> | ||
<img src="https://img.shields.io/badge/Rust-2021-blue.svg"> | ||
<img src="https://img.shields.io/badge/license-GPLv3-orange.svg"> | ||
</p> | ||
|
||
`rustup toolchain install nightly` | ||
## Requirements | ||
|
||
And activate it for the current folder with: | ||
For building D3OS, a _rust nightly_ toolchain is needed. To install _rust_ use [rustup](https://rustup.rs/). | ||
|
||
`rustup override set nightly` | ||
``` | ||
rustup toolchain install nightly | ||
rustup override set nightly | ||
``` | ||
|
||
To run the build commands _cargo-make_ is required. Install it with: | ||
|
||
`cargo install --no-default-features cargo-make` | ||
``` | ||
cargo install --no-default-features cargo-make | ||
``` | ||
|
||
Further the following packages for Debian/Ubuntu based systems (or their equivalent packages on other distributions) need to be installed: | ||
|
||
`apt install build-essential nasm mtools fdisk zstd` | ||
|
||
To run the final OS image _QEMU_ is required: | ||
|
||
`apt install qemu-system-x86_64` | ||
|
||
## Build | ||
|
||
For a full build run: | ||
``` | ||
apt install build-essential nasm wget qemu-system-x86_64 | ||
``` | ||
|
||
`cargo make --no-workspace` | ||
D3OS depends on the rust-based bootloader [towboot](https://github.com/hhuOS/towboot), which provides the `towbootctl` utility for creating bootable images. Install it with: | ||
|
||
This will produce _d3os.img_. | ||
``` | ||
rustup target install i686-unknown-uefi x86_64-unknown-uefi | ||
cargo install --git https://github.com/hhuOS/towboot --features=binary -Z bindeps towbootctl | ||
``` | ||
|
||
## Run | ||
## Build and Run | ||
|
||
To run the image, build it first and then use: | ||
To build D3OS and run it in QEMU, just execute: | ||
|
||
`./run.sh` | ||
``` | ||
cargo make --no-workspace | ||
``` | ||
|
||
This will execute the operating system with _QEMU_. | ||
To only build the bootable image _d3os.img_, run: | ||
|
||
For more information see `run.sh --help`. | ||
``` | ||
cargo make --no-workspace image | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.