11#![ no_std]
22
3- pub use uefi:: boot:: { MemoryAttribute , MemoryDescriptor , MemoryType } ;
4- pub use uefi:: data_types:: chars:: * ;
5- pub use uefi:: data_types:: * ;
6- pub use uefi:: proto:: console:: gop:: { GraphicsOutput , ModeInfo } ;
7- pub use uefi:: Status ;
3+ use core:: ptr:: NonNull ;
84
95use arrayvec:: ArrayVec ;
10- use core:: ptr:: NonNull ;
11- use x86_64:: registers:: control:: Cr3 ;
12- use x86_64:: structures:: paging:: { OffsetPageTable , PageTable } ;
13- use x86_64:: VirtAddr ;
6+ pub use uefi:: {
7+ Status ,
8+ boot:: { MemoryAttribute , MemoryDescriptor , MemoryType } ,
9+ data_types:: { chars:: * , * } ,
10+ proto:: console:: gop:: { GraphicsOutput , ModeInfo } ,
11+ } ;
12+ use x86_64:: {
13+ VirtAddr ,
14+ registers:: control:: Cr3 ,
15+ structures:: paging:: { OffsetPageTable , PageTable } ,
16+ } ;
1417
1518pub mod allocator;
1619pub mod config;
@@ -22,12 +25,14 @@ pub use fs::*;
2225#[ macro_use]
2326extern crate log;
2427
25- /// This structure represents the information that the bootloader passes to the kernel.
28+ /// This structure represents the information that the bootloader passes to the
29+ /// kernel.
2630pub struct BootInfo {
2731 /// The memory map
2832 pub memory_map : ArrayVec < MemoryDescriptor , 256 > ,
2933
30- /// The offset into the virtual address space where the physical memory is mapped.
34+ /// The offset into the virtual address space where the physical memory is
35+ /// mapped.
3136 pub physical_memory_offset : u64 ,
3237
3338 /// The system table virtual address
@@ -49,7 +54,8 @@ static mut ENTRY: usize = 0;
4954///
5055/// # Safety
5156///
52- /// This function is unsafe because the caller must ensure that the kernel entry point is valid.
57+ /// This function is unsafe because the caller must ensure that the kernel entry
58+ /// point is valid.
5359#[ cfg( feature = "boot" ) ]
5460pub fn jump_to_entry ( bootinfo : * const BootInfo , stacktop : u64 ) -> ! {
5561 unsafe {
@@ -63,7 +69,8 @@ pub fn jump_to_entry(bootinfo: *const BootInfo, stacktop: u64) -> ! {
6369///
6470/// # Safety
6571///
66- /// This function is unsafe because the caller must ensure that the kernel entry point is valid.
72+ /// This function is unsafe because the caller must ensure that the kernel entry
73+ /// point is valid.
6774#[ inline( always) ]
6875#[ cfg( feature = "boot" ) ]
6976pub fn set_entry ( entry : usize ) {
@@ -77,9 +84,10 @@ pub fn set_entry(entry: usize) {
7784///
7885/// The function must have the signature `fn(&'static BootInfo) -> !`.
7986///
80- /// This macro just creates a function named `_start`, which the linker will use as the entry
81- /// point. The advantage of using this macro instead of providing an own `_start` function is
82- /// that the macro ensures that the function and argument types are correct.
87+ /// This macro just creates a function named `_start`, which the linker will use
88+ /// as the entry point. The advantage of using this macro instead of providing
89+ /// an own `_start` function is that the macro ensures that the function and
90+ /// argument types are correct.
8391#[ macro_export]
8492macro_rules! entry_point {
8593 ( $path: path) => {
0 commit comments