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