Skip to content

Add physical memory manager#104

Merged
SamTebbs33 merged 1 commit intodevelopfrom
feature/phys-mem-manager
Jan 9, 2020
Merged

Add physical memory manager#104
SamTebbs33 merged 1 commit intodevelopfrom
feature/phys-mem-manager

Conversation

@SamTebbs33
Copy link
Collaborator

@SamTebbs33 SamTebbs33 commented Oct 10, 2019

This patch adds a physical memory manager that keeps track of which physical blocks are used. It parses the multiboot memory map for reserved memory and sets the memory used by kernel code as occupied. Closes #67

@SamTebbs33 SamTebbs33 added this to the v0.2 milestone Oct 10, 2019
@SamTebbs33 SamTebbs33 requested a review from DrDeano October 10, 2019 23:55
@SamTebbs33 SamTebbs33 force-pushed the feature/phys-mem-manager branch 2 times, most recently from 28bef64 to 572b504 Compare October 10, 2019 23:57
@SamTebbs33 SamTebbs33 force-pushed the feature/phys-mem-manager branch 2 times, most recently from afb8c9f to 9551107 Compare November 19, 2019 18:09
@SamTebbs33 SamTebbs33 force-pushed the feature/phys-mem-manager branch from 9551107 to 7a8d15f Compare December 19, 2019 13:26
@SamTebbs33
Copy link
Collaborator Author

I reckon this is finally ready for review! @DrDeano

@SamTebbs33 SamTebbs33 removed this from the v0.2 milestone Dec 20, 2019
@DrDeano
Copy link
Member

DrDeano commented Dec 23, 2019

As a side, could the pmm implement the Allocater interface

@SamTebbs33
Copy link
Collaborator Author

As a side, could the pmm implement the Allocater interface

What is the advantage of it being an Allocator?

@SamTebbs33
Copy link
Collaborator Author

As a side, could the pmm implement the Allocater interface

What is the advantage of it being an Allocator?

Discussed offline, will implement :+1

@SamTebbs33 SamTebbs33 force-pushed the feature/phys-mem-manager branch 2 times, most recently from b4b3f6b to 00153cf Compare January 7, 2020 16:14
bitmaps: []BitmapType,

pub fn init(num_entries: u32, allocator: *std.mem.Allocator) !Self {
const num = num_entries / ENTRIES_PER_BITMAP + @boolToInt(num_entries % ENTRIES_PER_BITMAP != 0);
Copy link
Member

@DrDeano DrDeano Jan 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @round is better. So can have @round(num_entries / @as(f32, ENTRIES_PER_BITMAP)) I assume num_entries will be implicitly cased.

Copy link
Member

@DrDeano DrDeano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still missing some comments from the previous feedback. But looking good :)

@SamTebbs33 SamTebbs33 force-pushed the feature/phys-mem-manager branch from e2b9fd7 to 7043ccd Compare January 9, 2020 12:47
@SamTebbs33 SamTebbs33 merged commit a095fd3 into develop Jan 9, 2020
@SamTebbs33 SamTebbs33 deleted the feature/phys-mem-manager branch January 9, 2020 12:50
@SamTebbs33 SamTebbs33 mentioned this pull request Jul 20, 2020
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

Successfully merging this pull request may close these issues.

Physical memory manager

2 participants