Commit 84dcd0d7 by malcolm

just some cleanup and minor changes fremma help idk which of your vars to use

parent 99c55ce5
......@@ -32,7 +32,7 @@ void schedule()
curproc=(curproc<NUM_PROCS-1)?curproc+1:0;
}
serial_writestring("about to switch\n");
context_switch(&procs[old]->ctxt, procs[curproc]->ctxt);
//context_switch(&procs[old]->ctxt, procs[curproc]->ctxt);
serial_writestring("switched\n");
//procs[old]->state=RUNNABLE;
procs[curproc]->state=RUNNING;
......
......@@ -47,6 +47,7 @@ typedef struct//all regs in proc
typedef struct//regs needed for context
{
uint3t_t cr3;
uint32_t edi;
uint32_t esi;
uint32_t ebx;
......
;; compile with nasm -felf32 hello.asm
Section .text
global main
main:
mov eax, 4
int 0x80
mov eax, 5
int 0x80
......@@ -5,10 +5,10 @@ extern kstack
%macro error_interrupt 1
global interrupt_handler_%1
interrupt_handler_%1:
push ebp
push esp
mov ebp, kstack
mov esp, kstack
;push ebp
;push esp
;mov ebp, kstack
;mov esp, kstack
push dword %1
jmp common_handler
%endmacro
......@@ -17,10 +17,10 @@ interrupt_handler_%1:
global interrupt_handler_%1
interrupt_handler_%1:
push dword 0
push ebp
push esp
mov ebp, kstack
mov esp, kstack
;push ebp
;push esp
;mov ebp, kstack
;mov esp, kstack
push dword %1
jmp common_handler
%endmacro
......@@ -39,8 +39,8 @@ common_handler:
pop dword ds
add esp, 4
pop esp
pop ebp
;pop esp
;pop ebp
add esp, 4
iret
......
......@@ -7,10 +7,12 @@ context_switch:
push ebx
push esi
push edi
push cr3
mov [eax], esp
mov esp, edx
pop cr3
pop edi
pop esi
pop ebx
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment