Get super basic ring3 task switching working

* It looks like UEFI enables SSE, so we need to tell clang -mno-sse for
  now to not use XMM* until we're ready to save them.
* SYSCALL is working from ring3 tasks, calling console printf!
This commit is contained in:
Justin C. Miller
2018-05-21 01:00:34 -07:00
parent e6f819ed90
commit 2597e2002b
4 changed files with 19 additions and 57 deletions

View File

@@ -80,19 +80,10 @@ gdt_load:
pop rax
%endmacro
%macro load_kernel_segments 0
mov ax, 0x10 ; load the kernel data segment
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
%endmacro
extern isr_handler
global isr_handler_prelude
isr_handler_prelude:
push_all_and_segments
;load_kernel_segments
mov rdi, rsp
call isr_handler
@@ -108,7 +99,6 @@ extern irq_handler
global irq_handler_prelude
irq_handler_prelude:
push_all_and_segments
load_kernel_segments
call irq_handler
@@ -205,45 +195,18 @@ global taskA
taskA:
push rbp
mov rbp, rsp
push 0x123456789abcdef0
push 0x0fedcba987654321
mov rax, 0xaaaaaaaaaaaaaaaa
.loop:
syscall
jmp .loop
global taskB
taskB:
push rbp
mov rbp, rsp
mov rax, 0xbbbbbbbbbbbbbbbb
.loop:
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
syscall
nop
nop
nop
nop
nop
nop
jmp .loop