Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Available memory calculation is wrong #988

Open
m-mueller678 opened this issue Nov 29, 2023 · 1 comment
Open

Available memory calculation is wrong #988

m-mueller678 opened this issue Nov 29, 2023 · 1 comment
Assignees

Comments

@m-mueller678
Copy link
Contributor

When initializing memory management, in src/mm/mod.rs:102 the space occupied by the kernel is subtracted from total_memoty_size().

let available_memory = (total_memory_size()
		- (kernel_end_address().as_usize() - env::get_ram_address().as_usize())
		- reserved_space)
		.align_down(LargePageSize::SIZE as usize);

But in src/arch/x86_64/mm/physicalmem.rs:42 it looks like that is already excluded from total_memory_size():

let start_address = if m.base_address() <= mm::kernel_start_address().as_u64() {
			mm::kernel_end_address()
		} else {
			VirtAddr(m.base_address())
		};

zulip thread

@mkroening
Copy link
Member

@sarahspberrypi, any thoughts on this? You recently took a look at this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants