@@ -55,8 +55,6 @@ static mut COM1: SerialPort = unsafe { SerialPort::new(SERIAL_IO_PORT) };
55
55
56
56
#[ cfg( all( target_os = "none" , not( feature = "fc" ) ) ) ]
57
57
struct Mem ;
58
- #[ cfg( all( target_os = "none" , not( feature = "fc" ) ) ) ]
59
- static mut MEM : Mem = Mem ;
60
58
61
59
#[ cfg( all( target_os = "none" , not( feature = "fc" ) ) ) ]
62
60
impl MemoryManagement for Mem {
@@ -213,8 +211,9 @@ pub fn find_kernel() -> &'static [u8] {
213
211
let page_address = unsafe { mb_info. align_down ( Size4KiB :: SIZE as usize ) } ;
214
212
paging:: map :: < Size4KiB > ( page_address, page_address, 1 , PageTableFlags :: empty ( ) ) ;
215
213
214
+ let mut mem = Mem ;
216
215
// Load the Multiboot information and identity-map the modules information.
217
- let multiboot = unsafe { Multiboot :: from_ptr ( mb_info as u64 , & mut MEM ) . unwrap ( ) } ;
216
+ let multiboot = unsafe { Multiboot :: from_ptr ( mb_info as u64 , & mut mem ) . unwrap ( ) } ;
218
217
let modules_address = multiboot
219
218
. modules ( )
220
219
. expect ( "Could not find a memory map in the Multiboot information" )
@@ -440,7 +439,8 @@ pub unsafe fn boot_kernel(kernel_info: LoadedKernel) -> ! {
440
439
entry_point,
441
440
} = kernel_info;
442
441
443
- let multiboot = unsafe { Multiboot :: from_ptr ( mb_info as u64 , & mut MEM ) . unwrap ( ) } ;
442
+ let mut mem = Mem ;
443
+ let multiboot = unsafe { Multiboot :: from_ptr ( mb_info as u64 , & mut mem) . unwrap ( ) } ;
444
444
445
445
// determine boot stack address
446
446
let mut new_stack = ptr:: addr_of!( kernel_end)
0 commit comments