diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c33968dab..58e9d9fcd 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -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 diff --git a/Cargo.lock b/Cargo.lock index f93ba6d71..86d77aaa6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "acpi" version = "2.2.0" @@ -81,9 +83,9 @@ dependencies = [ [[package]] name = "bootloader" -version = "0.9.12" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452bbab4eae8767805ff09386c9e26d42ceb6964916ab3c64425469342473f91" +checksum = "7a3c1ceed1cd9e61c7998100cc18c13d413aa40d018992b871ab8e7435ce6372" [[package]] name = "byte-tools" @@ -115,12 +117,6 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" -[[package]] -name = "cpuio" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d531514efb06912141fa65967447de805691b685a7565c87d1765afe34a98aa7" - [[package]] name = "crypto-mac" version = "0.7.0" @@ -182,18 +178,18 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "linked_list_allocator" -version = "0.8.11" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822add9edb1860698b79522510da17bef885171f75aa395cff099d770c609c24" +checksum = "d0b725207570aa16096962d0b20c79f8a543df2280bd3c903022b9b0b4d7ea68" dependencies = [ "spinning_top", ] [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" dependencies = [ "scopeguard", ] @@ -229,7 +225,7 @@ dependencies = [ "linked_list_allocator", "pbkdf2", "pc-keyboard", - "pic8259_simple", + "pic8259", "rand", "rand_chacha", "rand_core", @@ -239,9 +235,9 @@ dependencies = [ "spin 0.7.1", "time", "uart_16550", - "volatile", + "volatile 0.2.7", "vte", - "x86_64 0.12.4", + "x86_64", ] [[package]] @@ -267,12 +263,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6f2d937e3b8d63449b01401e2bae4041bc9dd1129c2e3e0d239407cf6635ac" [[package]] -name = "pic8259_simple" -version = "0.2.0" +name = "pic8259" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2a5497fb8e59bf8015f67b7dff238d75ef445e03f23edac24ac3a8f09be952" +checksum = "08cc920d83ee33c0f9b73aa441e75468bf2d10c959a3eb6260cf720b05ac91a1" dependencies = [ - "cpuio", + "x86_64", ] [[package]] @@ -417,9 +413,9 @@ checksum = "13287b4da9d1207a4f4929ac390916d64eacfe236a487e9a9f5b3be392be5162" [[package]] name = "spinning_top" -version = "0.1.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "047031d6df5f5ae0092c97aa4f6bb04cfc9c081b4cd4cb9cdb38657994279a00" +checksum = "75adad84ee84b521fb2cca2d4fd0f1dab1d8d026bda3c5bea4ca63b5f9f9293c" dependencies = [ "lock_api", ] @@ -493,12 +489,12 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" [[package]] name = "uart_16550" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d45a3c9181dc9ba7d35d02b3c36d1604155289d935b7946510fb3d2f4b976d9" +checksum = "65ad019480ef5ff8ffe66d6f6a259cd87cf317649481394981db1739d844f374" dependencies = [ "bitflags", - "x86_64 0.13.2", + "x86_64", ] [[package]] @@ -525,6 +521,12 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6b06ad3ed06fef1713569d547cdbdb439eafed76341820fb0e0344f29a41945" +[[package]] +name = "volatile" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c2dbd44eb8b53973357e6e207e370f0c1059990df850aca1eca8947cf464f0" + [[package]] name = "vte" version = "0.10.0" @@ -548,20 +550,11 @@ dependencies = [ [[package]] name = "x86_64" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3a6840d540b8dbe400f4ed5afe5816105ee5edebe485299a761d0d8b43cef7" -dependencies = [ - "bit_field 0.9.0", - "bitflags", -] - -[[package]] -name = "x86_64" -version = "0.13.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b871116e3c83dad0795580b10b2b1dd05cb52ec719af36180371877b09681f7f" +checksum = "b7c54a17492391c594753ce2a180142bec7ad2876543565c2a08aa11cddef251" dependencies = [ "bit_field 0.9.0", "bitflags", + "volatile 0.4.4", ] diff --git a/Cargo.toml b/Cargo.toml index 2ecc9fc49..790702672 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,14 +23,14 @@ 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 } @@ -38,10 +38,10 @@ 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] diff --git a/src/kernel/idt.rs b/src/kernel/idt.rs index 15010308e..c5161de7b 100644 --- a/src/kernel/idt.rs +++ b/src/kernel/idt.rs @@ -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)); } @@ -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); } diff --git a/src/kernel/mem.rs b/src/kernel/mem.rs index 82b4080da..c9681b53d 100644 --- a/src/kernel/mem.rs +++ b/src/kernel/mem.rs @@ -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 diff --git a/src/kernel/pic.rs b/src/kernel/pic.rs index abe8bba4f..bda1d3512 100644 --- a/src/kernel/pic.rs +++ b/src/kernel/pic.rs @@ -1,4 +1,4 @@ -use pic8259_simple::ChainedPics; +use pic8259::ChainedPics; use spin::Mutex; pub const PIC_1_OFFSET: u8 = 32;