Skip to content

Commit

Permalink
Rebrand to D3OS
Browse files Browse the repository at this point in the history
  • Loading branch information
fruhland committed Feb 20, 2024
1 parent e66bc0b commit 6681757
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 43 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: cargo make --no-workspace

- name: Create artifact
run: tar -czvf hhuTOSr.tar.gz hhuTOSr.img run.sh efi/build.sh README.md
run: tar -czvf d3os.tar.gz d3os.img run.sh efi/build.sh README.md

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hhuTOSr
path: hhuTOSr.tar.gz
name: D3OS
path: d3os.tar.gz
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Cargo.lock

# End of https://www.toptal.com/developers/gitignore/api/rust,clion+iml

hhuTOSr.img
d3os.img
efi/OVMF.fd
loader/kernel.elf
loader/initrd.tar
Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies = [ "clean_workspace", "clean_members" ]

[tasks.clean_workspace]
command = "rm"
args = [ "-rf", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/hhuTOSr.img", "${BOOTLOADER_DIRECTORY}/initrd.tar" ]
args = [ "-rf", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/d3os.img", "${BOOTLOADER_DIRECTORY}/initrd.tar" ]

[tasks.clean_members]
run_task = { name = "clean", fork = true }
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# hhuTOSr
HHU Teaching Operating System written in Rust.

HhuTOSr is derived from Philipp Oppermann’s [excellent series of blog posts](https://os.phil-opp.com/).
# 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

For building hhuTOSr, a _rust_ toolchain is needed. To install _rust_ use [rustup](https://rustup.rs/).
HhuTOSr requires some features of nightly rust. Use the following command to install it:
For building D3OS, a _rust nightly_ toolchain is needed. To install _rust_ use [rustup](https://rustup.rs/).

`rustup toolchain install nightly`

Expand All @@ -24,15 +21,15 @@ Further the following packages for Debian/Ubuntu based systems (or their equival

To run the final OS image _QEMU_ is required:

`apt install qemu-system-x86_64 ovmf`
`apt install qemu-system-x86_64`

## Build

For a full build run:

`cargo make`

This will produce _hhuTOSr.img_.
This will produce _d3os.img_.

## Run

Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 4 additions & 5 deletions efi/build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

readonly OVMF_URL="http://de.archive.ubuntu.com/ubuntu/pool/main/e/edk2/ovmf_2022.02-3_all.deb"
readonly OVMF_URL="http://archive.ubuntu.com/ubuntu/pool/main/e/edk2/ovmf_0~20191122.bd85bf54-2ubuntu3.5_all.deb"

cleanup_and_exit() {
local exit_code=$1

rm -f edk2-ovmf.deb
rm -f control.tar.zst
rm -f data.tar.zst
rm -f control.tar.xz
rm -f data.tar.xz
rm -f data.tar
rm -f debian-binary
rm -rf usr/
Expand All @@ -22,8 +22,7 @@ fi
wget -O edk2-ovmf.deb "${OVMF_URL}" || cleanup_and_exit 1

ar x edk2-ovmf.deb || cleanup_and_exit 1
zstd -d data.tar.zst || cleanup_and_exit 1
tar -xf data.tar || cleanup_and_exit 1
tar -xf data.tar.xz || cleanup_and_exit 1

cp "usr/share/ovmf/OVMF.fd" "OVMF.fd" || cleanup_and_exit 1

Expand Down
2 changes: 1 addition & 1 deletion loader/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

readonly TOWBOOT_VERSION="0.7.1"
readonly FILE_LIST=("towboot-x64.efi" "kernel.elf" "initrd.tar" "towboot.toml")
readonly IMAGE="../hhuTOSr.img"
readonly IMAGE="../d3os.img"

if [[ ! -f "towboot-x64.efi" ]]; then
wget -O towboot-x64.efi "https://github.com/hhuOS/towboot/releases/download/v${TOWBOOT_VERSION}/towboot-v${TOWBOOT_VERSION}-x86_64.efi" || exit 1
Expand Down
6 changes: 3 additions & 3 deletions loader/towboot.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default = "hhuTOSr"
default = "d3os"
timeout = 0
log_level = "info"

[entries]
[entries.hhuTOSr]
name = "hhuTOSr"
[entries.d3os]
name = "D3OS"
image = "\\kernel.elf"
modules = [ { image = "\\initrd.tar", argv = "initrd" } ]
4 changes: 2 additions & 2 deletions os/application/hello/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[env.development]
CARGO_CFG_TARGET_FAMILY = "../../../hhu_tosr_app"
CARGO_CFG_TARGET_FAMILY = "../../../d3os_application"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/debug"
CARGO_BUILD_OPTION = "--lib"

[env.production]
CARGO_CFG_TARGET_FAMILY = "hhu_tosr_app"
CARGO_CFG_TARGET_FAMILY = "../../../d3os_application"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/release"
CARGO_BUILD_OPTION = "--release"

Expand Down
4 changes: 2 additions & 2 deletions os/application/shell/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[env.development]
CARGO_CFG_TARGET_FAMILY = "../../../hhu_tosr_app"
CARGO_CFG_TARGET_FAMILY = "../../../d3os_application"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/debug"
CARGO_BUILD_OPTION = "--lib"

[env.production]
CARGO_CFG_TARGET_FAMILY = "hhu_tosr_app"
CARGO_CFG_TARGET_FAMILY = "../../../d3os_application"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/release"
CARGO_BUILD_OPTION = "--release"

Expand Down
4 changes: 2 additions & 2 deletions os/kernel/Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[env.development]
CARGO_CFG_TARGET_FAMILY = "../../hhu_tosr"
CARGO_CFG_TARGET_FAMILY = "../../d3os_kernel"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/debug"
CARGO_BUILD_OPTION = "--lib"

[env.production]
CARGO_CFG_TARGET_FAMILY = "hhu_tosr"
CARGO_CFG_TARGET_FAMILY = "./../d3os_kernel"
BUILD_DIRECTORY = "${CARGO_MAKE_CRATE_TARGET_DIRECTORY}/${CARGO_CFG_TARGET_FAMILY}/release"
CARGO_BUILD_OPTION = "--release"

Expand Down
10 changes: 5 additions & 5 deletions os/kernel/src/banner.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
 __ __ ______ ____ _____  # Version : {}
 / /_ / /_ __ __ /_ __/ / __ \ / ___/ _____ # Git Ref : {} - {}
 / __ \ / __ \ / / / / / / / / / / \__ \ / ___/ # Build Date : {}
 / / / / / / / // /_/ / / / / /_/ / ___/ / / /  # Compiler : {}
/_/ /_/ /_/ /_/ \__,_/ /_/ \____/ /____/ /_/  # Bootloader : {}
 ____  _____ ____ _____ # Version : {}
 / __ \ |__ / / __ \ / ___/ # Git Ref : {} - {}
 / / / / /_ <  / / / / \__ \  # Build Date : {}
 / /_/ /  ___/ / / /_/ / ___/ /  # Compiler : {}
/_____/ /____/ \____/ /____/  # Bootloader : {}
6 changes: 3 additions & 3 deletions os/kernel/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const INIT_HEAP_PAGES: usize = 0x400;
pub extern "C" fn start(multiboot2_magic: u32, multiboot2_addr: *const BootInformationHeader) {
// Initialize logger
if logger().lock().init().is_err() {
panic!("Failed to initialize logger!")
panic!("Failed to initialize loggerr!")
}

// Log messages and panics are now working, but cannot use format string until the heap is initialized later on
info!("Welcome to hhuTOSr early boot environment!");
info!("Welcome to D3OS early boot environment!");

// Get multiboot information
if multiboot2_magic != multiboot2::MAGIC {
Expand Down Expand Up @@ -127,7 +127,7 @@ pub extern "C" fn start(multiboot2_magic: u32, multiboot2_addr: *const BootInfor
init_terminal(fb_info.address() as *mut u8, fb_info.pitch(), fb_info.width(), fb_info.height(), fb_info.bpp());
logger().lock().register(terminal());

info!("Welcome to hhuTOSr!");
info!("Welcome to D3OS!");
let version = format!("v{} ({} - O{})", built_info::PKG_VERSION, built_info::PROFILE, built_info::OPT_LEVEL);
let git_ref = built_info::GIT_HEAD_REF.unwrap_or("Unknown");
let git_commit = built_info::GIT_COMMIT_HASH_SHORT.unwrap_or("Unknown");
Expand Down
11 changes: 4 additions & 7 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ readonly CONST_QEMU_BIOS_EFI="efi/OVMF.fd"
readonly CONST_QEMU_ARGS="-boot d -vga std -rtc base=localtime -device isa-debug-exit"
readonly CONST_QEMU_OLD_AUDIO_ARGS="-soundhw pcspk"
readonly CONST_QEMU_NEW_AUDIO_ARGS="-audiodev id=pa,driver=pa -machine pcspk-audiodev=pa"
readonly CONST_QEMU_BOOT_DEVICE="-drive driver=raw,node-name=boot,file.driver=file,file.filename=hhuTOSr.img"
readonly CONST_QEMU_BOOT_DEVICE="-drive driver=raw,node-name=boot,file.driver=file,file.filename=d3os.img"

QEMU_BIOS=""
QEMU_MACHINE="${CONST_QEMU_MACHINE_PC}"
Expand Down Expand Up @@ -51,14 +51,11 @@ check_file() {

parse_file() {
local path=$1

if [[ $path == *.iso ]]; then
QEMU_BOOT_DEVICE="-boot d -cdrom ${path}"
elif [[ $path == *.img ]]; then
QEMU_BOOT_DEVICE="-drive driver=raw,node-name=boot,file.driver=file,file.filename=${path}"
else
printf "Invalid file '%s'!\\n" "${path}"
exit 1
fi

check_file $path
Expand Down Expand Up @@ -110,7 +107,7 @@ print_usage() {
printf "Usage: ./run.sh [OPTION...]
Available options:
-f, --file
Set the .iso or .img file, which qemu should boot (Default: hhuTOSr-towboot.img)
Set the .iso or .img file, which qemu should boot (Default: d3os.img)
-m, --machine
Set the machine profile, which qemu should emulate ([pc] | [pc-kvm]) (Defualt: pc)
-r, --ram
Expand All @@ -120,7 +117,7 @@ print_usage() {
-d, --debug
Set the port, on which qemu should listen for GDB clients (default: disabled)
-b, --bios
Set the BIOS file, which qemu should use (Default: Download newest OVMF)
Set the BIOS file, which qemu should use (Default: Download OVMF from Ubuntu 20.04 packages)
-h, --help
Show this help message\\n"
}
Expand Down

0 comments on commit 6681757

Please sign in to comment.