swissChili | 1e8b756 | 2021-12-22 21:22:57 -0800 | [diff] [blame] | 1 | [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 |
swissChili | 14d0b84 | 2023-01-01 02:22:44 -0500 | [diff] [blame] | 12 | |
| 13 | [global _get_cr3] |
| 14 | _get_cr3: |
| 15 | mov eax, cr3 |
| 16 | ret |