Skip to content

Commit

Permalink
Merge pull request #265 from hermitcore/rename-rusty-loader
Browse files Browse the repository at this point in the history
feat: rename RustyLoader to hermit-loader
  • Loading branch information
mkroening authored Aug 26, 2023
2 parents 7a10b08 + 89a73a7 commit d964f75
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 46 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
- name: Install QEMU, NASM (macos)
if: matrix.os == 'macos-latest'
run: |
brew update
# enable once it works again
# brew update
brew install qemu nasm
- name: Install QEMU, NASM (windows)
if: matrix.os == 'windows-latest'
Expand All @@ -79,22 +80,22 @@ jobs:
-smp 1 -m 64M \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-display none -serial stdio \
-kernel target/x86_64/debug/rusty-loader \
-kernel target/x86_64/debug/hermit-loader \
-initrd data/x86_64/hello_world
qemu-system-x86_64 \
-cpu qemu64,apic,fsgsbase,fxsr,rdrand,rdtscp,xsave,xsaveopt \
-smp 1 -m 64M \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-display none -serial stdio \
-kernel target/x86_64/debug/rusty-loader \
-kernel target/x86_64/debug/hermit-loader \
-initrd data/x86_64/hello_c
- name: Run loader (aarch64)
if: matrix.target == 'aarch64'
run: |
qemu-system-aarch64 \
-machine virt,gic-version=3 -cpu cortex-a72 -smp 1 -m 512M \
-display none -serial stdio -semihosting \
-kernel target/aarch64/debug/rusty-loader \
-kernel target/aarch64/debug/hermit-loader \
-device guest-loader,addr=0x48000000,initrd=data/aarch64/hello_world
- name: Run loader (riscv64)
if: matrix.target == 'riscv64'
Expand All @@ -105,7 +106,7 @@ jobs:
-smp 1 \
-m 32M \
-display none -serial stdio \
-kernel target/riscv64/debug/rusty-loader \
-kernel target/riscv64/debug/hermit-loader \
-initrd data/riscv64/hello_world
- name: Build (release)
run: cargo xtask build --target ${{ matrix.target }} --release
Expand All @@ -117,22 +118,22 @@ jobs:
-smp 1 -m 64M \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-display none -serial stdio \
-kernel target/x86_64/release/rusty-loader \
-kernel target/x86_64/release/hermit-loader \
-initrd data/x86_64/hello_world
qemu-system-x86_64 \
-cpu qemu64,apic,fsgsbase,fxsr,rdrand,rdtscp,xsave,xsaveopt \
-smp 1 -m 64M \
-device isa-debug-exit,iobase=0xf4,iosize=0x04 \
-display none -serial stdio \
-kernel target/x86_64/release/rusty-loader \
-kernel target/x86_64/release/hermit-loader \
-initrd data/x86_64/hello_c
- name: Run loader (release, aarch64)
if: matrix.target == 'aarch64'
run: |
qemu-system-aarch64 \
-machine virt,gic-version=3 -cpu cortex-a72 -smp 1 -m 512M \
-display none -serial stdio -semihosting \
-kernel target/aarch64/release/rusty-loader \
-kernel target/aarch64/release/hermit-loader \
-device guest-loader,addr=0x48000000,initrd=data/aarch64/hello_world
- name: Run loader (release, riscv64)
if: matrix.target == 'riscv64'
Expand All @@ -143,5 +144,5 @@ jobs:
-smp 1 \
-m 32M \
-display none -serial stdio \
-kernel target/riscv64/release/rusty-loader \
-kernel target/riscv64/release/hermit-loader \
-initrd data/riscv64/hello_world
48 changes: 24 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rusty-loader"
name = "hermit-loader"
version = "0.4.4"
authors = ["Stefan Lankes <[email protected]>", "Colin Finck <[email protected]>"]
license = "MIT OR Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RustyLoader
# The Hermit Loader

**RustyLoader** is a loader to run [RustyHermit](https://github.com/hermitcore/libhermit-rs) within [QEMU](https://www.qemu.org).
This project is a loader to run the [Hermit kernel](https://github.com/hermitcore/kernel) within [QEMU](https://www.qemu.org).

## Requirements

Expand All @@ -15,7 +15,7 @@ $ cargo xtask build --target <TARGET> --release

With `<TARGET>` being either `x86_64`, `x86_64-uefi`, or `aarch64`.

Afterward, the loader is located at `target/<TARGET>/release/rusty-loader`.
Afterward, the loader is located at `target/<TARGET>/release/hermit-loader`.

## Running

Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/entry_fc.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; This is the kernel's entry point, if RustyHermit is running with
; This is the kernel's entry point, if Hermit is running with
; FireCracker. FireCracker assumes a 64 bit Linux kernel.

[BITS 64]
Expand Down
6 changes: 3 additions & 3 deletions src/arch/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub unsafe fn find_kernel() -> &'static [u8] {
paging::map::<Size4KiB>(page_address, page_address, 1, PageTableFlags::empty());
}

// Load the RustyHermit-ELF from the initrd supplied by Firecracker
// Load the Hermit-ELF from the initrd supplied by Firecracker
let ramdisk_address = *((&(boot_params as usize)
+ LINUX_SETUP_HEADER_OFFSET
+ RAMDISK_IMAGE_OFFSET) as *const u32);
Expand All @@ -150,7 +150,7 @@ pub unsafe fn find_kernel() -> &'static [u8] {
let elf_len = ramdisk_size as usize;

let free_memory_address = (&kernel_end as *const u8 as usize).align_up(Size2MiB::SIZE as usize);
// TODO: Workaround for https://github.com/hermitcore/rusty-loader/issues/96
// TODO: Workaround for https://github.com/hermitcore/loader/issues/96
let free_memory_address = cmp::max(free_memory_address, 0x800000);
info!("Intialize PhysAlloc with {:#x}", free_memory_address);
// Memory after the highest end address is unused and available for the physical memory manager.
Expand Down Expand Up @@ -221,7 +221,7 @@ pub unsafe fn find_kernel() -> &'static [u8] {
info!("Module length: {:#x}", elf_len);

let free_memory_address = end_address.align_up(Size2MiB::SIZE as usize);
// TODO: Workaround for https://github.com/hermitcore/rusty-loader/issues/96
// TODO: Workaround for https://github.com/hermitcore/loader/issues/96
let free_memory_address = cmp::max(free_memory_address, 0x800000);
// Memory after the highest end address is unused and available for the physical memory manager.
PhysAlloc::init(free_memory_address);
Expand Down
4 changes: 2 additions & 2 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ impl flags::Clippy {
let sh = Shell::new()?;

// TODO: Enable clippy for aarch64
// https://github.com/hermitcore/rusty-loader/issues/78
// https://github.com/hermitcore/loader/issues/78
// TODO: Enable clippy for x86_64-uefi
// https://github.com/hermitcore/rusty-loader/issues/122
// https://github.com/hermitcore/loader/issues/122
#[allow(clippy::single_element_loop)]
for target in [Target::X86_64, Target::Riscv64] {
target.install()?;
Expand Down
6 changes: 3 additions & 3 deletions xtask/src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ impl Target {

pub fn build_name(&self) -> &'static str {
match self {
Self::X86_64Uefi => "rusty-loader.efi",
_ => "rusty-loader",
Self::X86_64Uefi => "hermit-loader.efi",
_ => "hermit-loader",
}
}

pub fn dist_name(&self) -> &'static str {
match self {
Self::X86_64Uefi => "BootX64.efi",
_ => "rusty-loader",
_ => "hermit-loader",
}
}
}
Expand Down

0 comments on commit d964f75

Please sign in to comment.