aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/mem.rs
blob: 52ccdec9790433e60f003635762ead7e9d5b1cb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// to detect available memory to initialize PMA
// https://wiki.osdev.org/Detecting_Memory_(x86)
use core::arch::asm;
use crate::io::*;

extern "C" {
	fn do_e820(start: usize) -> u32;
}

// Getting an E820 Memory Map -- osdev wiki
pub fn prob_mem_bios(){
	unsafe {
		let res = do_e820(0x8000);
		println!("res is {}", res)
	}
}