Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
160: fix bug by building the minimal version of libhermit r=stlankes a=stlankes

This PR should solve issue hermit-os#157 In addition, I add a small test to build the minimal configuration.

Co-authored-by: Stefan Lankes <slankes@eonerc.rwth-aachen.de>
Co-authored-by: Stefan Lankes <stlankes@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 24, 2021
2 parents e6957e4 + dd6cea1 commit c933757
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ jobs:
echo "C:\Program Files\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: ${{ matrix.os == 'windows-latest' }}
- name: Building minimal kernel
working-directory: libhermit-rs
run:
cargo build -Z build-std=core,alloc --target x86_64-unknown-hermit-kernel --no-default-features
- name: Building dev version
run:
cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
Expand Down
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ build:demo:
test:integration:
stage: test
image: ${CI_REGISTRY_IMAGE}
allow_failure: true
script:
- lscpu
- kvm-ok
- python3 --version
- cargo install uhyve
- HERMIT_LOG_LEVEL_FILTER=Debug cargo test --test '*' --no-fail-fast -Z build-std=core,alloc
-Z build-std-features=compiler-builtins-mem --no-default-features --features=pci,acpi
--target x86_64-unknown-hermit-kernel -- --uhyve_path=$HOME/.cargo/bin/uhyve --veryverbose
Expand All @@ -81,6 +83,7 @@ test:uhyve:
script:
- lscpu
- kvm-ok
- cargo install uhyve
- uhyve -v -c 1 rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- uhyve -v -c 2 rusty-hermit/target/x86_64-unknown-hermit/debug/rusty_demo
- uhyve -v -c 1 rusty-hermit/target/x86_64-unknown-hermit/release/rusty_demo
Expand Down
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN apt-get update && \
# Install Rust toolchain
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly --profile minimal
RUN /root/.cargo/bin/cargo install cargo-download
RUN /root/.cargo/bin/cargo install uhyve
RUN /root/.cargo/bin/rustup component add rust-src
RUN /root/.cargo/bin/rustup component add llvm-tools-preview

Expand Down
4 changes: 4 additions & 0 deletions src/drivers/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub mod virtio_net;

use crate::arch::kernel::apic;
use crate::arch::kernel::irq::ExceptionStackFrame;
#[cfg(feature = "pci")]
use crate::arch::kernel::pci;
use crate::arch::kernel::percore::*;
use crate::scheduler::task::TaskHandle;
Expand Down Expand Up @@ -145,13 +146,16 @@ pub extern "x86-interrupt" fn network_irqhandler(_stack_frame: &mut ExceptionSta
debug!("Receive network interrupt");
apic::eoi();

#[cfg(feature = "pci")]
let check_scheduler = match pci::get_network_driver() {
Some(driver) => driver.lock().handle_interrupt(),
_ => {
debug!("Unable to handle interrupt!");
false
}
};
#[cfg(not(feature = "pci"))]
let check_scheduler = false;

if check_scheduler {
core_scheduler().scheduler();
Expand Down

0 comments on commit c933757

Please sign in to comment.