-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add x86 paging rt test #73
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the full doc comment format for all functions/constants/variables and errors.
More unit tests :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another comment
We should wait until my 4kb paging PR is merged so I can add some new paging tests to this PR. |
9ccb898
to
5808195
Compare
Ready for review again. |
5808195
to
61e3895
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few points
e031577
to
591599b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor tweek
src/kernel/arch/x86/paging.zig
Outdated
const tty_addr = tty.getVideoBufferAddress(); | ||
// If the previous mappping space didn't cover the tty buffer, do so now | ||
if (v_start > tty_addr or v_end <= tty_addr) { | ||
const tty_phys = virtToPhys(tty_addr); | ||
const tty_buff_size = 32 * 1024; | ||
mapDir(kernel_directory, tty_addr, tty_addr + tty_buff_size, tty_phys, tty_phys + tty_buff_size, allocator) catch panic(@errorReturnTrace(), "Failed to map vga buffer in kernel directory"); | ||
mapDir(kernel_directory, tty_addr, tty_addr + tty_buff_size, tty_phys, tty_phys + tty_buff_size, allocator) catch |e| panic(@errorReturnTrace(), "Failed to map vga buffer in kernel directory: {}", @errorName(e)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the @errorName
as fmt handles it for you. Also (u may reject), so the line isn't long, have this like:
mapDir(kernel_directory, tty_addr, tty_addr + tty_buff_size, tty_phys, tty_phys + tty_buff_size, allocator) catch |e| {
panic(@errorReturnTrace(), "Failed to map vga buffer in kernel directory: {}\n", e);
};
Also for the other error printing.
Also add new lines (\n) to the end of the logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bam
acfcf5d
to
fc10dbf
Compare
Adds a runtime test to x86 paging which ensures that unmapped memory causes a page fault. If you can think of any other tests I could add please say so. Part of #60