File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ pub mod serial;
3939
4040const PAGE_SIZE : u64 = 4096 ;
4141
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.
4343pub fn init_logger (
4444 framebuffer : & ' static mut [ u8 ] ,
4545 info : FrameBufferInfo ,
@@ -594,15 +594,21 @@ pub struct PageTables {
594594 ///
595595 /// Must be the page table that the `kernel` field of this struct refers to.
596596 ///
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.
598598 pub kernel_level_4_frame : PhysFrame ,
599599}
600600
601601/// Performs the actual context switch.
602602unsafe fn context_switch ( addresses : Addresses ) -> ! {
603603 unsafe {
604604 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+ "# ,
606612 in( reg) addresses. page_table. start_address( ) . as_u64( ) ,
607613 in( reg) addresses. stack_top. as_u64( ) ,
608614 in( reg) addresses. entry_point. as_u64( ) ,
You can’t perform that action at this time.
0 commit comments