From cf0b8a52287ee7c747b1d5a7d77abdef1fb46f94 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 13 Feb 2015 20:28:54 +0100 Subject: Reorganize code in preparation for user apps. --- src/apps/init/Makefile | 12 ++++++++++++ src/apps/init/main.c | 9 +++++++++ src/apps/linker.ld | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 src/apps/init/Makefile create mode 100644 src/apps/init/main.c create mode 100644 src/apps/linker.ld (limited to 'src/apps') diff --git a/src/apps/init/Makefile b/src/apps/init/Makefile new file mode 100644 index 0000000..e56d4c0 --- /dev/null +++ b/src/apps/init/Makefile @@ -0,0 +1,12 @@ + +OBJ = main.o + +LIB = ../../lib/libkogata/libkogata.lib + +CFLAGS = -I ./include -I ../../common/include -I ../../lib/include + +LDFLAGS = -T ../linker.ld -Xlinker -Map=init.map + +OUT = init.bin + +include ../../rules.make diff --git a/src/apps/init/main.c b/src/apps/init/main.c new file mode 100644 index 0000000..ef51834 --- /dev/null +++ b/src/apps/init/main.c @@ -0,0 +1,9 @@ +#include + +#include + +int main(int argc, char **argv) { + asm volatile("int $0x80"); + while(true); +} + diff --git a/src/apps/linker.ld b/src/apps/linker.ld new file mode 100644 index 0000000..0c84ecf --- /dev/null +++ b/src/apps/linker.ld @@ -0,0 +1,32 @@ +ENTRY (__libkogata_start) + +SECTIONS{ + . = 0x100000; + + .text : { + *(.text) + } + + .rodata ALIGN (0x1000) :{ + *(.rodata) + } + + .data ALIGN (0x1000) : { + start_ctors = .; + *(.ctor*) + end_ctors = .; + start_dtors = .; + *(.dtor*) + end_dtors = .; + *(.data) + } + + .bss : { + sbss = .; + *(COMMON) + *(.bss) + ebss = .; + } + + end = .; _end = .; __end = .; +} -- cgit v1.2.3