usermode switch func takes params
This commit is contained in:
parent
28cd9deb9b
commit
c35191e819
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ ISO := Hazel.iso
|
|||
CFLAGS := -ffreestanding -Wall -Wextra -Werror -I $(INCLUDEDIR) -I lib
|
||||
LDFLAGS := -ffreestanding -nostdlib -lgcc -T kernel/kernel.ld
|
||||
QEMUFLAGS := -cdrom $(BUILDDIR)/$(ISO) \
|
||||
-d int
|
||||
-s -d int \
|
||||
-m 512M \
|
||||
-serial stdio
|
||||
|
||||
|
|
|
@ -65,7 +65,8 @@ jmp_user_mode:
|
|||
mov fs, ax
|
||||
mov gs, ax ; SS is handled by iret
|
||||
|
||||
mov eax, esp
|
||||
mov eax, [esp+4] ; esp arg
|
||||
mov edx, [esp+8] ; eip arg
|
||||
push (4*8) | 3
|
||||
push eax
|
||||
pushf
|
||||
|
|
|
@ -12,10 +12,9 @@ struct idtr idtr = {0};
|
|||
|
||||
extern uint32_t isr_stub_table[32];
|
||||
extern void pit_isr(void);
|
||||
extern void jmp_user_mode(void);
|
||||
extern void jmp_user_mode(uint32_t esp, uint32_t eip);
|
||||
|
||||
void test_entry(void) {
|
||||
asm volatile ("cli" ::);
|
||||
for (;;) {}
|
||||
}
|
||||
|
||||
|
@ -59,7 +58,7 @@ void kernel(multiboot_info_t *info) {
|
|||
ctx.ticks = 0;
|
||||
//pit_init();
|
||||
|
||||
jmp_user_mode();
|
||||
jmp_user_mode(0x5000, (uint32_t)test_entry);
|
||||
|
||||
halt:
|
||||
for (;;) {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user