fix(isr): reallign stack after isr wrapper

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2021-07-16 15:11:48 +02:00
parent 457dfdd7a4
commit e425051af7
3 changed files with 9 additions and 2 deletions

@ -41,7 +41,7 @@ DEPS = $(OBJS:.o=.d)
all: $(TARGET) all: $(TARGET)
$(TARGET): CPPFLAGS += -MMD -Iinclude -I ../libs/libc/include/ $(TARGET): CPPFLAGS += -MMD -Iinclude -I ../libs/libc/include/
$(TARGET): CFLAGS += $(K_EXTRA_CFLAGS) $(TARGET): CFLAGS += $(K_EXTRA_CFLAGS) -g
$(TARGET): LDFLAGS += -Wl,-Tk.lds $(TARGET): LDFLAGS += -Wl,-Tk.lds
$(TARGET): LDLIBS = -L../libs/libc -lc $(TARGET): LDLIBS = -L../libs/libc -lc
$(TARGET): $(OBJS) $(TARGET): $(OBJS)

@ -7,6 +7,7 @@ isr:
call interrupt_handler call interrupt_handler
add $4, %esp add $4, %esp
popal popal
add $8, %esp
iret iret
.global isr_divide .global isr_divide

8
k/k.c

@ -45,8 +45,14 @@ void k_main(unsigned long magic, multiboot_info_t *info)
char *fb = (void *)0xb8000; char *fb = (void *)0xb8000;
k_init(); k_init();
asm volatile("int $3\n"
:
:
:);
printf("bonjour\r\n"); printf("bonjour\r\n");
for (unsigned i = 0; ; ) { for (unsigned i = 0; ; ) {
*fb = star[i++ % 4]; *fb = star[i++ % 4];
} }