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 |