You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, this is my first kernel-like project so please pardon my ingenuity.
I'm running a (very) little kernel in private that is a fork of the blog_os one.
Trying to update the bootloader to the 0.10 branch is giving me a very strange error: everything is working except the iretq that gives me a General Protection Fault on every interrupt I receive.
I don't really know how to build a minimal functioning example for this so I made a blog_os fork with the following changes:
bootloader is updated to 0.10 (I also added the boot sub-project)
The PICS is disabled (so we don't get the timer interrupts)
a fn call_breakpoint() { int3() } is added and called from main (it's easier to break on from gdb)
the breakpoint_handler body is commented (easier gdb debugging)
I copied a simple framebuffer implementation (It could be used for debugging)
You can find it here: https://github.com/SnowyCoder/blog_os/tree/gpf_help .
In this version (that I tried to keep as similar as possible to the blog_os one) the kernel executes up until the iretq and then jumps into the general protection fault handler.
The only useful thing in the registers that changes seems to be the ss register (that should be useless?).
You can find a gdb run log here: original vs updated. (the updated version also has the PIC disabled)
The iretq commands checks the ss segment in the GDT if it isn't 0, which is probably the cause of the GPF. To fix this, you could either add a data segment to your GDT and load es/ds/ss accordingly, or load ss with 0 in your init function. The former is probably the cleaner solution.
Sorry about the lack of documentation! I didn't have the time to update the blog and write a proper migration guide yet.
Thanks a lot! I don't have the computer near but I'll fix this when I can.
You don't need documentation on migration but a line of it could be useful in the README (since I'm not the only one that fell in this).
I'll also read segmentation more to have a better understanding of it all.
Hello, this is my first kernel-like project so please pardon my ingenuity.
I'm running a (very) little kernel in private that is a fork of the blog_os one.
Trying to update the bootloader to the 0.10 branch is giving me a very strange error: everything is working except the
iretq
that gives me a General Protection Fault on every interrupt I receive.I don't really know how to build a minimal functioning example for this so I made a blog_os fork with the following changes:
fn call_breakpoint() { int3() }
is added and called from main (it's easier to break on from gdb)You can find it here: https://github.com/SnowyCoder/blog_os/tree/gpf_help .
In this version (that I tried to keep as similar as possible to the blog_os one) the kernel executes up until the
iretq
and then jumps into the general protection fault handler.The only useful thing in the registers that changes seems to be the
ss
register (that should be useless?).You can find a gdb run log here: original vs updated. (the updated version also has the PIC disabled)
Other useful infos:
rustc --version
:rustc 1.56.0-nightly (0afc20860 2021-08-25)
uname -r
:5.10.59-1-MANJARO
The text was updated successfully, but these errors were encountered: