diff --git a/bootloader/Cargo.lock b/bootloader/Cargo.lock index 2100950..4eaba05 100644 --- a/bootloader/Cargo.lock +++ b/bootloader/Cargo.lock @@ -2,8 +2,8 @@ # It is not intended for manual editing. [[package]] name = "aarch64" -version = "2.2.2" -source = "git+https://github.com/rcore-os/aarch64#14a08f4d285ae0ff515b03bff9f5e66eb68feaed" +version = "2.5.0" +source = "git+https://github.com/rcore-os/aarch64#797c24f07f9d90542eb094530b6f63fe3ea7dded" 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)", @@ -14,8 +14,8 @@ dependencies = [ [[package]] name = "bcm2837" -version = "0.1.0" -source = "git+https://github.com/rcore-os/bcm2837#446f0ea04deb5216ba5e08f10af36e5c1729e6fd" +version = "1.0.0" +source = "git+https://github.com/rcore-os/bcm2837#b29a8db5504b7eaa6f8adf2c3ff916d1ffd15194" dependencies = [ "volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -98,8 +98,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "rcore-bootloader" version = "0.1.0" dependencies = [ - "aarch64 2.2.2 (git+https://github.com/rcore-os/aarch64)", - "bcm2837 0.1.0 (git+https://github.com/rcore-os/bcm2837)", + "aarch64 2.5.0 (git+https://github.com/rcore-os/aarch64)", + "bcm2837 1.0.0 (git+https://github.com/rcore-os/bcm2837)", "cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "fixedvec 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "xmas-elf 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -205,8 +205,8 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum aarch64 2.2.2 (git+https://github.com/rcore-os/aarch64)" = "" -"checksum bcm2837 0.1.0 (git+https://github.com/rcore-os/bcm2837)" = "" +"checksum aarch64 2.5.0 (git+https://github.com/rcore-os/aarch64)" = "" +"checksum bcm2837 1.0.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 cc 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "c9ce8bb087aacff865633f0bd5aeaed910fe2fe55b55f4739527f2e023a2e53d" diff --git a/bootloader/Cargo.toml b/bootloader/Cargo.toml index 26ecb92..7fca683 100644 --- a/bootloader/Cargo.toml +++ b/bootloader/Cargo.toml @@ -9,8 +9,8 @@ xmas-elf = "0.6.2" fixedvec = "0.2.3" [target.'cfg(target_arch = "aarch64")'.dependencies] -aarch64 = { git = "https://github.com/rcore-os/aarch64" } -bcm2837 = { git = "https://github.com/rcore-os/bcm2837" } +aarch64 = { git = "https://github.com/rcore-os/aarch64", version = "2.5.0" } +bcm2837 = { git = "https://github.com/rcore-os/bcm2837", version = "1.0.0" } [build-dependencies] cc = "1.0" diff --git a/bootloader/src/main.rs b/bootloader/src/main.rs index c886029..e9c16a5 100644 --- a/bootloader/src/main.rs +++ b/bootloader/src/main.rs @@ -10,11 +10,7 @@ extern crate xmas_elf; use core::mem::transmute; use core::slice; use fixedvec::FixedVec; -use xmas_elf::{ - header, - program::{ProgramHeader, ProgramHeader32, ProgramHeader64}, - ElfFile, -}; +use xmas_elf::{header, program::{self, ProgramHeader}, ElfFile}; #[cfg(target_arch = "aarch64")] #[path = "arch/aarch64/mod.rs"] @@ -46,7 +42,7 @@ pub extern "C" fn boot_main() -> ! { let kernel_elf = ElfFile::new(kernel).unwrap(); header::sanity_check(&kernel_elf).unwrap(); - let mut preallocated_space = alloc_stack!([ProgramHeader64; 32]); + let mut preallocated_space = alloc_stack!([program::ProgramHeader64; 32]); let mut segments = FixedVec::new(&mut preallocated_space); for program_header in kernel_elf.program_iter() { @@ -76,7 +72,7 @@ pub extern "C" fn boot_main() -> ! { let kernel_elf = ElfFile::new(kernel).unwrap(); header::sanity_check(&kernel_elf).unwrap(); - let mut preallocated_space = alloc_stack!([ProgramHeader32; 32]); + let mut preallocated_space = alloc_stack!([program::ProgramHeader32; 32]); let mut segments = FixedVec::new(&mut preallocated_space); for program_header in kernel_elf.program_iter() { diff --git a/kernel/Cargo.lock b/kernel/Cargo.lock index b76366e..15dc395 100644 --- a/kernel/Cargo.lock +++ b/kernel/Cargo.lock @@ -1,21 +1,9 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "aarch64" -version = "2.2.2" -source = "git+https://github.com/equation314/aarch64#14a08f4d285ae0ff515b03bff9f5e66eb68feaed" -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)", - "register 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "usize_conversions 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ux 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "aarch64" version = "2.5.0" -source = "git+https://github.com/rcore-os/aarch64#e52eae8dc35069661bb948b2c4443af98d1e62d7" +source = "git+https://github.com/rcore-os/aarch64#797c24f07f9d90542eb094530b6f63fe3ea7dded" 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)", @@ -52,10 +40,10 @@ dependencies = [ [[package]] name = "bcm2837" -version = "0.1.0" -source = "git+https://github.com/rcore-os/bcm2837#446f0ea04deb5216ba5e08f10af36e5c1729e6fd" +version = "1.0.0" +source = "git+https://github.com/rcore-os/bcm2837#b29a8db5504b7eaa6f8adf2c3ff916d1ffd15194" dependencies = [ - "aarch64 2.2.2 (git+https://github.com/equation314/aarch64)", + "aarch64 2.5.0 (git+https://github.com/rcore-os/aarch64)", "volatile 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -361,7 +349,7 @@ version = "0.2.0" dependencies = [ "aarch64 2.5.0 (git+https://github.com/rcore-os/aarch64)", "apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)", - "bcm2837 0.1.0 (git+https://github.com/rcore-os/bcm2837)", + "bcm2837 1.0.0 (git+https://github.com/rcore-os/bcm2837)", "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)", "bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)", @@ -652,12 +640,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum aarch64 2.2.2 (git+https://github.com/equation314/aarch64)" = "" "checksum aarch64 2.5.0 (git+https://github.com/rcore-os/aarch64)" = "" "checksum apic 0.1.0 (git+https://github.com/rcore-os/apic-rs)" = "" "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 bcm2837 1.0.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 bitmap-allocator 0.1.0 (git+https://github.com/rcore-os/bitmap-allocator)" = "" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 2c3ed11..9547d31 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -82,7 +82,7 @@ riscv = { git = "https://github.com/rcore-os/riscv", features = ["inline-asm"] } [target.'cfg(target_arch = "aarch64")'.dependencies] aarch64 = { git = "https://github.com/rcore-os/aarch64", version = "2.5.0" } -bcm2837 = { git = "https://github.com/rcore-os/bcm2837", optional = true } +bcm2837 = { git = "https://github.com/rcore-os/bcm2837", version = "1.0.0", optional = true } [target.'cfg(target_arch = "mips")'.dependencies] mips = "^0.2.0" diff --git a/kernel/src/arch/aarch64/interrupt/mod.rs b/kernel/src/arch/aarch64/interrupt/mod.rs index 70b05cb..c7f0050 100644 --- a/kernel/src/arch/aarch64/interrupt/mod.rs +++ b/kernel/src/arch/aarch64/interrupt/mod.rs @@ -11,12 +11,10 @@ pub use self::handler::*; /// Set the exception vector address pub fn init() { - unsafe { - asm!( - "adr x0, __vectors; - msr vbar_el1, x0" - ); + extern "C" { + fn __vectors(); } + VBAR_EL1.set(__vectors as u64); } /// Enable the interrupt (only IRQ). diff --git a/kernel/targets/aarch64.json b/kernel/targets/aarch64.json index 149246a..25078de 100644 --- a/kernel/targets/aarch64.json +++ b/kernel/targets/aarch64.json @@ -20,7 +20,7 @@ }, "llvm-target": "aarch64-unknown-none", "no-compiler-rt": true, - "features": "+a53,+strict-align,-neon", + "features": "+a53,+strict-align,-neon,-fp-armv8", "max-atomic-width": 128, "os": "none", "panic": "abort",