public static void Init() { ItohMap = "0123456789ABCDEF"; TerminalLfb = (byte *)0xB8000; X = 0; Y = 0; MaxWidth = 80; MaxHeight = 25; ColorBack = 0x0; ColorFront = 0xF; CursorEnabled = true; CursorOffsetOld = 0; KSerial.Serial_SetPort(0x3F8); KSerial.Serial_Init(); KSerial.Write_Serial_Str("Started Serial Log"); KSerial.Write_Serial_Str("\n"); Console.CursorVisible = false; KIO.outpb(0x3D4, 0x0F); KIO.outpb(0x3D5, 0); KIO.outpb(0x3D4, 0x0E); KIO.outpb(0x3D5, 0); // KIO.outpb(0x3d4, 0xa); // KIO.outpb(0x3d5, 0x0); Buf = (byte *)KMem.Kmalloc(255); }
private static void Write(char value) { KSerial.Write_Serial((byte)value); if (value == '\n') { UpdateCursor(); X = 0; Y++; if (Y >= 20) { Y--; ScrollUp(); } return; } if (value == '\t') { X += 4; } if (value == '\b') { var bOffset = ((Y * MaxWidth) + X - 1) * 2; TerminalLfb[bOffset] = (byte)' '; TerminalLfb[bOffset + 1] = (byte)(ColorFront | ColorBack << 8); ; X--; } var offset = ((Y * MaxWidth) + X) * 2; TerminalLfb[offset] = (byte)value; TerminalLfb[offset + 1] = (byte)(ColorFront | ColorBack << 8); X++; if (X > MaxWidth) { X = 0; Y++; if (Y >= 20) { Y--; ScrollUp(); } } }