summaryrefslogtreecommitdiff
path: root/usrbin
diff options
context:
space:
mode:
Diffstat (limited to 'usrbin')
-rw-r--r--usrbin/Makefile4
-rw-r--r--usrbin/main.c11
-rw-r--r--usrbin/print.c3
3 files changed, 10 insertions, 8 deletions
diff --git a/usrbin/Makefile b/usrbin/Makefile
index 9a40cbc..67e63fa 100644
--- a/usrbin/Makefile
+++ b/usrbin/Makefile
@@ -1,5 +1,7 @@
TARGET = usrbin_blob.o
+LIB = ../lib/lib.a
+
SRCS = $(wildcard *.c)
ASMS = $(wildcard *.s)
OBJS = $(SRCS:.c=.o) $(ASMS:.s=.o)
@@ -23,7 +25,7 @@ build: $(TARGET)
$(CC) -c -o $*.o $^
$(TARGET): $(OBJS)
- $(LD) -o usrbin.bin $(OBJS)
+ $(LD) -o usrbin.bin $(OBJS) $(LIB)
objcopy -I binary -O elf32-i386 -B i386 usrbin.bin $(TARGET) \
--redefine-sym _binary_usrbin_bin_start=_usrbin_start \
--redefine-sym _binary_usrbin_bin_end=_usrbin_end \
diff --git a/usrbin/main.c b/usrbin/main.c
index d2ea633..aa48450 100644
--- a/usrbin/main.c
+++ b/usrbin/main.c
@@ -1,9 +1,12 @@
#include <stdint.h>
-
-extern int print(char*);
+#include <stdio.h>
+#include <time.h>
void main(void) {
- print("We did it ma!\n");
+ printf("We did it ma!\n");
- char c = *((char*) 0x80BEEF);
+ while(1) {
+ sleep(1);
+ printf("1000ms tick!\n");
+ }
}
diff --git a/usrbin/print.c b/usrbin/print.c
deleted file mode 100644
index ea32cdf..0000000
--- a/usrbin/print.c
+++ /dev/null
@@ -1,3 +0,0 @@
-#include <unistd.h>
-
-_syscall1(int, print, char*, s);