@@ -7,8 +7,8 @@ use bootloader_boot_config::{BootConfig, LevelFilter};
77use bootloader_x86_64_bios_common:: { BiosFramebufferInfo , BiosInfo , E820MemoryRegion } ;
88use bootloader_x86_64_common:: RawFrameBufferInfo ;
99use bootloader_x86_64_common:: {
10- legacy_memory_region :: LegacyFrameAllocator , load_and_switch_to_kernel , Kernel , PageTables ,
11- SystemInfo ,
10+ Kernel , PageTables , SystemInfo , legacy_memory_region :: LegacyFrameAllocator ,
11+ load_and_switch_to_kernel ,
1212} ;
1313use core:: { cmp, slice} ;
1414use usize_conversions:: usize_from;
@@ -22,8 +22,8 @@ const GIGABYTE: u64 = 4096 * 512 * 512;
2222
2323mod memory_descriptor;
2424
25- #[ no_mangle]
26- #[ link_section = ".start" ]
25+ #[ unsafe ( no_mangle) ]
26+ #[ unsafe ( link_section = ".start" ) ]
2727pub extern "C" fn _start ( info : & mut BiosInfo ) -> ! {
2828 let memory_map: & mut [ E820MemoryRegion ] = unsafe {
2929 core:: slice:: from_raw_parts_mut (
@@ -255,8 +255,8 @@ fn create_page_tables(frame_allocator: &mut impl FrameAllocator<Size4KiB>) -> Pa
255255fn detect_rsdp ( ) -> Option < PhysAddr > {
256256 use core:: ptr:: NonNull ;
257257 use rsdp:: {
258- handler:: { AcpiHandler , PhysicalMapping } ,
259258 Rsdp ,
259+ handler:: { AcpiHandler , PhysicalMapping } ,
260260 } ;
261261
262262 #[ derive( Clone ) ]
@@ -271,13 +271,15 @@ fn detect_rsdp() -> Option<PhysAddr> {
271271 physical_address : usize ,
272272 size : usize ,
273273 ) -> PhysicalMapping < Self , T > {
274- PhysicalMapping :: new (
275- physical_address,
276- NonNull :: new ( physical_address as * mut _ ) . unwrap ( ) ,
277- size,
278- size,
279- Self ,
280- )
274+ unsafe {
275+ PhysicalMapping :: new (
276+ physical_address,
277+ NonNull :: new ( physical_address as * mut _ ) . unwrap ( ) ,
278+ size,
279+ size,
280+ Self ,
281+ )
282+ }
281283 }
282284
283285 fn unmap_physical_region < T > ( _region : & PhysicalMapping < Self , T > ) { }
0 commit comments