From 162d024a53e1e31e00ff0b6f47dd4590edebc551 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 9 Aug 2020 16:51:01 +0200 Subject: Heavy restructuring of libc, kernel and apps --- apps/Makefile | 4 ++-- apps/a.c | 9 +-------- apps/b.c | 9 +-------- apps/init.c | 9 +-------- 4 files changed, 5 insertions(+), 26 deletions(-) (limited to 'apps') diff --git a/apps/Makefile b/apps/Makefile index 91d7920..8c5ecac 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -5,12 +5,12 @@ CC = ../cross/opt/bin/i686-elf-gcc LD = ../cross/opt/bin/i686-elf-ld OC = ../cross/opt/bin/i686-elf-objcopy -CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -ffunction-sections -fno-builtin -std=c99 -m32 -pedantic-errors -I../src/lib/inc/ -fPIE +CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -ffunction-sections -fno-builtin -std=c99 -m32 -pedantic-errors -I../lib/inc/ -fPIE all: $(COBJS) %.o: %.c @mkdir -p ../build/apps/ @$(CC) -c $(CFLAGS) $< -o $@ - @$(LD) -o $(@:.o=.elf) -Tlink.ld $@ + @$(LD) -o $(@:.o=.elf) -Tlink.ld -L../build/ $@ -lc @$(OC) -O binary $(@:.o=.elf) ../build/apps/$(@:.o=) diff --git a/apps/a.c b/apps/a.c index d9e68f8..45375c9 100644 --- a/apps/a.c +++ b/apps/a.c @@ -1,14 +1,7 @@ // MIT License, Copyright (c) 2020 Marvin Borner #include - -u32 strlen(const char *s) -{ - const char *ss = s; - while (*ss) - ss++; - return ss - s; -} +#include u8 inb(u16 port) { diff --git a/apps/b.c b/apps/b.c index a0134bc..20ca888 100644 --- a/apps/b.c +++ b/apps/b.c @@ -1,14 +1,7 @@ // MIT License, Copyright (c) 2020 Marvin Borner #include - -u32 strlen(const char *s) -{ - const char *ss = s; - while (*ss) - ss++; - return ss - s; -} +#include u8 inb(u16 port) { diff --git a/apps/init.c b/apps/init.c index 4a557a8..c35f26f 100644 --- a/apps/init.c +++ b/apps/init.c @@ -1,14 +1,7 @@ // MIT License, Copyright (c) 2020 Marvin Borner #include - -u32 strlen(const char *s) -{ - const char *ss = s; - while (*ss) - ss++; - return ss - s; -} +#include u8 inb(u16 port) { -- cgit v1.2.3