From a03745805b007758a07368fea777bca629942516 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 7 Nov 2017 01:39:24 +0000 Subject: [PATCH] Remove C usage --- kernel/arch/i386/tty.nim | 14 +++++++------- kernel/panicoverride.nim | 10 ++-------- nim.cfg | 4 ++-- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/kernel/arch/i386/tty.nim b/kernel/arch/i386/tty.nim index 09836f8..c7d3baf 100644 --- a/kernel/arch/i386/tty.nim +++ b/kernel/arch/i386/tty.nim @@ -20,8 +20,8 @@ proc terminalWriteAtPoint(writeChar: char, colour: int, xPos: int, yPos: int) = vgaMem[index] = vga.vgaEntry(writeChar, terminalColour) proc terminalClear*() = - for x in 0..", cdecl.} -proc exit(code: int) {.importc, header: "", cdecl.} +import tty {.push stack_trace: off, profiler:off.} proc rawoutput(s: string) = - printf("%s\n", s) + tty.terminalWrite(s) proc panic(s: string) = rawoutput(s) - exit(1) # Alternatively we also could implement these 2 here: # @@ -19,4 +14,3 @@ proc panic(s: string) = # template sysFatal(exceptn: typeDesc, message, arg: string) {.pop.} -{.pop.} \ No newline at end of file diff --git a/nim.cfg b/nim.cfg index bfe0008..a075888 100644 --- a/nim.cfg +++ b/nim.cfg @@ -5,6 +5,6 @@ --path:"kernel/arch/i386" --cpu:i386 --os:standalone ---passC:"-ffreestanding -nostdlib --target=i386-pc-none-elf -march=i386 -lc" ---passL:"-ffreestanding -target i386 -nostdlib -T ./kernel/arch/i386/linker.ld boot.o -lc" +--passC:"-ffreestanding -nostdlib --target=i386-pc-none-elf -march=i386" +--passL:"-ffreestanding -target i386 -nostdlib -T ./kernel/arch/i386/linker.ld boot.o" --out:"myos.bin"