mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Update blog to 9bad9020f6
This commit is contained in:
@@ -458,7 +458,7 @@ pub fn translate(virtual_address: VirtualAddress) -> Option<PhysicalAddress> {
|
||||
It uses two functions we haven't defined yet: `translate_page` and `Page::containing_address`. Let's start with the latter:
|
||||
|
||||
```rust
|
||||
fn containing_address(address: VirtualAddress) -> Page {
|
||||
pub fn containing_address(address: VirtualAddress) -> Page {
|
||||
assert!(address < 0x0000_8000_0000_0000 || address >= 0xffff_8000_0000_0000,
|
||||
"invalid address: 0x{:x}", address);
|
||||
Page { number: address / PAGE_SIZE }
|
||||
|
||||
Reference in New Issue
Block a user