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

fix bug by building the minimal version of libhermit #160

Merged
merged 10 commits into from
Jan 24, 2021
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ 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
run:
cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit --manifest-path=Cargo.toml --no-default-features
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to specify the crate you want to build with --no-default-features, e.g. by adding -p rusty_demo.

- name: Building dev version
run:
cargo build -Z build-std=std,core,alloc,panic_abort --target x86_64-unknown-hermit
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