File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub mod serial;
39
39
40
40
const PAGE_SIZE : u64 = 4096 ;
41
41
42
- /// Initialize a text-based logger using the given pixel-based framebuffer as output.
42
+ /// Initialize a text-based logger using the given pixel-based framebuffer as output.
43
43
pub fn init_logger (
44
44
framebuffer : & ' static mut [ u8 ] ,
45
45
info : FrameBufferInfo ,
@@ -594,15 +594,21 @@ pub struct PageTables {
594
594
///
595
595
/// Must be the page table that the `kernel` field of this struct refers to.
596
596
///
597
- /// This frame is loaded into the `CR3` register on the final context switch to the kernel.
597
+ /// This frame is loaded into the `CR3` register on the final context switch to the kernel.
598
598
pub kernel_level_4_frame : PhysFrame ,
599
599
}
600
600
601
601
/// Performs the actual context switch.
602
602
unsafe fn context_switch ( addresses : Addresses ) -> ! {
603
603
unsafe {
604
604
asm ! (
605
- "mov cr3, {}; mov rsp, {}; push 0; jmp {}" ,
605
+ r#"
606
+ xor rbp, rbp
607
+ mov cr3, {}
608
+ mov rsp, {}
609
+ push 0
610
+ jmp {}
611
+ "# ,
606
612
in( reg) addresses. page_table. start_address( ) . as_u64( ) ,
607
613
in( reg) addresses. stack_top. as_u64( ) ,
608
614
in( reg) addresses. entry_point. as_u64( ) ,
You can’t perform that action at this time.
0 commit comments