WARNINGS = -Wall -W -Wstrict-prototypes -Wmissing-prototypes
CFLAGS = -g -O3 -MMD -msoft-float $(WARNINGS) $(INCLUDES) $(DEFINES)
-ASFLAGS = -Wa,--gstabs+ $(INCLUDES) $(DEFINES)
+ASFLAGS = -Wa,--gstabs $(INCLUDES) $(DEFINES)
# Core kernel.
-THREADS_SRC = start.S # Must be linked first.
-THREADS_SRC += init.c # Main program.
-THREADS_SRC += gdt.c # GDT initialization.
-THREADS_SRC += tss.c # TSS management.
+THREADS_SRC = init.c # Main program.
THREADS_SRC += thread.c # Thread management core.
THREADS_SRC += switch.S # Thread switch routine.
THREADS_SRC += interrupt.c # Interrupt core.
THREADS_SRC += paging.c # Page tables.
THREADS_SRC += palloc.c # Page allocator.
THREADS_SRC += malloc.c # Subpage allocator.
+THREADS_SRC += start.S # Startup code.
# Device driver code.
DEVICES_SRC = timer.c # Timer device.
# User process code.
USERPROG_SRC = addrspace.c # Address spaces.
+USERPROG_SRC += exception.c # User exception handler.
+USERPROG_SRC += gdt.c # GDT initialization.
+USERPROG_SRC += tss.c # TSS management.
# Objects.
OBJECTS = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SOURCES)))
all: diskimage.bin
-intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl $(TOP_SRCDIR)/threads/gdt.h
+intr-stubs.S: $(TOP_SRCDIR)/threads/intr-stubs.pl $(TOP_SRCDIR)/threads/loader.h
$< > $@
kernel.lds.s: $(TOP_SRCDIR)/threads/kernel.lds.S $(TOP_SRCDIR)/threads/loader.h