summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules2
-rw-r--r--Makefile31
-rwxr-xr-xcontrib/dep_builders/binutils (renamed from tools/dep_builders/binutils)0
-rwxr-xr-xcontrib/dep_builders/dl (renamed from tools/dep_builders/dl)4
-rwxr-xr-xcontrib/dep_builders/gcc (renamed from tools/dep_builders/gcc)0
-rwxr-xr-xcontrib/sort_includes.rb (renamed from tools/sort_includes.rb)0
-rw-r--r--contrib/stacktrace_resolve.awk (renamed from tools/stacktrace_resolve.awk)0
-rw-r--r--ports/post4
-rw-r--r--readme.md14
-rw-r--r--src/bootstrap/entry.S (renamed from src/user/bootstrap/entry.S)0
-rw-r--r--src/bootstrap/linker.ld (renamed from src/user/bootstrap/linker.ld)0
-rw-r--r--src/bootstrap/main.c (renamed from src/user/bootstrap/main.c)0
-rw-r--r--src/bootstrap/tar.c (renamed from src/user/bootstrap/tar.c)0
-rw-r--r--src/bootstrap/tar.h (renamed from src/user/bootstrap/tar.h)0
-rw-r--r--src/cmd/drawmouse/drawmouse.c (renamed from src/user/app/drawmouse/drawmouse.c)0
-rw-r--r--src/cmd/dvd/dvd.c (renamed from src/user/app/dvd/dvd.c)0
m---------src/cmd/ext2fs/ext2 (renamed from src/user/app/ext2fs/ext2)0
-rw-r--r--src/cmd/ext2fs/main.c (renamed from src/user/app/ext2fs/main.c)0
-rw-r--r--src/cmd/find/find.c (renamed from src/user/app/find/find.c)0
-rw-r--r--src/cmd/httpd/httpd.c (renamed from src/user/app/httpd/httpd.c)0
-rw-r--r--src/cmd/init/driver/driver.h (renamed from src/user/app/init/driver/driver.h)0
-rw-r--r--src/cmd/init/driver/initctl.c (renamed from src/user/app/init/driver/initctl.c)0
-rw-r--r--src/cmd/init/driver/ps2.c (renamed from src/user/app/init/driver/ps2.c)0
-rw-r--r--src/cmd/init/driver/termcook.c (renamed from src/user/app/init/driver/termcook.c)0
-rw-r--r--src/cmd/init/init.c (renamed from src/user/app/init/init.c)0
-rw-r--r--src/cmd/iochk/iochk.c (renamed from src/user/app/iochk/iochk.c)0
-rw-r--r--src/cmd/iostress/iostress.c (renamed from src/user/app/iostress/iostress.c)0
-rw-r--r--src/cmd/logfs/logfs.c (renamed from src/user/app/logfs/logfs.c)0
-rw-r--r--src/cmd/login/login.c (renamed from src/user/app/login/login.c)0
-rw-r--r--src/cmd/netdog/nd.c (renamed from src/user/app/netdog/nd.c)0
-rw-r--r--src/cmd/netstack/arp.c (renamed from src/user/app/netstack/arp.c)0
-rw-r--r--src/cmd/netstack/ether.c (renamed from src/user/app/netstack/ether.c)0
-rw-r--r--src/cmd/netstack/fs.c (renamed from src/user/app/netstack/fs.c)0
-rw-r--r--src/cmd/netstack/icmp.c (renamed from src/user/app/netstack/icmp.c)0
-rw-r--r--src/cmd/netstack/ipv4.c (renamed from src/user/app/netstack/ipv4.c)0
-rw-r--r--src/cmd/netstack/netstack.c (renamed from src/user/app/netstack/netstack.c)0
-rw-r--r--src/cmd/netstack/proto.h (renamed from src/user/app/netstack/proto.h)0
-rw-r--r--src/cmd/netstack/tcp.c (renamed from src/user/app/netstack/tcp.c)0
-rw-r--r--src/cmd/netstack/udp.c (renamed from src/user/app/netstack/udp.c)0
-rw-r--r--src/cmd/netstack/util.c (renamed from src/user/app/netstack/util.c)0
-rw-r--r--src/cmd/netstack/util.h (renamed from src/user/app/netstack/util.h)0
-rw-r--r--src/cmd/ps/ps.c (renamed from src/user/app/ps/ps.c)0
-rw-r--r--src/cmd/shell/builtins.c (renamed from src/user/app/shell/builtins.c)0
-rw-r--r--src/cmd/shell/builtins.h (renamed from src/user/app/shell/builtins.h)0
-rw-r--r--src/cmd/shell/parser.c (renamed from src/user/app/shell/parser.c)0
-rw-r--r--src/cmd/shell/shell.c (renamed from src/user/app/shell/shell.c)0
-rw-r--r--src/cmd/shell/shell.h (renamed from src/user/app/shell/shell.h)0
-rw-r--r--src/cmd/testelf/main.c (renamed from src/user/app/testelf/main.c)0
-rw-r--r--src/cmd/tests/kernel/fdlimit.c (renamed from src/user/app/tests/kernel/fdlimit.c)0
-rw-r--r--src/cmd/tests/kernel/fs.c (renamed from src/user/app/tests/kernel/fs.c)0
-rw-r--r--src/cmd/tests/kernel/misc.c (renamed from src/user/app/tests/kernel/misc.c)0
-rw-r--r--src/cmd/tests/kernel/miscsyscall.c (renamed from src/user/app/tests/kernel/miscsyscall.c)0
-rw-r--r--src/cmd/tests/kernel/path.c (renamed from src/user/app/tests/kernel/path.c)0
-rw-r--r--src/cmd/tests/kernel/threads.c (renamed from src/user/app/tests/kernel/threads.c)0
-rw-r--r--src/cmd/tests/libc/esemaphore.c (renamed from src/user/app/tests/libc/esemaphore.c)0
-rw-r--r--src/cmd/tests/libc/setjmp.c (renamed from src/user/app/tests/libc/setjmp.c)0
-rw-r--r--src/cmd/tests/libc/string.c (renamed from src/user/app/tests/libc/string.c)0
-rw-r--r--src/cmd/tests/shared/printf.c (renamed from src/user/app/tests/shared/printf.c)0
-rw-r--r--src/cmd/tests/shared/ringbuf.c (renamed from src/user/app/tests/shared/ringbuf.c)0
-rw-r--r--src/cmd/tests/stress.c (renamed from src/user/app/tests/stress.c)0
-rw-r--r--src/cmd/tests/tests.c (renamed from src/user/app/tests/tests.c)0
-rw-r--r--src/cmd/tests/tests.h (renamed from src/user/app/tests/tests.h)0
-rw-r--r--src/cmd/tmpfs/tmpfs.c (renamed from src/user/app/tmpfs/tmpfs.c)0
-rw-r--r--src/cmd/vterm/draw.c (renamed from src/user/app/vterm/draw.c)0
-rw-r--r--src/cmd/vterm/font.c (renamed from src/user/app/vterm/font.c)0
-rw-r--r--src/cmd/vterm/vterm.c (renamed from src/user/app/vterm/vterm.c)0
-rw-r--r--src/cmd/vterm/vterm.h (renamed from src/user/app/vterm/vterm.h)0
-rw-r--r--src/kernel/sysroot/usr/include/limits.h (renamed from sysroot_alt/usr/include/limits.h)0
-rw-r--r--src/libc/_start.s (renamed from src/user/lib/_start.s)0
-rw-r--r--src/libc/_start2.c (renamed from src/user/lib/_start2.c)0
-rw-r--r--src/libc/assert.c (renamed from src/user/lib/assert.c)0
-rw-r--r--src/libc/camellia.c (renamed from src/user/lib/camellia.c)0
-rw-r--r--src/libc/compat.c (renamed from src/user/lib/compat.c)0
-rw-r--r--src/libc/ctype.c (renamed from src/user/lib/ctype.c)0
-rw-r--r--src/libc/dirent.c (renamed from src/user/lib/dirent.c)0
-rw-r--r--src/libc/draw/draw.c (renamed from src/user/lib/draw/draw.c)0
-rw-r--r--src/libc/draw/flush.c (renamed from src/user/lib/draw/flush.c)0
-rw-r--r--src/libc/elf.h (renamed from src/user/lib/elf.h)0
-rw-r--r--src/libc/elfload.S (renamed from src/user/lib/elfload.S)0
-rw-r--r--src/libc/elfload.c (renamed from src/user/lib/elfload.c)0
-rw-r--r--src/libc/elfreloc.c (renamed from src/user/lib/elfreloc.c)0
-rw-r--r--src/libc/err.c (renamed from src/user/lib/err.c)0
-rw-r--r--src/libc/esemaphore.c (renamed from src/user/lib/esemaphore.c)0
-rw-r--r--src/libc/fcntl.c (renamed from src/user/lib/fcntl.c)0
-rw-r--r--src/libc/fs/dir.c (renamed from src/user/lib/fs/dir.c)0
-rw-r--r--src/libc/fs/dirinject.c (renamed from src/user/lib/fs/dirinject.c)0
-rw-r--r--src/libc/fs/misc.c (renamed from src/user/lib/fs/misc.c)0
-rw-r--r--src/libc/fs/whitelist.c (renamed from src/user/lib/fs/whitelist.c)0
-rw-r--r--src/libc/include/__errno.h (renamed from src/user/lib/include/__errno.h)0
-rw-r--r--src/libc/include/__errno.h.awk (renamed from src/user/lib/include/__errno.h.awk)0
-rw-r--r--src/libc/include/_proc.h (renamed from src/user/lib/include/_proc.h)0
-rw-r--r--src/libc/include/alloca.h (renamed from src/user/lib/include/alloca.h)0
-rw-r--r--src/libc/include/bits/file.h (renamed from src/user/lib/include/bits/file.h)0
-rw-r--r--src/libc/include/bits/panic.h (renamed from src/user/lib/include/bits/panic.h)0
-rw-r--r--src/libc/include/camellia.h (renamed from src/user/lib/include/camellia.h)0
-rw-r--r--src/libc/include/camellia/compat.h (renamed from src/user/lib/include/camellia/compat.h)0
-rw-r--r--src/libc/include/camellia/fs/dir.h (renamed from src/user/lib/include/camellia/fs/dir.h)0
-rw-r--r--src/libc/include/camellia/fs/misc.h (renamed from src/user/lib/include/camellia/fs/misc.h)0
-rw-r--r--src/libc/include/ctype.h (renamed from src/user/lib/include/ctype.h)0
-rw-r--r--src/libc/include/dirent.h (renamed from src/user/lib/include/dirent.h)0
-rw-r--r--src/libc/include/draw.h (renamed from src/user/lib/include/draw.h)0
-rw-r--r--src/libc/include/elfload.h (renamed from src/user/lib/include/elfload.h)0
-rw-r--r--src/libc/include/err.h (renamed from src/user/lib/include/err.h)0
-rw-r--r--src/libc/include/errno.h (renamed from src/user/lib/include/errno.h)0
-rw-r--r--src/libc/include/esemaphore.h (renamed from src/user/lib/include/esemaphore.h)0
-rw-r--r--src/libc/include/fcntl.h (renamed from src/user/lib/include/fcntl.h)0
-rw-r--r--src/libc/include/ftw.h (renamed from src/user/lib/include/ftw.h)0
l---------src/libc/include/getopt.h (renamed from src/user/lib/include/getopt.h)0
-rw-r--r--src/libc/include/grp.h (renamed from src/user/lib/include/grp.h)0
-rw-r--r--src/libc/include/inttypes.h (renamed from src/user/lib/include/inttypes.h)0
-rw-r--r--src/libc/include/limits.h (renamed from src/user/lib/include/limits.h)0
-rw-r--r--src/libc/include/locale.h (renamed from src/user/lib/include/locale.h)0
l---------src/libc/include/malloc.h (renamed from src/user/lib/include/malloc.h)0
-rw-r--r--src/libc/include/math.h (renamed from src/user/lib/include/math.h)0
-rw-r--r--src/libc/include/pwd.h (renamed from src/user/lib/include/pwd.h)0
-rw-r--r--src/libc/include/setjmp.h (renamed from src/user/lib/include/setjmp.h)0
-rw-r--r--src/libc/include/signal.h (renamed from src/user/lib/include/signal.h)0
-rw-r--r--src/libc/include/stdio.h (renamed from src/user/lib/include/stdio.h)0
-rw-r--r--src/libc/include/stdlib.h (renamed from src/user/lib/include/stdlib.h)0
-rw-r--r--src/libc/include/string.h (renamed from src/user/lib/include/string.h)0
-rw-r--r--src/libc/include/strings.h (renamed from src/user/lib/include/strings.h)0
-rw-r--r--src/libc/include/sys/ioctl.h (renamed from src/user/lib/include/sys/ioctl.h)0
-rw-r--r--src/libc/include/sys/mman.h (renamed from src/user/lib/include/sys/mman.h)0
-rw-r--r--src/libc/include/sys/param.h (renamed from src/user/lib/include/sys/param.h)0
-rw-r--r--src/libc/include/sys/resource.h (renamed from src/user/lib/include/sys/resource.h)0
-rw-r--r--src/libc/include/sys/stat.h (renamed from src/user/lib/include/sys/stat.h)0
-rw-r--r--src/libc/include/sys/sysmacros.h (renamed from src/user/lib/include/sys/sysmacros.h)0
-rw-r--r--src/libc/include/sys/time.h (renamed from src/user/lib/include/sys/time.h)0
-rw-r--r--src/libc/include/sys/times.h (renamed from src/user/lib/include/sys/times.h)0
-rw-r--r--src/libc/include/sys/types.h (renamed from src/user/lib/include/sys/types.h)0
-rw-r--r--src/libc/include/sys/wait.h (renamed from src/user/lib/include/sys/wait.h)0
-rw-r--r--src/libc/include/termios.h (renamed from src/user/lib/include/termios.h)0
-rw-r--r--src/libc/include/thread.h (renamed from src/user/lib/include/thread.h)0
-rw-r--r--src/libc/include/time.h (renamed from src/user/lib/include/time.h)0
-rw-r--r--src/libc/include/unistd.h (renamed from src/user/lib/include/unistd.h)0
-rw-r--r--src/libc/intr.s (renamed from src/user/lib/intr.s)0
-rw-r--r--src/libc/math.c (renamed from src/user/lib/math.c)0
-rw-r--r--src/libc/mman.c (renamed from src/user/lib/mman.c)0
-rw-r--r--src/libc/printf.c (renamed from src/user/lib/printf.c)0
-rw-r--r--src/libc/pwd.c (renamed from src/user/lib/pwd.c)0
-rw-r--r--src/libc/setjmp.s (renamed from src/user/lib/setjmp.s)0
-rw-r--r--src/libc/signal.c (renamed from src/user/lib/signal.c)0
-rw-r--r--src/libc/stdio/file.c (renamed from src/user/lib/stdio/file.c)0
-rw-r--r--src/libc/stdio/file.h (renamed from src/user/lib/stdio/file.h)0
-rw-r--r--src/libc/stdio/misc.c (renamed from src/user/lib/stdio/misc.c)0
-rw-r--r--src/libc/stdlib.c (renamed from src/user/lib/stdlib.c)0
-rw-r--r--src/libc/string/strerror.c (renamed from src/user/lib/string/strerror.c)0
-rw-r--r--src/libc/string/string.c (renamed from src/user/lib/string/string.c)0
-rw-r--r--src/libc/syscall.c (renamed from src/user/lib/syscall.c)0
-rw-r--r--src/libc/syscall.c.awk (renamed from src/user/lib/syscall.c.awk)0
-rw-r--r--src/libc/syscall.s (renamed from src/user/lib/syscall.s)0
-rw-r--r--src/libc/sysstat.c (renamed from src/user/lib/sysstat.c)0
-rw-r--r--src/libc/syswait.c (renamed from src/user/lib/syswait.c)0
-rw-r--r--src/libc/thread.S (renamed from src/user/lib/thread.S)0
-rw-r--r--src/libc/time.c (renamed from src/user/lib/time.c)0
-rw-r--r--src/libc/unistd.c (renamed from src/user/lib/unistd.c)0
-rw-r--r--src/libc/vendor/dlmalloc/malloc.c (renamed from src/user/lib/vendor/dlmalloc/malloc.c)0
-rw-r--r--src/libc/vendor/dlmalloc/malloc.h (renamed from src/user/lib/vendor/dlmalloc/malloc.h)0
-rw-r--r--src/libc/vendor/getopt/getopt.c (renamed from src/user/lib/vendor/getopt/getopt.c)0
-rw-r--r--src/libc/vendor/getopt/getopt.h (renamed from src/user/lib/vendor/getopt/getopt.h)0
-rw-r--r--src/libk/fsutil.c (renamed from src/shared/fsutil.c)0
-rw-r--r--src/libk/include/assert.h (renamed from src/shared/include/assert.h)0
-rw-r--r--src/libk/include/camellia/errno.h (renamed from src/shared/include/camellia/errno.h)0
-rw-r--r--src/libk/include/camellia/execbuf.h (renamed from src/shared/include/camellia/execbuf.h)0
-rw-r--r--src/libk/include/camellia/flags.h (renamed from src/shared/include/camellia/flags.h)0
-rw-r--r--src/libk/include/camellia/fsutil.h (renamed from src/shared/include/camellia/fsutil.h)0
-rw-r--r--src/libk/include/camellia/path.h (renamed from src/shared/include/camellia/path.h)0
-rw-r--r--src/libk/include/camellia/syscalls.h (renamed from src/shared/include/camellia/syscalls.h)0
-rw-r--r--src/libk/include/camellia/types.h (renamed from src/shared/include/camellia/types.h)0
-rw-r--r--src/libk/include/shared/mem.h (renamed from src/shared/include/shared/mem.h)0
-rw-r--r--src/libk/include/shared/printf.h (renamed from src/shared/include/shared/printf.h)0
-rw-r--r--src/libk/include/shared/ring.h (renamed from src/shared/include/shared/ring.h)0
-rw-r--r--src/libk/mem.c (renamed from src/shared/mem.c)0
-rw-r--r--src/libk/path.c (renamed from src/shared/path.c)0
-rw-r--r--src/libk/printf.c (renamed from src/shared/printf.c)0
-rw-r--r--src/libk/ring.c (renamed from src/shared/ring.c)0
-rw-r--r--src/user/linker.ld23
l---------sysroot/usr/include2
l---------sysroot/usr/lib/crt0.o2
l---------sysroot/usr/local/include2
181 files changed, 38 insertions, 47 deletions
diff --git a/.gitignore b/.gitignore
index a01d11b..9ec2699 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
out
+cache
toolchain/prefix/
toolchain/*-build/
diff --git a/.gitmodules b/.gitmodules
index 9621900..4af731c 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,5 +1,5 @@
[submodule "src/user/app/ext2fs/ext2"]
- path = src/user/app/ext2fs/ext2
+ path = src/cmd/ext2fs/ext2
url = https://github.com/dzwdz/ext2.git
[submodule "toolchain/binutils"]
path = toolchain/binutils
diff --git a/Makefile b/Makefile
index 7a1b5cf..848a5d4 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ CFLAGS += -Wall -Wextra -Wold-style-definition -Werror=implicit-function-declara
CFLAGS += -Wno-address-of-packed-member -Werror=incompatible-pointer-types
KERNEL_CFLAGS = $(CFLAGS) -ffreestanding -mno-sse -mgeneral-regs-only \
- --sysroot=$(shell pwd)/sysroot_alt/ -Isrc/ -Isrc/shared/include/ -fno-pie
+ --sysroot=src/kernel/sysroot/ -Isrc/ -Isrc/libk/include/ -fno-pie
LIBC_CFLAGS = $(CFLAGS) -ffreestanding -Isrc/
USER_CFLAGS = $(CFLAGS)
@@ -40,7 +40,7 @@ endef
.PHONY: all portdeps boot check clean ports
all: portdeps out/boot.iso check
-portdeps: out/libc.a out/libm.a src/user/lib/include/__errno.h
+portdeps: out/libc.a out/libm.a src/libc/include/__errno.h
boot: all out/fs.e2
qemu-system-x86_64 \
@@ -72,7 +72,7 @@ out/boot.iso: out/fs/boot/kernel out/fs/boot/grub/grub.cfg out/fs/boot/init
out/fs/boot/kernel: src/kernel/arch/amd64/linker.ld \
$(call from_sources, src/kernel/) \
- $(call from_sources, src/shared/)
+ $(call from_sources, src/libk/)
@mkdir -p $(@D)
@$(CC) \
-nostdlib \
@@ -81,8 +81,7 @@ out/fs/boot/kernel: src/kernel/arch/amd64/linker.ld \
@grub-file --is-x86-multiboot2 $@ || echo "$@ has an invalid multiboot2 header"
@grub-file --is-x86-multiboot2 $@ || rm $@; test -e $@
-out/libc.a: $(call from_sources, src/user/lib/) \
- $(call from_sources, src/shared/)
+out/libc.a: $(call from_sources, src/libc/) $(call from_sources, src/libk/)
@mkdir -p $(@D)
@$(AR) rcs $@ $^
@@ -93,7 +92,7 @@ out/libm.a:
out/bootstrap: out/bootstrap.elf
@objcopy -O binary $^ $@
-out/bootstrap.elf: src/user/bootstrap/linker.ld $(call from_sources, src/user/bootstrap/) out/libc.a
+out/bootstrap.elf: src/bootstrap/linker.ld $(call from_sources, src/bootstrap/) out/libc.a
@mkdir -p $(@D)
@$(CC) -nostdlib -Wl,-no-pie -T $^ -o $@
@@ -109,15 +108,15 @@ out/fs.e2:
@mkfs.ext2 $@ 1024 > /dev/null
define userbin_template =
-out/initrd/bin/amd64/$(1): $(call from_sources, src/user/app/$(1)) out/libc.a
+out/initrd/bin/amd64/$(1): $(call from_sources, src/cmd/$(1)) out/libc.a
@mkdir -p $$(@D)
@$(CC) $$^ -o $$@
endef
-USERBINS := $(shell ls src/user/app)
+USERBINS := $(shell ls src/cmd)
$(foreach bin,$(USERBINS),$(eval $(call userbin_template,$(bin))))
# don't build the example implementation from libext2
-out/obj/user/app/ext2fs/ext2/example.c.o:
+out/obj/cmd/ext2fs/ext2/example.c.o:
@touch $@
# portdeps is phony, so ports/% is automatically "phony" too
@@ -144,7 +143,7 @@ out/obj/%.S.o: src/%.S
@mkdir -p $(@D)
@$(CC) $(CFLAGS) -c $^ -o $@
-out/obj/shared/%.c.o: src/shared/%.c
+out/obj/libk/%.c.o: src/libk/%.c
@mkdir -p $(@D)
@$(CC) $(KERNEL_CFLAGS) -fPIC -c $^ -o $@
@@ -152,22 +151,22 @@ out/obj/kernel/%.c.o: src/kernel/%.c
@mkdir -p $(@D)
@$(CC) $(KERNEL_CFLAGS) -fPIC -c $^ -o $@
-out/obj/user/%.c.o: src/user/%.c
+out/obj/%.c.o: src/%.c
@mkdir -p $(@D)
@$(CC) $(USER_CFLAGS) -fPIC -c $^ -o $@
-out/obj/user/lib/%.c.o: src/user/lib/%.c
+out/obj/libc/%.c.o: src/libc/%.c
@mkdir -p $(@D)
@$(CC) $(LIBC_CFLAGS) -fPIC -c $^ -o $@
-out/obj/user/lib/vendor/%.c.o: src/user/lib/vendor/%.c
+out/obj/libc/vendor/%.c.o: src/libc/vendor/%.c
@mkdir -p $(@D)
@$(CC) $(LIBC_CFLAGS) -fPIC -c $^ -o $@ \
-DLACKS_TIME_H -DLACKS_FCNTL_H -DLACKS_SYS_PARAM_H \
-DMAP_ANONYMOUS -DHAVE_MORECORE=0 -DNO_MALLOC_H \
-Wno-expansion-to-defined -Wno-old-style-definition
-out/obj/user/bootstrap/%.c.o: src/user/bootstrap/%.c
+out/obj/bootstrap/%.c.o: src/bootstrap/%.c
@mkdir -p $(@D)
@$(CC) $(USER_CFLAGS) -fno-pic -c $^ -o $@
@@ -179,8 +178,8 @@ out/obj/kernel/arch/amd64/32/%.s.o: src/kernel/arch/amd64/32/%.s
@mkdir -p $(@D)
@$(CC) -m32 -c $^ -o $@
-src/user/lib/include/__errno.h: src/user/lib/include/__errno.h.awk src/shared/include/camellia/errno.h
+src/libc/include/__errno.h: src/libc/include/__errno.h.awk src/libk/include/camellia/errno.h
@awk -f $^ > $@
-src/user/lib/syscall.c: src/user/lib/syscall.c.awk src/shared/include/camellia/syscalls.h
+src/libc/syscall.c: src/libc/syscall.c.awk src/libk/include/camellia/syscalls.h
@awk -f $^ > $@
diff --git a/tools/dep_builders/binutils b/contrib/dep_builders/binutils
index 42dd04b..42dd04b 100755
--- a/tools/dep_builders/binutils
+++ b/contrib/dep_builders/binutils
diff --git a/tools/dep_builders/dl b/contrib/dep_builders/dl
index 8cfeebc..e6f279f 100755
--- a/tools/dep_builders/dl
+++ b/contrib/dep_builders/dl
@@ -1,8 +1,8 @@
#!/bin/sh
# downloads a file to toolchain/cache unless it's already present there
-mkdir -p toolchain/cache
-OUT="toolchain/cache/$(basename $1)"
+mkdir -p cache/toolchain
+OUT="cache/toolchain/$(basename $1)"
[ -e "$OUT" ] && exit
echo "downloading $1..."
diff --git a/tools/dep_builders/gcc b/contrib/dep_builders/gcc
index 0a37541..0a37541 100755
--- a/tools/dep_builders/gcc
+++ b/contrib/dep_builders/gcc
diff --git a/tools/sort_includes.rb b/contrib/sort_includes.rb
index c9f7076..c9f7076 100755
--- a/tools/sort_includes.rb
+++ b/contrib/sort_includes.rb
diff --git a/tools/stacktrace_resolve.awk b/contrib/stacktrace_resolve.awk
index 53d6993..53d6993 100644
--- a/tools/stacktrace_resolve.awk
+++ b/contrib/stacktrace_resolve.awk
diff --git a/ports/post b/ports/post
index f0638e6..5dd3cfd 100644
--- a/ports/post
+++ b/ports/post
@@ -3,8 +3,8 @@ set -eu
ensure_pre_was_loaded
portdir=$repodir/ports/$pkg/
-workdir=$repodir/ports/out/$pkg/
-downdir=$repodir/ports/out/downloads/
+workdir=$repodir/out/ports/$pkg/
+downdir=$repodir/cache/ports/
mkdir -p $workdir $downdir
cd $workdir
diff --git a/readme.md b/readme.md
index 359ad6d..7f1d803 100644
--- a/readme.md
+++ b/readme.md
@@ -16,3 +16,17 @@ apt-get install grub-pc-bin xorriso mtools # for the .iso
apt-get install g++ libgmp-dev lbmpfr-dev libmpc-dev # for the toolchain
apt-get install qemu-system-x86
```
+
+## repo organization
+```
+src/
+ bootstrap/ first userland program ran by the kernel; embeds the initrd
+ cmd/ userland programs
+ kernel/
+ arch/amd64/
+ sysroot/
+ dummy sysroot to get gcc to behave
+ libc/
+ libk/ libc functions used by the kernel
+cache/ download cache
+```
diff --git a/src/user/bootstrap/entry.S b/src/bootstrap/entry.S
index bd1b417..bd1b417 100644
--- a/src/user/bootstrap/entry.S
+++ b/src/bootstrap/entry.S
diff --git a/src/user/bootstrap/linker.ld b/src/bootstrap/linker.ld
index 10e3f98..10e3f98 100644
--- a/src/user/bootstrap/linker.ld
+++ b/src/bootstrap/linker.ld
diff --git a/src/user/bootstrap/main.c b/src/bootstrap/main.c
index d27da39..d27da39 100644
--- a/src/user/bootstrap/main.c
+++ b/src/bootstrap/main.c
diff --git a/src/user/bootstrap/tar.c b/src/bootstrap/tar.c
index 2020fe0..2020fe0 100644
--- a/src/user/bootstrap/tar.c
+++ b/src/bootstrap/tar.c
diff --git a/src/user/bootstrap/tar.h b/src/bootstrap/tar.h
index e7ab130..e7ab130 100644
--- a/src/user/bootstrap/tar.h
+++ b/src/bootstrap/tar.h
diff --git a/src/user/app/drawmouse/drawmouse.c b/src/cmd/drawmouse/drawmouse.c
index 31a1255..31a1255 100644
--- a/src/user/app/drawmouse/drawmouse.c
+++ b/src/cmd/drawmouse/drawmouse.c
diff --git a/src/user/app/dvd/dvd.c b/src/cmd/dvd/dvd.c
index a15b440..a15b440 100644
--- a/src/user/app/dvd/dvd.c
+++ b/src/cmd/dvd/dvd.c
diff --git a/src/user/app/ext2fs/ext2 b/src/cmd/ext2fs/ext2
-Subproject 8db7b4fbb2429b504d7c711dae89d917de16bed
+Subproject 8db7b4fbb2429b504d7c711dae89d917de16bed
diff --git a/src/user/app/ext2fs/main.c b/src/cmd/ext2fs/main.c
index 12ef3bc..12ef3bc 100644
--- a/src/user/app/ext2fs/main.c
+++ b/src/cmd/ext2fs/main.c
diff --git a/src/user/app/find/find.c b/src/cmd/find/find.c
index d473b82..d473b82 100644
--- a/src/user/app/find/find.c
+++ b/src/cmd/find/find.c
diff --git a/src/user/app/httpd/httpd.c b/src/cmd/httpd/httpd.c
index 668e534..668e534 100644
--- a/src/user/app/httpd/httpd.c
+++ b/src/cmd/httpd/httpd.c
diff --git a/src/user/app/init/driver/driver.h b/src/cmd/init/driver/driver.h
index 98c18f1..98c18f1 100644
--- a/src/user/app/init/driver/driver.h
+++ b/src/cmd/init/driver/driver.h
diff --git a/src/user/app/init/driver/initctl.c b/src/cmd/init/driver/initctl.c
index fed71b7..fed71b7 100644
--- a/src/user/app/init/driver/initctl.c
+++ b/src/cmd/init/driver/initctl.c
diff --git a/src/user/app/init/driver/ps2.c b/src/cmd/init/driver/ps2.c
index 5470249..5470249 100644
--- a/src/user/app/init/driver/ps2.c
+++ b/src/cmd/init/driver/ps2.c
diff --git a/src/user/app/init/driver/termcook.c b/src/cmd/init/driver/termcook.c
index a76f3a8..a76f3a8 100644
--- a/src/user/app/init/driver/termcook.c
+++ b/src/cmd/init/driver/termcook.c
diff --git a/src/user/app/init/init.c b/src/cmd/init/init.c
index fcebfc7..fcebfc7 100644
--- a/src/user/app/init/init.c
+++ b/src/cmd/init/init.c
diff --git a/src/user/app/iochk/iochk.c b/src/cmd/iochk/iochk.c
index 0850821..0850821 100644
--- a/src/user/app/iochk/iochk.c
+++ b/src/cmd/iochk/iochk.c
diff --git a/src/user/app/iostress/iostress.c b/src/cmd/iostress/iostress.c
index ac555de..ac555de 100644
--- a/src/user/app/iostress/iostress.c
+++ b/src/cmd/iostress/iostress.c
diff --git a/src/user/app/logfs/logfs.c b/src/cmd/logfs/logfs.c
index a50d530..a50d530 100644
--- a/src/user/app/logfs/logfs.c
+++ b/src/cmd/logfs/logfs.c
diff --git a/src/user/app/login/login.c b/src/cmd/login/login.c
index 0f9e8b7..0f9e8b7 100644
--- a/src/user/app/login/login.c
+++ b/src/cmd/login/login.c
diff --git a/src/user/app/netdog/nd.c b/src/cmd/netdog/nd.c
index af5c264..af5c264 100644
--- a/src/user/app/netdog/nd.c
+++ b/src/cmd/netdog/nd.c
diff --git a/src/user/app/netstack/arp.c b/src/cmd/netstack/arp.c
index 3a1c8da..3a1c8da 100644
--- a/src/user/app/netstack/arp.c
+++ b/src/cmd/netstack/arp.c
diff --git a/src/user/app/netstack/ether.c b/src/cmd/netstack/ether.c
index 52abac2..52abac2 100644
--- a/src/user/app/netstack/ether.c
+++ b/src/cmd/netstack/ether.c
diff --git a/src/user/app/netstack/fs.c b/src/cmd/netstack/fs.c
index 6d51c35..6d51c35 100644
--- a/src/user/app/netstack/fs.c
+++ b/src/cmd/netstack/fs.c
diff --git a/src/user/app/netstack/icmp.c b/src/cmd/netstack/icmp.c
index 0c6a502..0c6a502 100644
--- a/src/user/app/netstack/icmp.c
+++ b/src/cmd/netstack/icmp.c
diff --git a/src/user/app/netstack/ipv4.c b/src/cmd/netstack/ipv4.c
index 1336dc1..1336dc1 100644
--- a/src/user/app/netstack/ipv4.c
+++ b/src/cmd/netstack/ipv4.c
diff --git a/src/user/app/netstack/netstack.c b/src/cmd/netstack/netstack.c
index 2636429..2636429 100644
--- a/src/user/app/netstack/netstack.c
+++ b/src/cmd/netstack/netstack.c
diff --git a/src/user/app/netstack/proto.h b/src/cmd/netstack/proto.h
index 8ea11ac..8ea11ac 100644
--- a/src/user/app/netstack/proto.h
+++ b/src/cmd/netstack/proto.h
diff --git a/src/user/app/netstack/tcp.c b/src/cmd/netstack/tcp.c
index d1adeab..d1adeab 100644
--- a/src/user/app/netstack/tcp.c
+++ b/src/cmd/netstack/tcp.c
diff --git a/src/user/app/netstack/udp.c b/src/cmd/netstack/udp.c
index 3d560ae..3d560ae 100644
--- a/src/user/app/netstack/udp.c
+++ b/src/cmd/netstack/udp.c
diff --git a/src/user/app/netstack/util.c b/src/cmd/netstack/util.c
index 68092aa..68092aa 100644
--- a/src/user/app/netstack/util.c
+++ b/src/cmd/netstack/util.c
diff --git a/src/user/app/netstack/util.h b/src/cmd/netstack/util.h
index 0b29560..0b29560 100644
--- a/src/user/app/netstack/util.h
+++ b/src/cmd/netstack/util.h
diff --git a/src/user/app/ps/ps.c b/src/cmd/ps/ps.c
index 76a5841..76a5841 100644
--- a/src/user/app/ps/ps.c
+++ b/src/cmd/ps/ps.c
diff --git a/src/user/app/shell/builtins.c b/src/cmd/shell/builtins.c
index 9c294b2..9c294b2 100644
--- a/src/user/app/shell/builtins.c
+++ b/src/cmd/shell/builtins.c
diff --git a/src/user/app/shell/builtins.h b/src/cmd/shell/builtins.h
index 1e422bb..1e422bb 100644
--- a/src/user/app/shell/builtins.h
+++ b/src/cmd/shell/builtins.h
diff --git a/src/user/app/shell/parser.c b/src/cmd/shell/parser.c
index ad09348..ad09348 100644
--- a/src/user/app/shell/parser.c
+++ b/src/cmd/shell/parser.c
diff --git a/src/user/app/shell/shell.c b/src/cmd/shell/shell.c
index 185aa7e..185aa7e 100644
--- a/src/user/app/shell/shell.c
+++ b/src/cmd/shell/shell.c
diff --git a/src/user/app/shell/shell.h b/src/cmd/shell/shell.h
index 050e704..050e704 100644
--- a/src/user/app/shell/shell.h
+++ b/src/cmd/shell/shell.h
diff --git a/src/user/app/testelf/main.c b/src/cmd/testelf/main.c
index 0cbe56c..0cbe56c 100644
--- a/src/user/app/testelf/main.c
+++ b/src/cmd/testelf/main.c
diff --git a/src/user/app/tests/kernel/fdlimit.c b/src/cmd/tests/kernel/fdlimit.c
index f332357..f332357 100644
--- a/src/user/app/tests/kernel/fdlimit.c
+++ b/src/cmd/tests/kernel/fdlimit.c
diff --git a/src/user/app/tests/kernel/fs.c b/src/cmd/tests/kernel/fs.c
index b5684d7..b5684d7 100644
--- a/src/user/app/tests/kernel/fs.c
+++ b/src/cmd/tests/kernel/fs.c
diff --git a/src/user/app/tests/kernel/misc.c b/src/cmd/tests/kernel/misc.c
index 5d6b531..5d6b531 100644
--- a/src/user/app/tests/kernel/misc.c
+++ b/src/cmd/tests/kernel/misc.c
diff --git a/src/user/app/tests/kernel/miscsyscall.c b/src/cmd/tests/kernel/miscsyscall.c
index 459da2a..459da2a 100644
--- a/src/user/app/tests/kernel/miscsyscall.c
+++ b/src/cmd/tests/kernel/miscsyscall.c
diff --git a/src/user/app/tests/kernel/path.c b/src/cmd/tests/kernel/path.c
index 5a22c36..5a22c36 100644
--- a/src/user/app/tests/kernel/path.c
+++ b/src/cmd/tests/kernel/path.c
diff --git a/src/user/app/tests/kernel/threads.c b/src/cmd/tests/kernel/threads.c
index b3c1c06..b3c1c06 100644
--- a/src/user/app/tests/kernel/threads.c
+++ b/src/cmd/tests/kernel/threads.c
diff --git a/src/user/app/tests/libc/esemaphore.c b/src/cmd/tests/libc/esemaphore.c
index f089f4f..f089f4f 100644
--- a/src/user/app/tests/libc/esemaphore.c
+++ b/src/cmd/tests/libc/esemaphore.c
diff --git a/src/user/app/tests/libc/setjmp.c b/src/cmd/tests/libc/setjmp.c
index 0dded9d..0dded9d 100644
--- a/src/user/app/tests/libc/setjmp.c
+++ b/src/cmd/tests/libc/setjmp.c
diff --git a/src/user/app/tests/libc/string.c b/src/cmd/tests/libc/string.c
index 6afe350..6afe350 100644
--- a/src/user/app/tests/libc/string.c
+++ b/src/cmd/tests/libc/string.c
diff --git a/src/user/app/tests/shared/printf.c b/src/cmd/tests/shared/printf.c
index d8df48a..d8df48a 100644
--- a/src/user/app/tests/shared/printf.c
+++ b/src/cmd/tests/shared/printf.c
diff --git a/src/user/app/tests/shared/ringbuf.c b/src/cmd/tests/shared/ringbuf.c
index d2a35a1..d2a35a1 100644
--- a/src/user/app/tests/shared/ringbuf.c
+++ b/src/cmd/tests/shared/ringbuf.c
diff --git a/src/user/app/tests/stress.c b/src/cmd/tests/stress.c
index 1ef018c..1ef018c 100644
--- a/src/user/app/tests/stress.c
+++ b/src/cmd/tests/stress.c
diff --git a/src/user/app/tests/tests.c b/src/cmd/tests/tests.c
index 5cba682..5cba682 100644
--- a/src/user/app/tests/tests.c
+++ b/src/cmd/tests/tests.c
diff --git a/src/user/app/tests/tests.h b/src/cmd/tests/tests.h
index 5037e1a..5037e1a 100644
--- a/src/user/app/tests/tests.h
+++ b/src/cmd/tests/tests.h
diff --git a/src/user/app/tmpfs/tmpfs.c b/src/cmd/tmpfs/tmpfs.c
index 6d58790..6d58790 100644
--- a/src/user/app/tmpfs/tmpfs.c
+++ b/src/cmd/tmpfs/tmpfs.c
diff --git a/src/user/app/vterm/draw.c b/src/cmd/vterm/draw.c
index ee36a0f..ee36a0f 100644
--- a/src/user/app/vterm/draw.c
+++ b/src/cmd/vterm/draw.c
diff --git a/src/user/app/vterm/font.c b/src/cmd/vterm/font.c
index 777b094..777b094 100644
--- a/src/user/app/vterm/font.c
+++ b/src/cmd/vterm/font.c
diff --git a/src/user/app/vterm/vterm.c b/src/cmd/vterm/vterm.c
index f365f6b..f365f6b 100644
--- a/src/user/app/vterm/vterm.c
+++ b/src/cmd/vterm/vterm.c
diff --git a/src/user/app/vterm/vterm.h b/src/cmd/vterm/vterm.h
index 026e71a..026e71a 100644
--- a/src/user/app/vterm/vterm.h
+++ b/src/cmd/vterm/vterm.h
diff --git a/sysroot_alt/usr/include/limits.h b/src/kernel/sysroot/usr/include/limits.h
index d433a99..d433a99 100644
--- a/sysroot_alt/usr/include/limits.h
+++ b/src/kernel/sysroot/usr/include/limits.h
diff --git a/src/user/lib/_start.s b/src/libc/_start.s
index 12d2c5f..12d2c5f 100644
--- a/src/user/lib/_start.s
+++ b/src/libc/_start.s
diff --git a/src/user/lib/_start2.c b/src/libc/_start2.c
index b4eb76a..b4eb76a 100644
--- a/src/user/lib/_start2.c
+++ b/src/libc/_start2.c
diff --git a/src/user/lib/assert.c b/src/libc/assert.c
index 0c46450..0c46450 100644
--- a/src/user/lib/assert.c
+++ b/src/libc/assert.c
diff --git a/src/user/lib/camellia.c b/src/libc/camellia.c
index 4e092e4..4e092e4 100644
--- a/src/user/lib/camellia.c
+++ b/src/libc/camellia.c
diff --git a/src/user/lib/compat.c b/src/libc/compat.c
index 3ec47f9..3ec47f9 100644
--- a/src/user/lib/compat.c
+++ b/src/libc/compat.c
diff --git a/src/user/lib/ctype.c b/src/libc/ctype.c
index fa49a07..fa49a07 100644
--- a/src/user/lib/ctype.c
+++ b/src/libc/ctype.c
diff --git a/src/user/lib/dirent.c b/src/libc/dirent.c
index c2d1b9c..c2d1b9c 100644
--- a/src/user/lib/dirent.c
+++ b/src/libc/dirent.c
diff --git a/src/user/lib/draw/draw.c b/src/libc/draw/draw.c
index 1c2a371..1c2a371 100644
--- a/src/user/lib/draw/draw.c
+++ b/src/libc/draw/draw.c
diff --git a/src/user/lib/draw/flush.c b/src/libc/draw/flush.c
index 88bf3d6..88bf3d6 100644
--- a/src/user/lib/draw/flush.c
+++ b/src/libc/draw/flush.c
diff --git a/src/user/lib/elf.h b/src/libc/elf.h
index 8dc6242..8dc6242 100644
--- a/src/user/lib/elf.h
+++ b/src/libc/elf.h
diff --git a/src/user/lib/elfload.S b/src/libc/elfload.S
index 78d5b3c..78d5b3c 100644
--- a/src/user/lib/elfload.S
+++ b/src/libc/elfload.S
diff --git a/src/user/lib/elfload.c b/src/libc/elfload.c
index c1a08f8..c1a08f8 100644
--- a/src/user/lib/elfload.c
+++ b/src/libc/elfload.c
diff --git a/src/user/lib/elfreloc.c b/src/libc/elfreloc.c
index aab2a2a..aab2a2a 100644
--- a/src/user/lib/elfreloc.c
+++ b/src/libc/elfreloc.c
diff --git a/src/user/lib/err.c b/src/libc/err.c
index 7a220fe..7a220fe 100644
--- a/src/user/lib/err.c
+++ b/src/libc/err.c
diff --git a/src/user/lib/esemaphore.c b/src/libc/esemaphore.c
index 2707d11..2707d11 100644
--- a/src/user/lib/esemaphore.c
+++ b/src/libc/esemaphore.c
diff --git a/src/user/lib/fcntl.c b/src/libc/fcntl.c
index b2d8685..b2d8685 100644
--- a/src/user/lib/fcntl.c
+++ b/src/libc/fcntl.c
diff --git a/src/user/lib/fs/dir.c b/src/libc/fs/dir.c
index b7f840d..b7f840d 100644
--- a/src/user/lib/fs/dir.c
+++ b/src/libc/fs/dir.c
diff --git a/src/user/lib/fs/dirinject.c b/src/libc/fs/dirinject.c
index 9b08756..9b08756 100644
--- a/src/user/lib/fs/dirinject.c
+++ b/src/libc/fs/dirinject.c
diff --git a/src/user/lib/fs/misc.c b/src/libc/fs/misc.c
index 30e5ab4..30e5ab4 100644
--- a/src/user/lib/fs/misc.c
+++ b/src/libc/fs/misc.c
diff --git a/src/user/lib/fs/whitelist.c b/src/libc/fs/whitelist.c
index 54a79c3..54a79c3 100644
--- a/src/user/lib/fs/whitelist.c
+++ b/src/libc/fs/whitelist.c
diff --git a/src/user/lib/include/__errno.h b/src/libc/include/__errno.h
index 7551ce0..7551ce0 100644
--- a/src/user/lib/include/__errno.h
+++ b/src/libc/include/__errno.h
diff --git a/src/user/lib/include/__errno.h.awk b/src/libc/include/__errno.h.awk
index 6232835..6232835 100644
--- a/src/user/lib/include/__errno.h.awk
+++ b/src/libc/include/__errno.h.awk
diff --git a/src/user/lib/include/_proc.h b/src/libc/include/_proc.h
index 5f9c321..5f9c321 100644
--- a/src/user/lib/include/_proc.h
+++ b/src/libc/include/_proc.h
diff --git a/src/user/lib/include/alloca.h b/src/libc/include/alloca.h
index 9c7641c..9c7641c 100644
--- a/src/user/lib/include/alloca.h
+++ b/src/libc/include/alloca.h
diff --git a/src/user/lib/include/bits/file.h b/src/libc/include/bits/file.h
index 63a31c4..63a31c4 100644
--- a/src/user/lib/include/bits/file.h
+++ b/src/libc/include/bits/file.h
diff --git a/src/user/lib/include/bits/panic.h b/src/libc/include/bits/panic.h
index 91aec5f..91aec5f 100644
--- a/src/user/lib/include/bits/panic.h
+++ b/src/libc/include/bits/panic.h
diff --git a/src/user/lib/include/camellia.h b/src/libc/include/camellia.h
index 2e4998b..2e4998b 100644
--- a/src/user/lib/include/camellia.h
+++ b/src/libc/include/camellia.h
diff --git a/src/user/lib/include/camellia/compat.h b/src/libc/include/camellia/compat.h
index a7c6f1f..a7c6f1f 100644
--- a/src/user/lib/include/camellia/compat.h
+++ b/src/libc/include/camellia/compat.h
diff --git a/src/user/lib/include/camellia/fs/dir.h b/src/libc/include/camellia/fs/dir.h
index d34a652..d34a652 100644
--- a/src/user/lib/include/camellia/fs/dir.h
+++ b/src/libc/include/camellia/fs/dir.h
diff --git a/src/user/lib/include/camellia/fs/misc.h b/src/libc/include/camellia/fs/misc.h
index 301c604..301c604 100644
--- a/src/user/lib/include/camellia/fs/misc.h
+++ b/src/libc/include/camellia/fs/misc.h
diff --git a/src/user/lib/include/ctype.h b/src/libc/include/ctype.h
index 1ebb111..1ebb111 100644
--- a/src/user/lib/include/ctype.h
+++ b/src/libc/include/ctype.h
diff --git a/src/user/lib/include/dirent.h b/src/libc/include/dirent.h
index 7c419d7..7c419d7 100644
--- a/src/user/lib/include/dirent.h
+++ b/src/libc/include/dirent.h
diff --git a/src/user/lib/include/draw.h b/src/libc/include/draw.h
index 5e614be..5e614be 100644
--- a/src/user/lib/include/draw.h
+++ b/src/libc/include/draw.h
diff --git a/src/user/lib/include/elfload.h b/src/libc/include/elfload.h
index 825f765..825f765 100644
--- a/src/user/lib/include/elfload.h
+++ b/src/libc/include/elfload.h
diff --git a/src/user/lib/include/err.h b/src/libc/include/err.h
index 6b63c6c..6b63c6c 100644
--- a/src/user/lib/include/err.h
+++ b/src/libc/include/err.h
diff --git a/src/user/lib/include/errno.h b/src/libc/include/errno.h
index 6686a01..6686a01 100644
--- a/src/user/lib/include/errno.h
+++ b/src/libc/include/errno.h
diff --git a/src/user/lib/include/esemaphore.h b/src/libc/include/esemaphore.h
index 9cc85e0..9cc85e0 100644
--- a/src/user/lib/include/esemaphore.h
+++ b/src/libc/include/esemaphore.h
diff --git a/src/user/lib/include/fcntl.h b/src/libc/include/fcntl.h
index 6338d1f..6338d1f 100644
--- a/src/user/lib/include/fcntl.h
+++ b/src/libc/include/fcntl.h
diff --git a/src/user/lib/include/ftw.h b/src/libc/include/ftw.h
index 6dc8132..6dc8132 100644
--- a/src/user/lib/include/ftw.h
+++ b/src/libc/include/ftw.h
diff --git a/src/user/lib/include/getopt.h b/src/libc/include/getopt.h
index 4890ceb..4890ceb 120000
--- a/src/user/lib/include/getopt.h
+++ b/src/libc/include/getopt.h
diff --git a/src/user/lib/include/grp.h b/src/libc/include/grp.h
index e7b99c9..e7b99c9 100644
--- a/src/user/lib/include/grp.h
+++ b/src/libc/include/grp.h
diff --git a/src/user/lib/include/inttypes.h b/src/libc/include/inttypes.h
index 9a6118b..9a6118b 100644
--- a/src/user/lib/include/inttypes.h
+++ b/src/libc/include/inttypes.h
diff --git a/src/user/lib/include/limits.h b/src/libc/include/limits.h
index 972553f..972553f 100644
--- a/src/user/lib/include/limits.h
+++ b/src/libc/include/limits.h
diff --git a/src/user/lib/include/locale.h b/src/libc/include/locale.h
index 1221375..1221375 100644
--- a/src/user/lib/include/locale.h
+++ b/src/libc/include/locale.h
diff --git a/src/user/lib/include/malloc.h b/src/libc/include/malloc.h
index 80b9bf5..80b9bf5 120000
--- a/src/user/lib/include/malloc.h
+++ b/src/libc/include/malloc.h
diff --git a/src/user/lib/include/math.h b/src/libc/include/math.h
index 1aec564..1aec564 100644
--- a/src/user/lib/include/math.h
+++ b/src/libc/include/math.h
diff --git a/src/user/lib/include/pwd.h b/src/libc/include/pwd.h
index 6721ca2..6721ca2 100644
--- a/src/user/lib/include/pwd.h
+++ b/src/libc/include/pwd.h
diff --git a/src/user/lib/include/setjmp.h b/src/libc/include/setjmp.h
index 6d05d79..6d05d79 100644
--- a/src/user/lib/include/setjmp.h
+++ b/src/libc/include/setjmp.h
diff --git a/src/user/lib/include/signal.h b/src/libc/include/signal.h
index 012481e..012481e 100644
--- a/src/user/lib/include/signal.h
+++ b/src/libc/include/signal.h
diff --git a/src/user/lib/include/stdio.h b/src/libc/include/stdio.h
index 48d5058..48d5058 100644
--- a/src/user/lib/include/stdio.h
+++ b/src/libc/include/stdio.h
diff --git a/src/user/lib/include/stdlib.h b/src/libc/include/stdlib.h
index ee9d179..ee9d179 100644
--- a/src/user/lib/include/stdlib.h
+++ b/src/libc/include/stdlib.h
diff --git a/src/user/lib/include/string.h b/src/libc/include/string.h
index 78bed9b..78bed9b 100644
--- a/src/user/lib/include/string.h
+++ b/src/libc/include/string.h
diff --git a/src/user/lib/include/strings.h b/src/libc/include/strings.h
index d0abc47..d0abc47 100644
--- a/src/user/lib/include/strings.h
+++ b/src/libc/include/strings.h
diff --git a/src/user/lib/include/sys/ioctl.h b/src/libc/include/sys/ioctl.h
index 708bc3f..708bc3f 100644
--- a/src/user/lib/include/sys/ioctl.h
+++ b/src/libc/include/sys/ioctl.h
diff --git a/src/user/lib/include/sys/mman.h b/src/libc/include/sys/mman.h
index 074ebe2..074ebe2 100644
--- a/src/user/lib/include/sys/mman.h
+++ b/src/libc/include/sys/mman.h
diff --git a/src/user/lib/include/sys/param.h b/src/libc/include/sys/param.h
index e6c9d6f..e6c9d6f 100644
--- a/src/user/lib/include/sys/param.h
+++ b/src/libc/include/sys/param.h
diff --git a/src/user/lib/include/sys/resource.h b/src/libc/include/sys/resource.h
index 4582ce0..4582ce0 100644
--- a/src/user/lib/include/sys/resource.h
+++ b/src/libc/include/sys/resource.h
diff --git a/src/user/lib/include/sys/stat.h b/src/libc/include/sys/stat.h
index 343db55..343db55 100644
--- a/src/user/lib/include/sys/stat.h
+++ b/src/libc/include/sys/stat.h
diff --git a/src/user/lib/include/sys/sysmacros.h b/src/libc/include/sys/sysmacros.h
index 30e0efd..30e0efd 100644
--- a/src/user/lib/include/sys/sysmacros.h
+++ b/src/libc/include/sys/sysmacros.h
diff --git a/src/user/lib/include/sys/time.h b/src/libc/include/sys/time.h
index e69de29..e69de29 100644
--- a/src/user/lib/include/sys/time.h
+++ b/src/libc/include/sys/time.h
diff --git a/src/user/lib/include/sys/times.h b/src/libc/include/sys/times.h
index 4a8d3ef..4a8d3ef 100644
--- a/src/user/lib/include/sys/times.h
+++ b/src/libc/include/sys/times.h
diff --git a/src/user/lib/include/sys/types.h b/src/libc/include/sys/types.h
index faf656a..faf656a 100644
--- a/src/user/lib/include/sys/types.h
+++ b/src/libc/include/sys/types.h
diff --git a/src/user/lib/include/sys/wait.h b/src/libc/include/sys/wait.h
index cff407e..cff407e 100644
--- a/src/user/lib/include/sys/wait.h
+++ b/src/libc/include/sys/wait.h
diff --git a/src/user/lib/include/termios.h b/src/libc/include/termios.h
index e69de29..e69de29 100644
--- a/src/user/lib/include/termios.h
+++ b/src/libc/include/termios.h
diff --git a/src/user/lib/include/thread.h b/src/libc/include/thread.h
index 5a5ddc0..5a5ddc0 100644
--- a/src/user/lib/include/thread.h
+++ b/src/libc/include/thread.h
diff --git a/src/user/lib/include/time.h b/src/libc/include/time.h
index 5d03664..5d03664 100644
--- a/src/user/lib/include/time.h
+++ b/src/libc/include/time.h
diff --git a/src/user/lib/include/unistd.h b/src/libc/include/unistd.h
index 005e79c..005e79c 100644
--- a/src/user/lib/include/unistd.h
+++ b/src/libc/include/unistd.h
diff --git a/src/user/lib/intr.s b/src/libc/intr.s
index 008387d..008387d 100644
--- a/src/user/lib/intr.s
+++ b/src/libc/intr.s
diff --git a/src/user/lib/math.c b/src/libc/math.c
index 4f8eda4..4f8eda4 100644
--- a/src/user/lib/math.c
+++ b/src/libc/math.c
diff --git a/src/user/lib/mman.c b/src/libc/mman.c
index 32eeb2a..32eeb2a 100644
--- a/src/user/lib/mman.c
+++ b/src/libc/mman.c
diff --git a/src/user/lib/printf.c b/src/libc/printf.c
index ad1fd06..ad1fd06 100644
--- a/src/user/lib/printf.c
+++ b/src/libc/printf.c
diff --git a/src/user/lib/pwd.c b/src/libc/pwd.c
index d7bf2af..d7bf2af 100644
--- a/src/user/lib/pwd.c
+++ b/src/libc/pwd.c
diff --git a/src/user/lib/setjmp.s b/src/libc/setjmp.s
index 29292da..29292da 100644
--- a/src/user/lib/setjmp.s
+++ b/src/libc/setjmp.s
diff --git a/src/user/lib/signal.c b/src/libc/signal.c
index 3200263..3200263 100644
--- a/src/user/lib/signal.c
+++ b/src/libc/signal.c
diff --git a/src/user/lib/stdio/file.c b/src/libc/stdio/file.c
index efaf013..efaf013 100644
--- a/src/user/lib/stdio/file.c
+++ b/src/libc/stdio/file.c
diff --git a/src/user/lib/stdio/file.h b/src/libc/stdio/file.h
index 3bd64a1..3bd64a1 100644
--- a/src/user/lib/stdio/file.h
+++ b/src/libc/stdio/file.h
diff --git a/src/user/lib/stdio/misc.c b/src/libc/stdio/misc.c
index 45144f3..45144f3 100644
--- a/src/user/lib/stdio/misc.c
+++ b/src/libc/stdio/misc.c
diff --git a/src/user/lib/stdlib.c b/src/libc/stdlib.c
index 1739230..1739230 100644
--- a/src/user/lib/stdlib.c
+++ b/src/libc/stdlib.c
diff --git a/src/user/lib/string/strerror.c b/src/libc/string/strerror.c
index c838299..c838299 100644
--- a/src/user/lib/string/strerror.c
+++ b/src/libc/string/strerror.c
diff --git a/src/user/lib/string/string.c b/src/libc/string/string.c
index c65d7c5..c65d7c5 100644
--- a/src/user/lib/string/string.c
+++ b/src/libc/string/string.c
diff --git a/src/user/lib/syscall.c b/src/libc/syscall.c
index 5196683..5196683 100644
--- a/src/user/lib/syscall.c
+++ b/src/libc/syscall.c
diff --git a/src/user/lib/syscall.c.awk b/src/libc/syscall.c.awk
index 591a6f0..591a6f0 100644
--- a/src/user/lib/syscall.c.awk
+++ b/src/libc/syscall.c.awk
diff --git a/src/user/lib/syscall.s b/src/libc/syscall.s
index 07f5631..07f5631 100644
--- a/src/user/lib/syscall.s
+++ b/src/libc/syscall.s
diff --git a/src/user/lib/sysstat.c b/src/libc/sysstat.c
index 97bb50b..97bb50b 100644
--- a/src/user/lib/sysstat.c
+++ b/src/libc/sysstat.c
diff --git a/src/user/lib/syswait.c b/src/libc/syswait.c
index ce80c7b..ce80c7b 100644
--- a/src/user/lib/syswait.c
+++ b/src/libc/syswait.c
diff --git a/src/user/lib/thread.S b/src/libc/thread.S
index 2900544..2900544 100644
--- a/src/user/lib/thread.S
+++ b/src/libc/thread.S
diff --git a/src/user/lib/time.c b/src/libc/time.c
index 4709ecd..4709ecd 100644
--- a/src/user/lib/time.c
+++ b/src/libc/time.c
diff --git a/src/user/lib/unistd.c b/src/libc/unistd.c
index 578cadc..578cadc 100644
--- a/src/user/lib/unistd.c
+++ b/src/libc/unistd.c
diff --git a/src/user/lib/vendor/dlmalloc/malloc.c b/src/libc/vendor/dlmalloc/malloc.c
index 649cfbc..649cfbc 100644
--- a/src/user/lib/vendor/dlmalloc/malloc.c
+++ b/src/libc/vendor/dlmalloc/malloc.c
diff --git a/src/user/lib/vendor/dlmalloc/malloc.h b/src/libc/vendor/dlmalloc/malloc.h
index e52c9e5..e52c9e5 100644
--- a/src/user/lib/vendor/dlmalloc/malloc.h
+++ b/src/libc/vendor/dlmalloc/malloc.h
diff --git a/src/user/lib/vendor/getopt/getopt.c b/src/libc/vendor/getopt/getopt.c
index 63c9b51..63c9b51 100644
--- a/src/user/lib/vendor/getopt/getopt.c
+++ b/src/libc/vendor/getopt/getopt.c
diff --git a/src/user/lib/vendor/getopt/getopt.h b/src/libc/vendor/getopt/getopt.h
index 4cb075c..4cb075c 100644
--- a/src/user/lib/vendor/getopt/getopt.h
+++ b/src/libc/vendor/getopt/getopt.h
diff --git a/src/shared/fsutil.c b/src/libk/fsutil.c
index 05ca44a..05ca44a 100644
--- a/src/shared/fsutil.c
+++ b/src/libk/fsutil.c
diff --git a/src/shared/include/assert.h b/src/libk/include/assert.h
index 7520aa9..7520aa9 100644
--- a/src/shared/include/assert.h
+++ b/src/libk/include/assert.h
diff --git a/src/shared/include/camellia/errno.h b/src/libk/include/camellia/errno.h
index 1177f54..1177f54 100644
--- a/src/shared/include/camellia/errno.h
+++ b/src/libk/include/camellia/errno.h
diff --git a/src/shared/include/camellia/execbuf.h b/src/libk/include/camellia/execbuf.h
index de7ae3b..de7ae3b 100644
--- a/src/shared/include/camellia/execbuf.h
+++ b/src/libk/include/camellia/execbuf.h
diff --git a/src/shared/include/camellia/flags.h b/src/libk/include/camellia/flags.h
index f4c54fe..f4c54fe 100644
--- a/src/shared/include/camellia/flags.h
+++ b/src/libk/include/camellia/flags.h
diff --git a/src/shared/include/camellia/fsutil.h b/src/libk/include/camellia/fsutil.h
index 8b8c4fc..8b8c4fc 100644
--- a/src/shared/include/camellia/fsutil.h
+++ b/src/libk/include/camellia/fsutil.h
diff --git a/src/shared/include/camellia/path.h b/src/libk/include/camellia/path.h
index b268595..b268595 100644
--- a/src/shared/include/camellia/path.h
+++ b/src/libk/include/camellia/path.h
diff --git a/src/shared/include/camellia/syscalls.h b/src/libk/include/camellia/syscalls.h
index 9a8fa94..9a8fa94 100644
--- a/src/shared/include/camellia/syscalls.h
+++ b/src/libk/include/camellia/syscalls.h
diff --git a/src/shared/include/camellia/types.h b/src/libk/include/camellia/types.h
index 65200d7..65200d7 100644
--- a/src/shared/include/camellia/types.h
+++ b/src/libk/include/camellia/types.h
diff --git a/src/shared/include/shared/mem.h b/src/libk/include/shared/mem.h
index 3597edf..3597edf 100644
--- a/src/shared/include/shared/mem.h
+++ b/src/libk/include/shared/mem.h
diff --git a/src/shared/include/shared/printf.h b/src/libk/include/shared/printf.h
index 45fd358..45fd358 100644
--- a/src/shared/include/shared/printf.h
+++ b/src/libk/include/shared/printf.h
diff --git a/src/shared/include/shared/ring.h b/src/libk/include/shared/ring.h
index dbaf331..dbaf331 100644
--- a/src/shared/include/shared/ring.h
+++ b/src/libk/include/shared/ring.h
diff --git a/src/shared/mem.c b/src/libk/mem.c
index 14dd6bd..14dd6bd 100644
--- a/src/shared/mem.c
+++ b/src/libk/mem.c
diff --git a/src/shared/path.c b/src/libk/path.c
index 4e3077b..4e3077b 100644
--- a/src/shared/path.c
+++ b/src/libk/path.c
diff --git a/src/shared/printf.c b/src/libk/printf.c
index fffd801..fffd801 100644
--- a/src/shared/printf.c
+++ b/src/libk/printf.c
diff --git a/src/shared/ring.c b/src/libk/ring.c
index 44c73f6..44c73f6 100644
--- a/src/shared/ring.c
+++ b/src/libk/ring.c
diff --git a/src/user/linker.ld b/src/user/linker.ld
deleted file mode 100644
index 4925448..0000000
--- a/src/user/linker.ld
+++ /dev/null
@@ -1,23 +0,0 @@
-ENTRY(_start)
-
-SECTIONS
-{
- __executable_start = .;
- .text BLOCK(4K) : ALIGN(4K)
- {
- *(.text)
- }
- .rodata BLOCK(4K) : ALIGN(4K)
- {
- *(.rodata)
- }
- .data BLOCK(4K) : ALIGN(4K)
- {
- *(.data)
- }
- .bss BLOCK(4K) : ALIGN(4K)
- {
- *(COMMON)
- *(.bss)
- }
-}
diff --git a/sysroot/usr/include b/sysroot/usr/include
index e7f2ad7..3f3830c 120000
--- a/sysroot/usr/include
+++ b/sysroot/usr/include
@@ -1 +1 @@
-../../src/user/lib/include \ No newline at end of file
+../../src/libc/include \ No newline at end of file
diff --git a/sysroot/usr/lib/crt0.o b/sysroot/usr/lib/crt0.o
index acea146..648a150 120000
--- a/sysroot/usr/lib/crt0.o
+++ b/sysroot/usr/lib/crt0.o
@@ -1 +1 @@
-../../../out/obj/user/lib/_start.s.o \ No newline at end of file
+../../../out/obj/libc/_start.s.o \ No newline at end of file
diff --git a/sysroot/usr/local/include b/sysroot/usr/local/include
index 09eec1e..f4fd256 120000
--- a/sysroot/usr/local/include
+++ b/sysroot/usr/local/include
@@ -1 +1 @@
-../../../src/shared/include \ No newline at end of file
+../../../src/libk/include \ No newline at end of file