From fc584753c1a203a8715b6587a8b5692722d408ed Mon Sep 17 00:00:00 2001 From: WangRunji Date: Mon, 25 Mar 2019 18:13:43 +0800 Subject: [PATCH] update crate x86_64 to v0.5, bootloader to v0.4 --- kernel/Cargo.lock | 27 ++++++++------------------- kernel/Cargo.toml | 2 +- kernel/src/arch/x86_64/paging.rs | 9 +++++++-- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/kernel/Cargo.lock b/kernel/Cargo.lock index d02cb3a..33aa5a6 100644 --- a/kernel/Cargo.lock +++ b/kernel/Cargo.lock @@ -34,16 +34,6 @@ dependencies = [ "x86 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "apic" -version = "0.1.0" -source = "git+https://github.com/wangrunji0408/APIC-Rust#5ddc5fba952ae7420bcf3b7af3d79004e2b8c12f" -dependencies = [ - "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "x86 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "array-init" version = "0.0.4" @@ -93,10 +83,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bootloader" -version = "0.3.14" -source = "git+https://github.com/rcore-os/bootloader#301082be285196d285c0a07ea2c2f49d053b4d64" +version = "0.4.0" +source = "git+https://github.com/rcore-os/bootloader#18e4fec0d82e8a5571abceb69d1d11fc0edccba1" dependencies = [ - "apic 0.1.0 (git+https://github.com/wangrunji0408/APIC-Rust)", + "apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)", "fixedvec 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "font8x8 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "usize_conversions 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -310,7 +300,7 @@ dependencies = [ "bit-allocator 0.1.0", "bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bootloader 0.3.14 (git+https://github.com/rcore-os/bootloader)", + "bootloader 0.4.0 (git+https://github.com/rcore-os/bootloader)", "buddy_system_allocator 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "console-traits 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -331,7 +321,7 @@ dependencies = [ "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "uart_16550 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "x86_64 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "x86_64 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "xmas-elf 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -562,7 +552,7 @@ dependencies = [ [[package]] name = "x86_64" -version = "0.4.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "array-init 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -590,14 +580,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum aarch64 2.2.2 (git+https://github.com/equation314/aarch64)" = "" "checksum aarch64 2.2.2 (git+https://github.com/rcore-os/aarch64)" = "" "checksum apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)" = "" -"checksum apic 0.1.0 (git+https://github.com/wangrunji0408/APIC-Rust)" = "" "checksum array-init 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "23589ecb866b460d3a0f1278834750268c607e8e28a1b982c907219f3178cd72" "checksum bare-metal 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a3caf393d93b2d453e80638d0674597020cef3382ada454faacd43d1a55a735a" "checksum bcm2837 0.1.0 (git+https://github.com/rcore-os/bcm2837)" = "" "checksum bit_field 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8765909f9009617974ab6b7d332625b320b33c326b1e9321382ef1999b5d56" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum bitvec 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfadef5c4e2c2e64067b9ecc061179f12ac7ec65ba613b1f60f3972bbada1f5b" -"checksum bootloader 0.3.14 (git+https://github.com/rcore-os/bootloader)" = "" +"checksum bootloader 0.4.0 (git+https://github.com/rcore-os/bootloader)" = "" "checksum buddy_system_allocator 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2ed828f1e227d6e32b998d6375b67fd63ac5389d50b23f258ce151d22b6cc595" "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" "checksum cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ce8bb087aacff865633f0bd5aeaed910fe2fe55b55f4739527f2e023a2e53d" @@ -655,6 +644,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum x86 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "841e1ca5a87068718a2a26f2473c6f93cf3b8119f9778fa0ae4b39b664d9e66a" "checksum x86_64 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd647af1614659e1febec1d681231aea4ebda4818bf55a578aff02f3e4db4b4" "checksum x86_64 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f9258d7e2dd25008d69e8c9e9ee37865887a5e1e3d06a62f1cb3f6c209e6f177" -"checksum x86_64 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cde165515f1dbfcf7142af04c1a98fbe4f78babae08ff329a27c218cd71eda06" +"checksum x86_64 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8f7e92e985f4052118fd69f2b366c67e91288c0f01f4ae52610dce236425dfa0" "checksum xmas-elf 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "22678df5df766e8d1e5d609da69f0c3132d794edf6ab5e75e7abcd2270d4cf58" "checksum zero 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5f1bc8a6b2005884962297587045002d8cfb8dcec9db332f4ca216ddc5de82c5" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 4af0534..b5c9e30 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -61,7 +61,7 @@ rcore-fs-sfs = { git = "https://github.com/rcore-os/rcore-fs", branch = "sefs" } [target.'cfg(target_arch = "x86_64")'.dependencies] bootloader = { git = "https://github.com/rcore-os/bootloader" } apic = { git = "https://github.com/rcore-os/apic-rs" } -x86_64 = "0.4" +x86_64 = "0.5" raw-cpuid = "6.0" uart_16550 = "0.1" pc-keyboard = "0.5" diff --git a/kernel/src/arch/x86_64/paging.rs b/kernel/src/arch/x86_64/paging.rs index bf4221d..c241d53 100644 --- a/kernel/src/arch/x86_64/paging.rs +++ b/kernel/src/arch/x86_64/paging.rs @@ -4,8 +4,13 @@ use rcore_memory::paging::*; use x86_64::instructions::tlb; use x86_64::PhysAddr; use x86_64::registers::control::{Cr3, Cr3Flags}; -use x86_64::structures::paging::{Mapper, PageTable as x86PageTable, PageTableEntry, PageTableFlags as EF, RecursivePageTable}; -use x86_64::structures::paging::{FrameAllocator, FrameDeallocator, Page, PageRange, PhysFrame as Frame, Size4KiB}; +use x86_64::structures::paging::{ + page_table::{PageTable as x86PageTable, PageTableEntry, PageTableFlags as EF}, + mapper::{Mapper, RecursivePageTable}, + page::{Page, PageRange, Size4KiB}, + frame::PhysFrame as Frame, + FrameAllocator, FrameDeallocator +}; use log::*; pub trait PageExt {