Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace HermitCore with Hermit #927

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Download loader
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: hermitcore/rusty-loader
repo: hermit-os/loader
file: rusty-loader-x86_64
- name: Integration tests
run: cargo test --tests --no-fail-fast --target x86_64-unknown-none -- --bootloader_path=rusty-loader-x86_64
Expand All @@ -124,7 +124,7 @@ jobs:
- name: Checkout hermit-rs
uses: actions/checkout@v4
with:
repository: hermitcore/hermit-rs
repository: hermit-os/hermit-rs
submodules: true
- name: Remove hermit-kernel submodule
run: git rm -r kernel
Expand All @@ -149,7 +149,7 @@ jobs:
- name: Download loader
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: hermitcore/rusty-loader
repo: hermit-os/loader
file: rusty-loader-x86_64
- name: Install virtiofsd
run: cargo install virtiofsd
Expand Down Expand Up @@ -182,7 +182,7 @@ jobs:
- name: Checkout hermit-rs
uses: actions/checkout@v4
with:
repository: hermitcore/hermit-rs
repository: hermit-os/hermit-rs
submodules: true
- name: Remove hermit-kernel submodule
run: git rm -r kernel
Expand All @@ -194,7 +194,7 @@ jobs:
- name: Download loader
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: hermitcore/rusty-loader
repo: hermit-os/loader
file: rusty-loader-aarch64
- uses: mkroening/rust-toolchain-toml@main
- uses: mkroening/rust-toolchain-toml@main
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
- name: Checkout hermit-rs
uses: actions/checkout@v4
with:
repository: hermitcore/hermit-rs
repository: hermit-os/hermit-rs
submodules: true
- name: Remove hermit-kernel submodule
run: git rm -r kernel
Expand All @@ -251,12 +251,12 @@ jobs:
uses: dsaltares/fetch-gh-release-asset@master
with:
file: rusty-loader-x86_64
repo: hermitcore/rusty-loader
repo: hermit-os/loader
- name: Download loader (x86_64-fc)
uses: dsaltares/fetch-gh-release-asset@master
with:
file: rusty-loader-x86_64-fc
repo: hermitcore/rusty-loader
repo: hermit-os/loader
- name: Install firecracker
run: |
# https://github.com/firecracker-microvm/firecracker/blob/7c5fc8707f26c4244d48a747631ab0fb31fc4c39/docs/getting-started.md#getting-a-firecracker-binary
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
<html>
<head>
<title>Redirect!</title>
<meta http-equiv="refresh" content="0; url=https://hermitcore.github.io/kernel/hermit/" />
<meta http-equiv="refresh" content="0; url=https://hermit-os.github.io/kernel/hermit/" />
</head>
<body>
<p><a href="https://hermitcore.github.io/kernel/hermit/">Redirect</a></p>
<p><a href="https://hermit-os.github.io/kernel/hermit/">Redirect</a></p>
</body>
</html>
EOL
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["unikernel", "libos"]
categories = ["os"]
repository = "https://github.com/hermitcore/kernel"
documentation = "https://hermitcore.github.io/kernel/hermit/"
repository = "https://github.com/hermit-os/kernel"
documentation = "https://hermit-os.github.io/kernel/hermit/"
edition = "2021"
description = "A Rust-based library operating system"
exclude = [
Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<img width="256" align="right" src="https://github.com/hermitcore/.github/blob/main/img/Hermit.svg" />
<img width="256" align="right" src="https://github.com/hermit-os/.github/blob/main/img/Hermit.svg" />

# Hermit Kernel

[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hermitcore.github.io/kernel/hermit/)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://hermit-os.github.io/kernel/hermit/)
![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue)
[![Zulip Badge](https://img.shields.io/badge/chat-hermit-57A37C?logo=zulip)](https://hermit.zulipchat.com/)

This is the kernel of the [Hermit](https://github.com/hermitcore) unikernel project.
This is the kernel of the [Hermit](https://github.com/hermit-os) unikernel project.

## Requirements

Expand All @@ -17,8 +17,8 @@ This is the kernel of the [Hermit](https://github.com/hermitcore) unikernel proj

Usually the kernel will be linked as static library to your applications.

- **Rust applications:** Instructions can be found in the [hermit-rs](https://github.com/hermitcore/hermit-rs) repository.
- **For C/C++ applications:** Instructions can be found in the [hermit-playground](https://github.com/hermitcore/hermit-playground) repository.
- **Rust applications:** Instructions can be found in the [hermit-rs](https://github.com/hermit-os/hermit-rs) repository.
- **For C/C++ applications:** Instructions can be found in the [hermit-playground](https://github.com/hermit-os/hermit-playground) repository.


### Standalone static library build
Expand Down Expand Up @@ -53,8 +53,6 @@ This kernel is derived from following tutorials and software distributions:
[kidd]: http://www.randomhacks.net/bare-metal-rust/
[eduos]: http://rwth-os.github.io/eduOS-rs/

HermitCore's Emoji is provided for free by [EmojiOne](https://www.gfxmag.com/crab-emoji-vector-icon/).

## License

Licensed under either of
Expand All @@ -68,5 +66,5 @@ at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

The kernel is being developed on [hermitcore/kernel](https://github.com/hermitcore/kernel).
The kernel is being developed on [hermit-os/kernel](https://github.com/hermit-os/kernel).
Create your own fork, send us a pull request, and chat with us on [Zulip](https://hermit.zulipchat.com/).
2 changes: 1 addition & 1 deletion src/arch/aarch64/kernel/systemtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn init() {

let boot_time =
OffsetDateTime::from_unix_timestamp(rtc_read(RTC_DR) as i64).unwrap();
info!("HermitCore-rs booted on {boot_time}");
info!("Hermit booted on {boot_time}");

let micros = u64::try_from(boot_time.unix_timestamp_nanos() / 1000).unwrap();
BOOT_TIME.set(micros).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/arch/aarch64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ where
/// Returns the next subtable for the given page in the page table hierarchy.
///
/// Must only be called if a page of this size is mapped in a subtable!
// FIXME: https://github.com/hermitcore/kernel/issues/771
// FIXME: https://github.com/hermit-os/kernel/issues/771
#[allow(clippy::mut_from_ref)]
fn subtable<S: PageSize>(&self, page: Page<S>) -> &mut PageTable<L::SubtableLevel> {
assert!(L::LEVEL < S::MAP_LEVEL);
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/kernel/acpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ pub fn poweroff() -> Result<Infallible, ()> {
pub fn init() {
// Detect the RSDP and get a pointer to either the XSDT (64-bit) or RSDT (32-bit), whichever is available.
// Both are called RSDT in the following.
let rsdp = detect_acpi().expect("HermitCore requires an ACPI-compliant system");
let rsdp = detect_acpi().expect("Hermit requires an ACPI-compliant system");
let rsdt_physical_address = if rsdp.revision >= 2 {
PhysAddr(rsdp.xsdt_physical_address)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/kernel/apic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ fn calibrate_timer() {
// The APIC Timer is used to provide a one-shot interrupt for the tickless timer
// implemented through processor::get_timer_ticks.
// Therefore determine a counter value for 1 microsecond, which is the resolution
// used throughout all of HermitCore. Wait 30ms for accuracy.
// used throughout all of Hermit. Wait 30ms for accuracy.
let microseconds = 30_000;

// Be sure that all interrupts for calibration accuracy and initialize the counter are disabled.
Expand Down
4 changes: 2 additions & 2 deletions src/arch/x86_64/kernel/boot.asm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
; This is the entry point for the application processors.
; It is loaded at 0x8000 by HermitCore and filled with parameters.
; It is loaded at 0x8000 by Hermit and filled with parameters.
; It does the switch from Real Mode -> Protected Mode -> Long Mode,
; sets up CR3 for this CPU, and then calls into _start.
;
; In contrast to this self-contained entry point, _start is linked
; to the rest of HermitCore and thus has access to all exported symbols
; to the rest of Hermit and thus has access to all exported symbols
; (like the actual Rust entry point).


Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/kernel/pci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl ConfigRegionAccess for PciConfigRegion {
pub(crate) fn init() {
debug!("Scanning PCI Busses 0 to {}", PCI_MAX_BUS_NUMBER - 1);

// HermitCore only uses PCI for network devices.
// Hermit only uses PCI for network devices.
// Therefore, multifunction devices as well as additional bridges are not scanned.
// We also limit scanning to the first 32 buses.
let pci_config = PciConfigRegion::new();
Expand Down
6 changes: 3 additions & 3 deletions src/arch/x86_64/kernel/systemtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ pub fn init() {
let boot_time = match boot_info().platform_info {
PlatformInfo::Multiboot { .. } => {
// Get the current time in microseconds since the epoch (1970-01-01) from the x86 RTC.
// Subtract the timer ticks to get the actual time when HermitCore-rs was booted.
// Subtract the timer ticks to get the actual time when Hermit was booted.
let current_time = without_interrupts(|| Rtc::new().get_microseconds_since_epoch());
let boot_time = current_time - processor::get_timer_ticks();
OffsetDateTime::from_unix_timestamp_nanos(boot_time as i128 * 1000).unwrap()
}
PlatformInfo::LinuxBootParams { .. } => {
// Get the current time in microseconds since the epoch (1970-01-01) from the x86 RTC.
// Subtract the timer ticks to get the actual time when HermitCore-rs was booted.
// Subtract the timer ticks to get the actual time when Hermit was booted.
let current_time = without_interrupts(|| Rtc::new().get_microseconds_since_epoch());
let boot_time = current_time - processor::get_timer_ticks();
OffsetDateTime::from_unix_timestamp_nanos(boot_time as i128 * 1000).unwrap()
}
PlatformInfo::Uhyve { boot_time, .. } => boot_time,
};
info!("HermitCore-rs booted on {boot_time}");
info!("Hermit booted on {boot_time}");

let micros = u64::try_from(boot_time.unix_timestamp_nanos() / 1000).unwrap();
BOOT_TIME.set(micros).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/arch/x86_64/mm/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ pub fn init_page_tables() {
// Uhyve identity-maps the first Gibibyte of memory (512 page table entries * 2MiB pages)
// We now unmap all memory after the kernel image, so that we can remap it ourselves later for the heap.
// Ideally, uhyve would only map as much memory as necessary, but this requires a hermit-entry ABI jump.
// See https://github.com/hermitcore/uhyve/issues/426
// See https://github.com/hermit-os/uhyve/issues/426
let kernel_end_addr = x86_64::VirtAddr::new(mm::kernel_end_address().as_u64());
let start_page = Page::<Size2MiB>::from_start_address(kernel_end_addr).unwrap();
let end_page = Page::from_page_table_indices_2mib(
Expand Down
2 changes: 1 addition & 1 deletion src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::arch;
pub struct Console(());

/// A collection of methods that are required to format
/// a message to HermitCore's console.
/// a message to Hermit's console.
impl fmt::Write for Console {
/// Print a string of characters.
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct Cli {
args: Vec<String>,
}

/// Whether HermitCore is running under the "uhyve" hypervisor.
/// Whether Hermit is running under the "uhyve" hypervisor.
pub fn is_uhyve() -> bool {
matches!(boot_info().platform_info, PlatformInfo::Uhyve { .. })
}
Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! First version is derived and adapted for HermitCore from
//! First version is derived and adapted for Hermit from
//! Philipp Oppermann's excellent series of blog posts (<http://blog.phil-opp.com/>)
//! and Eric Kidd's toy OS (<https://github.com/emk/toyos-rs>).

Expand Down Expand Up @@ -258,9 +258,9 @@ extern "C" fn initd(_arg: usize) {
init_rtl8139_netif(processor::get_frequency() as u32);
}

info!("HermitCore is running on common system!");
info!("Hermit is running on common system!");
} else {
info!("HermitCore is running on uhyve!");
info!("Hermit is running on uhyve!");
}

// Initialize Drivers
Expand Down Expand Up @@ -299,7 +299,7 @@ fn synch_all_cores() {
}
}

/// Entry Point of HermitCore for the Boot Processor
/// Entry Point of Hermit for the Boot Processor
#[cfg(target_os = "none")]
fn boot_processor_main() -> ! {
// Initialize the kernel and hardware.
Expand All @@ -308,7 +308,7 @@ fn boot_processor_main() -> ! {
logging::init();
}

info!("Welcome to HermitCore-rs {}", env!("CARGO_PKG_VERSION"));
info!("Welcome to Hermit {}", env!("CARGO_PKG_VERSION"));
info!("Kernel starts at {:p}", env::get_base_address());

extern "C" {
Expand Down Expand Up @@ -349,7 +349,7 @@ fn boot_processor_main() -> ! {
PerCoreScheduler::run();
}

/// Entry Point of HermitCore for an Application Processor
/// Entry Point of Hermit for an Application Processor
#[cfg(all(target_os = "none", feature = "smp"))]
fn application_processor_main() -> ! {
arch::application_processor_init();
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ macro_rules! kernel_function {
}

// TODO: Properly switch kernel stack with newlib
// https://github.com/hermitcore/kernel/issues/471
// https://github.com/hermit-os/kernel/issues/471
#[cfg(all(target_arch = "x86_64", feature = "newlib"))]
macro_rules! kernel_function {
($f:ident($($x:tt)*)) => {{
Expand Down
2 changes: 1 addition & 1 deletion src/mm/allocator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Implementation of the HermitCore Allocator for dynamically allocating heap memory
//! Implementation of the Hermit Allocator for dynamically allocating heap memory
//! in the kernel.

use core::alloc::{GlobalAlloc, Layout};
Expand Down
4 changes: 2 additions & 2 deletions src/mm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub(crate) fn init() {

#[cfg(feature = "newlib")]
{
info!("An application with a C-based runtime is running on top of HermitCore!");
info!("An application with a C-based runtime is running on top of Hermit!");
let kernel_heap_size = 10 * LargePageSize::SIZE as usize;

unsafe {
Expand All @@ -133,7 +133,7 @@ pub(crate) fn init() {

#[cfg(not(feature = "newlib"))]
{
info!("A pure Rust application is running on top of HermitCore!");
info!("A pure Rust application is running on top of Hermit!");

// At first, we map only a small part into the heap.
// Afterwards, we already use the heap and map the rest into
Expand Down
2 changes: 1 addition & 1 deletion src/syscalls/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extern "C" fn __sys_clock_getres(clock_id: u64, res: *mut timespec) -> i32 {

match clock_id {
CLOCK_REALTIME | CLOCK_PROCESS_CPUTIME_ID | CLOCK_THREAD_CPUTIME_ID | CLOCK_MONOTONIC => {
// All clocks in HermitCore have 1 microsecond resolution.
// All clocks in Hermit have 1 microsecond resolution.
microseconds_to_timespec(1, result);
0
}
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ impl Build {
.unwrap_or_default();

// TODO: Re-enable mutable-noalias
// https://github.com/hermitcore/kernel/issues/200
// https://github.com/hermit-os/kernel/issues/200
rustflags.push("-Zmutable-noalias=no");

if self.instrument_mcount {
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl Clippy {
.arg("--features=acpi,fsgsbase,pci,smp,vga")
.run()?;
// TODO: Enable clippy for newlib
// https://github.com/hermitcore/kernel/issues/470
// https://github.com/hermit-os/kernel/issues/470
// cmd!(sh, "cargo clippy {target_args...}")
// .arg("--no-default-features")
// .arg("--features=acpi,fsgsbase,newlib,smp,vga")
Expand Down