diff --git a/kernel/arch/i386/tty.nim b/kernel/arch/i386/tty.nim index 98086e9..90aee3f 100644 --- a/kernel/arch/i386/tty.nim +++ b/kernel/arch/i386/tty.nim @@ -64,16 +64,17 @@ var parsedData = ['0','0','0','0','0','0','0','0','0','0'] proc terminalWrite*(data: int) = var input = data var i = 0 - if(input < 0): - terminalWrite('-') if(input == 0): terminalWrite('0') - else: - while(input > 0): - let parsedChar: char = char(48 + (input mod 10)) - parsedData[i] = parsedChar - i = i + 1 - input = input div 10 + return + if(input < 0): + terminalWrite('-') + input = input * -1 + while(input != 0): + let parsedChar: char = char(48 + (input mod 10)) + parsedData[i] = parsedChar + i = i + 1 + input = input div 10 while i > 0: i = i - 1 terminalWrite(parsedData[i]) diff --git a/kernel/kernel.nim b/kernel/kernel.nim index eb37f8d..248c666 100644 --- a/kernel/kernel.nim +++ b/kernel/kernel.nim @@ -2,6 +2,8 @@ import tty proc kernelMain() {.exportc: "kernel_main"}= terminalInitialize() - terminalWrite("Hello World!\LNim here!\L") - for i in 0..10: - terminalWrite(i) + terminalWrite("Hello World!\L") + terminalWrite("MAX_INT:") + terminalWrite(high(int)) + terminalWrite("\LMIN_INT:") + terminalWrite(low(int32)+1)