The newphysaddrandvirtaddrtypes are quite nice, but they do make some code uglier. For example instead of handle_mem_exception(vaddr - offset), e); we have to do handle_mem_exception(virtaddr(virtaddr_bits(vaddr
还是 Uboot 加载 Kernel,都是把相关的镜像放到对应的内存不
MakeVirtAddrandPhysAddrbehave more similar tox86_64: Added anew Address Arithmetic modifications: Addition of two addresses makes no sense Difference of two addresses should yield a u64, not an address Opinionated: Arithmetics with usize shall not exist for addresses to avoid inconsistent behaviour o...
First, we convert the `physical_memory_offset` of the `BootInfo` struct to a [`VirtAddr`] and pass it to the `active_level_4_table` function. We then use the `iter` function to iterate over the page table entries and the [`enumerate`] combinator to additionally add an index `i` ...
use x86_64::VirtAddr; blog_os::init(); let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) }; let phys_mem_offset = VirtAddr::new(boot_info.physical_memory_offset); let mut mapper = unsafe { memory::init(phys_mem_offset) }; let mut frame_allocator = unsafe ...
First, we convert the `physical_memory_offset` of the `BootInfo` struct to a [`VirtAddr`] and pass it to the `active_level_4_table` function. We then use the `iter` function to iterate over the page table entries and the [`enumerate`] combinator to additionally add an index `i` ...