From 882aaa3844a77628d709363f0103086348ac5735 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Mon, 11 Mar 2019 14:07:16 +0100 Subject: [PATCH] Stuff I don't remember --- Makefile | 25 +++++++++++++++++++++---- Makefile.in | 2 +- kaleid/crtlib/sprintf.c | 1 + kaleid/kernel/init/init.c | 9 ++++++++- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0dc4347..cb4500f 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,24 @@ OBJDIR=build/obj BINDIR=build/bin # Object to link (temp) -l_objects=./build/obj/kaleid/crtlib/memory.o ./build/obj/kaleid/crtlib/rand.o ./build/obj/kaleid/crtlib/string.o ./build/obj/kaleid/crtlib/ultoa.o ./build/obj/kaleid/crtlib/strtol.o ./build/obj/kaleid/crtlib/utoa.o ./build/obj/kaleid/crtlib/status.o ./build/obj/kaleid/crtlib/atoul.o ./build/obj/kaleid/crtlib/atol.o ./build/obj/kaleid/crtlib/itoa.o ./build/obj/kaleid/crtlib/ltoa.o ./build/obj/kaleid/crtlib/atou.o ./build/obj/kaleid/crtlib/arith.o ./build/obj/kaleid/crtlib/atoi.o ./build/obj/kaleid/extras/prog.o ./build/obj/kaleid/extras/argv.o ./build/obj/kaleid/kernel/init/table.o ./build/obj/kaleid/kernel/init/init.o ./build/obj/kaleid/kernel/io/vga.o ./build/obj/kaleid/kernel/io/cursor.o ./build/obj/kaleid/kernel/io/term.o ./build/obj/kaleid/kernel/ke/panic.o ./build/obj/boot/loader.o +l_objects=./build/obj/kaleid/crtlib/memory.o \ + ./build/obj/kaleid/crtlib/rand.o \ + ./build/obj/kaleid/crtlib/string.o \ + ./build/obj/kaleid/crtlib/ultoa.o \ + ./build/obj/kaleid/crtlib/utoa.o \ + ./build/obj/kaleid/crtlib/ctype.o \ + ./build/obj/kaleid/crtlib/itoa.o \ + ./build/obj/kaleid/crtlib/ltoa.o \ + ./build/obj/kaleid/crtlib/sprintf.o \ + ./build/obj/kaleid/extras/prog.o \ + ./build/obj/kaleid/extras/argv.o \ + ./build/obj/kaleid/kernel/init/table.o \ + ./build/obj/kaleid/kernel/init/init.o \ + ./build/obj/kaleid/kernel/io/vga.o \ + ./build/obj/kaleid/kernel/io/cursor.o \ + ./build/obj/kaleid/kernel/io/term.o \ + ./build/obj/kaleid/kernel/ke/panic.o \ + ./build/obj/boot/loader.o #Color codes CL='\033[0;32m' @@ -92,18 +109,18 @@ make_disk: @echo ${CL2}[make_disk]${CL} OK${CL3} test: kernel loader - @qemu-system-x86_64 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -enable-kvm 2> qemu.log & + qemu-system-x86_64 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -enable-kvm 2> qemu.log & @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > loader_disasm64.asm @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > loader_disasm32.asm test32: kernel loader - @qemu-system-i386 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -enable-kvm 2> qemu.log & + qemu-system-i386 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -enable-kvm 2> qemu.log & @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > loader_disasm64.asm @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > loader_disasm32.asm debug: kernel loader - @qemu-system-x86_64 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -s -S -enable-kvm 2> qemu.log & + qemu-system-x86_64 -hda build/bin/disk.img -d cpu_reset,guest_errors,pcall,int -s -S -enable-kvm 2> qemu.log & @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > loader_disasm64.asm @ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > loader_disasm32.asm diff --git a/Makefile.in b/Makefile.in index 8e4c573..4e4c536 100644 --- a/Makefile.in +++ b/Makefile.in @@ -27,7 +27,7 @@ // The madman's Makefile #include "build/preproc.h" -CCNAME="/opt/cross-cc/bin/x86_64-elf-gcc" +CCNAME=x86_64-elf-gcc CC2NAME=gcc COPTIM=-O2 CWARNS=-Wall -Wextra // -Werror=implicit-function-declaration diff --git a/kaleid/crtlib/sprintf.c b/kaleid/crtlib/sprintf.c index 5613434..8174ddd 100644 --- a/kaleid/crtlib/sprintf.c +++ b/kaleid/crtlib/sprintf.c @@ -230,6 +230,7 @@ size_t vsnprintf(char *str, size_t n, const char *fmt, va_list ap) // Unknown/unsupported modifier :| *str++ = mod; + ret++; break; } diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index c50108a..961e55d 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -28,11 +28,18 @@ // // Entry point of the Kaleid kernel // -noreturn void StartKern(void* multibooot_info, int multiboot_magic) +noreturn void StartKern(void *mbInfo, int mbMagic) { + (void)mbInfo; + (void)mbMagic; + // We're not ready to deal with interrupts DisableIRQs(); + volatile ushort *vga = (volatile ushort *)0xB8000; + + *vga++ = 'AA'; + // Kernel terminals InitTerms();