diff --git a/.travis.yml b/.travis.yml index 38d6a406..606f3535 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ dist: xenial language: rust rust: - - nightly-2020-10-01 + - nightly-2021-03-04 env: - RUSTFLAGS="-D warnings" diff --git a/Cargo.lock b/Cargo.lock index e8c47415..d8eefdfd 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 = "atomic_refcell" version = "0.1.6" @@ -74,7 +76,7 @@ dependencies = [ "ssh2", "tempfile", "uart_16550", - "x86_64 0.13.1", + "x86_64", ] [[package]] @@ -295,12 +297,12 @@ dependencies = [ [[package]] name = "uart_16550" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb00b16a4c8acbfc4eb8cfeda1f9c0507c7e87c6563edce64a236af93acf70c" +checksum = "8d45a3c9181dc9ba7d35d02b3c36d1604155289d935b7946510fb3d2f4b976d9" dependencies = [ "bitflags", - "x86_64 0.12.4", + "x86_64", ] [[package]] @@ -339,19 +341,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "x86_64" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3a6840d540b8dbe400f4ed5afe5816105ee5edebe485299a761d0d8b43cef7" -dependencies = [ - "bit_field", - "bitflags", -] - -[[package]] -name = "x86_64" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d74944372d63f31dd39fce1ef8036143484ff4cd4efcd743ef50135839de4e7" +checksum = "b871116e3c83dad0795580b10b2b1dd05cb52ec719af36180371877b09681f7f" dependencies = [ "bit_field", "bitflags", diff --git a/Cargo.toml b/Cargo.toml index eddbc9d7..4410e962 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,10 +26,10 @@ coreboot = [] [dependencies] bitflags = "1.2" -x86_64 = "0.13.1" +x86_64 = "0.13.2" atomic_refcell = "0.1" r-efi = "3.2.0" -uart_16550 = "0.2.10" +uart_16550 = "0.2.12" linked_list_allocator = "0.8.11" [dev-dependencies] diff --git a/rust-toolchain b/rust-toolchain index fe5455cb..d59ceb61 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-10-01 +nightly-2021-03-04 diff --git a/src/efi/block.rs b/src/efi/block.rs index 4c55a4cc..102abf64 100644 --- a/src/efi/block.rs +++ b/src/efi/block.rs @@ -190,7 +190,7 @@ impl<'a> BlockWrapper<'a> { AllocateType::AllocateAnyPages, MemoryType::LoaderData, ((size + super::PAGE_SIZE as usize - 1) / super::PAGE_SIZE as usize) as u64, - 0 as u64, + 0_u64, ); let bw = new_address as *mut BlockWrapper; diff --git a/src/efi/file.rs b/src/efi/file.rs index 43a3c285..427747b0 100644 --- a/src/efi/file.rs +++ b/src/efi/file.rs @@ -136,6 +136,7 @@ pub extern "win64" fn set_position(_: *mut FileProtocol, _: u64) -> Status { Status::UNSUPPORTED } +#[allow(unused)] struct FileInfo { size: u64, file_size: u64, @@ -212,7 +213,7 @@ impl<'a> FileSystemWrapper<'a> { AllocateType::AllocateAnyPages, MemoryType::LoaderData, ((size + super::PAGE_SIZE as usize - 1) / super::PAGE_SIZE as usize) as u64, - 0 as u64, + 0_u64, ); if status == Status::SUCCESS { diff --git a/src/fat.rs b/src/fat.rs index 0dd0c78a..0fe393a1 100644 --- a/src/fat.rs +++ b/src/fat.rs @@ -104,6 +104,7 @@ pub struct Filesystem<'a> { first_fat_sector: u32, first_data_sector: u32, data_sector_count: u32, + #[allow(unused)] data_cluster_count: u32, root_cluster: u32, // FAT32 only } @@ -675,7 +676,7 @@ mod tests { Err(super::Error::EndOfFile) => { break; } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } @@ -713,7 +714,7 @@ mod tests { Err(super::Error::EndOfFile) => { break; } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } @@ -730,7 +731,7 @@ mod tests { Err(super::Error::EndOfFile) => { break; } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } @@ -748,7 +749,7 @@ mod tests { Err(super::Error::EndOfFile) => { break; } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } assert_eq!(bytes_so_far, f.size); @@ -769,10 +770,10 @@ mod tests { assert_eq!(f.sectors, 1_046_528); assert_eq!(f.fat_type, super::FatType::FAT16); } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } @@ -788,10 +789,10 @@ mod tests { assert_eq!(file.active_cluster, 166); assert_eq!(file.size, 92789); } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } diff --git a/src/main.rs b/src/main.rs index 8de0c6eb..73b62825 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ // limitations under the License. #![feature(alloc_error_handler)] -#![feature(global_asm, const_in_array_repeat_expressions)] +#![feature(global_asm)] #![cfg_attr(not(test), no_std)] #![cfg_attr(not(test), no_main)] #![cfg_attr(test, allow(unused_imports, dead_code))] diff --git a/src/paging.rs b/src/paging.rs index 448ede42..d185dfd4 100644 --- a/src/paging.rs +++ b/src/paging.rs @@ -6,6 +6,7 @@ use x86_64::{ // Amount of memory we identity map in setup(), max 512 GiB. const ADDRESS_SPACE_GIB: usize = 4; +const TABLE: PageTable = PageTable::new(); // Put the Page Tables in static muts to make linking easier #[no_mangle] @@ -13,7 +14,7 @@ static mut L4_TABLE: PageTable = PageTable::new(); #[no_mangle] static mut L3_TABLE: PageTable = PageTable::new(); #[no_mangle] -static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [PageTable::new(); ADDRESS_SPACE_GIB]; +static mut L2_TABLES: [PageTable; ADDRESS_SPACE_GIB] = [TABLE; ADDRESS_SPACE_GIB]; pub fn setup() { // SAFETY: This function is idempontent and only writes to static memory and diff --git a/src/part.rs b/src/part.rs index b7e73ead..706297fc 100644 --- a/src/part.rs +++ b/src/part.rs @@ -199,7 +199,7 @@ pub mod tests { assert_eq!(start, 2048); assert_eq!(end, 1_048_575); } - Err(e) => panic!(e), + Err(e) => panic!("{:?}", e), } } }