blob: 44c0b4e56a41aee2ba5cf64f173ceeb4dba38507 [file] [log] [blame]
swissChili1e8b7562021-12-22 21:22:57 -08001 [global _switch_to_task]
2_switch_to_task: ; (uint page_directory, struct
3 ; registers regs)
4 add esp, 4 ; We don't care about return address
5 pop eax
6 mov cr3, eax ; Change page directories
7 pop eax
8 mov ds, ax ; First is ds
9 popad ; Then the rest of the registers
10 add esp, 8 ; Then IRQ # and error #
11 iret ; And finally the saved state
swissChili14d0b842023-01-01 02:22:44 -050012
13 [global _get_cr3]
14_get_cr3:
15 mov eax, cr3
16 ret