From e425051af74fb79ab49edff93fb813dc176b8305 Mon Sep 17 00:00:00 2001 From: Julien CLEMENT Date: Fri, 16 Jul 2021 15:11:48 +0200 Subject: [PATCH] fix(isr): reallign stack after isr wrapper Signed-off-by: Julien CLEMENT --- k/Makefile | 2 +- k/isr.S | 1 + k/k.c | 8 +++++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/k/Makefile b/k/Makefile index 388d54c..99c5520 100644 --- a/k/Makefile +++ b/k/Makefile @@ -41,7 +41,7 @@ DEPS = $(OBJS:.o=.d) all: $(TARGET) $(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): LDLIBS = -L../libs/libc -lc $(TARGET): $(OBJS) diff --git a/k/isr.S b/k/isr.S index 184cdd5..09ff49c 100644 --- a/k/isr.S +++ b/k/isr.S @@ -7,6 +7,7 @@ isr: call interrupt_handler add $4, %esp popal + add $8, %esp iret .global isr_divide diff --git a/k/k.c b/k/k.c index ff57813..5e7c1f4 100644 --- a/k/k.c +++ b/k/k.c @@ -45,8 +45,14 @@ void k_main(unsigned long magic, multiboot_info_t *info) char *fb = (void *)0xb8000; k_init(); - + asm volatile("int $3\n" + : + : + :); printf("bonjour\r\n"); + + + for (unsigned i = 0; ; ) { *fb = star[i++ % 4]; }