From e9407b091b34d93014b89660601da62f13df37aa Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 1 Dec 2019 15:47:35 +0100 Subject: Semi-working C-based userspace syscalls --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0d5d541..bd3753a 100644 --- a/Makefile +++ b/Makefile @@ -34,13 +34,19 @@ build: clean i686-elf-objcopy -O binary ./build/font.o ./build/font.bin; \ rm ./build/font.o; \ + # Userspace + nasm -f elf ./src/userspace/start.asm -o ./build/user_start.o || exit; \ + i686-elf-gcc -c ./src/userspace/main.c -o ./build/user_main.o -I ./src/mlibc -std=gnu99 -ffreestanding -O3 -Wall -Wextra -Wno-unused-parameter || exit; \ + i686-elf-gcc -I ./src/mlibc -o ./build/user.o -std=gnu99 -ffreestanding -O2 -nostdlib ./build/user_start.o ./build/user_main.o || exit; \ + i686-elf-objcopy -O binary ./build/user.o ./build/user.bin; \ + # Create ISO mkdir -p ./iso/boot/; \ mv ./build/melvix.bin ./iso/boot/kernel.bin; \ nasm ./src/bootloader/cd.asm -f bin -o ./iso/boot/cd.bin || exit; \ nasm ./src/bootloader/hdd1.asm -f bin -o ./iso/boot/hdd1.bin || exit; \ nasm ./src/bootloader/hdd2.asm -f bin -o ./iso/boot/hdd2.bin || exit; \ - nasm ./src/userspace/main.asm -f bin -o ./iso/user.bin || exit; \ + cp ./build/user.bin ./iso/user.bin || exit; \ cp ./build/font.bin ./iso/font.bin || exit; \ genisoimage -quiet -input-charset utf-8 -no-emul-boot -b boot/cd.bin -o ./build/melvix.iso ./iso; -- cgit v1.2.3