diff options
author | Danny Holman <dholman@gymli.org> | 2024-05-27 13:53:52 -0500 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-05-27 13:53:52 -0500 |
commit | aaf7355c5ededfcdc877c7f2989fb1ba02dfb848 (patch) | |
tree | 0c4588650fe1fc1fa1af2972353a2bc920cf1e68 /Makefile | |
parent | 41cff28f5447b5f669db62ce2a73be98bc5bce37 (diff) |
libk: create a subset libc for kernel use
Create a subset of the C library for use inside the kernel.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -9,7 +9,7 @@ ARCH?=i386 CC:=i686-elf-gcc VERSION:="$(shell git describe --abbrev=4 --dirty --always --tags)" INCLUDE:=$(INCLUDE) -CFLAGS:=$(CFLAGS) -Wall -Wextra -DVERSION=\"$(VERSION)\" -ggdb +CFLAGS:=$(CFLAGS) -Wall -Wextra -DVERSION=\"$(VERSION)\" -ggdb -fstack-protector-all -O0 LDFLAGS:=$(LDFLAGS) LIBS:=$(LIBS) ARCH:=$(ARCH) @@ -24,21 +24,28 @@ LIBS:=$(LIBS) $(KERNEL_ARCH_LIBS) KERNEL=vmbox +LIBK_OBJS=libk/string.o \ + libk/io.o \ + libk/stack_protector.o \ + libk/ubsan.o \ + KERNEL_OBJS=$(KERNEL_ARCH_OBJS) \ kernel/init.o \ - kernel/string.o \ - kernel/io.o \ kernel/panic.o \ + kernel/vfs.o \ kernel/sched.o \ + kernel/kthread.o \ OBJS=$(ARCHDIR)/boot/crti.o \ $(ARCHDIR)/crtbegin.o \ $(KERNEL_OBJS) \ + $(LIBK_OBJS) \ $(ARCHDIR)/crtend.o \ $(ARCHDIR)/boot/crtn.o \ LINK_LIST=$(LDFLAGS) \ $(KERNEL_OBJS) \ + $(LIBK_OBJS) \ $(LIBS) \ .PHONY: all clean install install-headers install-kernel @@ -87,9 +94,9 @@ install-disk: $(KERNEL) mcopy -i a.img vmbox ::vmbox run: $(KERNEL) - qemu-system-i386 -kernel $(KERNEL) -serial stdio + qemu-system-i386 -kernel $(KERNEL) -serial stdio -m 3G -drive file=a.img,format=raw -append "root=/dev/sda init=/bin/sh" debug: $(KERNEL) - qemu-system-i386 -kernel $(KERNEL) -s -S + qemu-system-i386 -kernel $(KERNEL) -s -S -m 3G -drive file=a.img,format=raw -append "root=/dev/sda init=/bin/sh" & -include $(OBJS:.o=.d) |