From f163a5d5f6802f63092229f0f9326e5fb44b7908 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 9 Aug 2020 21:55:42 +0200 Subject: Added malloc/free syscall --- apps/Makefile | 2 +- apps/a.c | 2 +- apps/init.c | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/Makefile b/apps/Makefile index 8c5ecac..d6c3789 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -5,7 +5,7 @@ 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../lib/inc/ -fPIE +CFLAGS = $(CSFLAGS) -Wall -Wextra -nostdlib -nostdinc -ffreestanding -ffunction-sections -fno-builtin -std=c99 -m32 -pedantic-errors -I../lib/inc/ -fPIE -Duserspace all: $(COBJS) diff --git a/apps/a.c b/apps/a.c index 5fef114..448bedd 100644 --- a/apps/a.c +++ b/apps/a.c @@ -7,7 +7,7 @@ void main() { print("\nA loaded!\n"); - sys0(SYS_HALT); + sys0(SYS_LOOP); while (1) { print("a"); } diff --git a/apps/init.c b/apps/init.c index 2851e8e..813021b 100644 --- a/apps/init.c +++ b/apps/init.c @@ -1,13 +1,17 @@ // MIT License, Copyright (c) 2020 Marvin Borner #include +#include #include #include void main() { print("Init loaded.\n"); - sys1(SYS_EXEC, (int)"/a"); + + printf("%x %d %b\n ABC %s", 42, 42, 42, "BAUM"); + sys0(SYS_LOOP); + /* sys1(SYS_EXEC, (int)"/a"); */ while (1) { print("b"); }; -- cgit v1.2.3