wip: multitasking: change eip but not working

This commit is contained in:
Starnakin 2025-01-21 10:41:27 +01:00
parent d889a251ef
commit 57ce3c792d
3 changed files with 9 additions and 5 deletions

View File

@ -40,7 +40,7 @@ irq_common_stub:
irq0: irq0:
push eax push eax
mov eax, [esp + 4] mov eax, [esp + 4]
mov [eip_backup], eax mov [esp_backup], esp
pop eax pop eax
push 0 push 0
push 32 push 32

View File

@ -10,8 +10,9 @@ switch_to_task:
push esi push esi
// save the current stack pointer to the old stack // save the current stack pointer to the old stack
mov [current_task], esp mov [current_task+0], esp
mov edi, [eip_backup]
mov edi, [esp_backup] // get eip
mov [current_task+16], edi // save instruction before Interrupt mov [current_task+16], edi // save instruction before Interrupt
// stack pointer + the 4 regs pushed // stack pointer + the 4 regs pushed
@ -31,7 +32,8 @@ switch_to_task:
// mov cr3, ebx // mov cr3, ebx
// TODO replace the eip store in stack by the [current_task+16](current_task->eip) // TODO replace the eip store in stack by the [current_task+16](current_task->eip)
mov edi, [current_task+16]
mov [esp_backup], edi
.END: .END:
pop esi pop esi
pop edi pop edi

View File

@ -5,7 +5,9 @@
#include "kprintf.h" #include "kprintf.h"
#include "memory.h" #include "memory.h"
uint32_t eip_backup; #include <stdint.h>
uint32_t esp_backup;
static struct task *create_task(uint8_t owner_id) static struct task *create_task(uint8_t owner_id)
{ {