From 893244c8b5272df86da5d333332eec26ae8f15f2 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Fri, 5 Feb 2010 20:49:34 +0100 Subject: More work, does not work --- src/grapes/test/Makefile | 30 ++++++++++++++++++++++++++++++ src/grapes/test/main.c | 8 ++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/grapes/test/Makefile create mode 100644 src/grapes/test/main.c (limited to 'src/grapes/test') diff --git a/src/grapes/test/Makefile b/src/grapes/test/Makefile new file mode 100644 index 0000000..ddcc36f --- /dev/null +++ b/src/grapes/test/Makefile @@ -0,0 +1,30 @@ +.PHONY: clean, mrproper + +CC = gcc +CFLAGS = -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -fno-stack-protector -Wall -Wextra + +LD = ld +LDFLAGS = -T ../link.ld + +Objects = main.o +Outfile = test + +all: $(Outfile) + echo "* Done with $(Outfile)" + +rebuild: mrproper all + +$(Outfile): $(Objects) + echo "* Linking $@..." + $(LD) $(LDFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + echo "* Removing objects..." + rm $(Objects) + +mrproper: clean + rm $(Outfile) + diff --git a/src/grapes/test/main.c b/src/grapes/test/main.c new file mode 100644 index 0000000..d10ad35 --- /dev/null +++ b/src/grapes/test/main.c @@ -0,0 +1,8 @@ +void printk(char *s) { + asm volatile("int $64" : : "a"(4), "b"(s)); +} + +void start() { + printk("Hi world !"); + asm volatile("int $64" : : "a"(0)); +} -- cgit v1.2.3