Skip to content

Commit

Permalink
Fix compilation errors (#184)
Browse files Browse the repository at this point in the history
* Replace pic8259_simple with pic8259

* Update x86_64 crate

* Update linked_list_allocator crate

* Update uart_16550 crate

* Update code

* Run apt update in github workflow

* Update bootloader crate
  • Loading branch information
vinc authored Jun 27, 2021
1 parent 0fd0378 commit c2572ea
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 47 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
toolchain: nightly
default: true
override: true
- run: sudo apt-get -qqy update
- run: sudo apt-get -qqy install qemu-system-x86
- run: rustup component add rust-src
- run: rustup component add llvm-tools-preview
Expand Down
65 changes: 29 additions & 36 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ aml = "0.10.0"
array-macro = "1.0.5"
base64 = { version = "0.13.0", default-features = false }
bit_field = "0.10.0"
bootloader = { version = "0.9.5", features = ["map_physical_memory"] }
bootloader = { version = "0.9.18", features = ["map_physical_memory"] }
hmac = { version = "0.7.1", default-features = false }
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
libm = "0.2.1"
linked_list_allocator = "0.8.9"
linked_list_allocator = "0.9.0"
pbkdf2 = { version = "0.3.0", default-features = false }
pc-keyboard = "0.5.1"
pic8259_simple = "0.2.0"
pic8259 = "0.10.0"
rand = { version = "0.8.3", default-features = false }
rand_chacha = { version = "0.3.0", default-features = false }
rand_core = { version = "0.6.0", default-features = false }
raw-cpuid = "8.1.0"
sha2 = { version = "0.8.2", default-features = false }
smoltcp = { version = "0.6.0", default-features = false, features = ["alloc", "ethernet", "socket-tcp", "socket-udp", "proto-ipv4", "proto-dhcpv4"] }
spin = "0.7.0"
uart_16550 = "0.2.7"
uart_16550 = "0.2.15"
volatile = "0.2.6"
vte = "0.10.0"
x86_64 = "0.12.3"
x86_64 = "0.14.3"
time = { version = "0.2.23", default-features = false }

[package.metadata.bootimage]
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn default_handler() {

macro_rules! irq_handler {
($handler:ident, $irq:expr) => {
pub extern "x86-interrupt" fn $handler(_stack_frame: &mut InterruptStackFrame) {
pub extern "x86-interrupt" fn $handler(_stack_frame: InterruptStackFrame) {
let handlers = IRQ_HANDLERS.lock();
handlers[$irq]();
unsafe { kernel::pic::PICS.lock().notify_end_of_interrupt(interrupt_index($irq)); }
Expand Down Expand Up @@ -102,10 +102,10 @@ pub fn clear_irq_mask(irq: u8) {
}
}

extern "x86-interrupt" fn breakpoint_handler(stack_frame: &mut InterruptStackFrame) {
extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) {
print!("EXCEPTION: BREAKPOINT\n{:#?}\n", stack_frame);
}

extern "x86-interrupt" fn double_fault_handler(stack_frame: &mut InterruptStackFrame, _error_code: u64) -> ! {
extern "x86-interrupt" fn double_fault_handler(stack_frame: InterruptStackFrame, _error_code: u64) -> ! {
panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame);
}
3 changes: 1 addition & 2 deletions src/kernel/mem.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::{kernel, log};
use bootloader::bootinfo::{BootInfo, MemoryMap, MemoryRegionType};
use x86_64::structures::paging::mapper::MapperAllSizes;
use x86_64::structures::paging::{FrameAllocator, OffsetPageTable, PageTable, PhysFrame, Size4KiB};
use x86_64::structures::paging::{FrameAllocator, OffsetPageTable, PageTable, PhysFrame, Size4KiB, Translate};
use x86_64::{PhysAddr, VirtAddr};

// NOTE: This static is mutable but it'll be changed only once during initialization
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/pic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pic8259_simple::ChainedPics;
use pic8259::ChainedPics;
use spin::Mutex;

pub const PIC_1_OFFSET: u8 = 32;
Expand Down

0 comments on commit c2572ea

Please sign in to comment.