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); }
public static void Write_Serial(byte a) { while (is_transmit_empty() == 0) { ; } KIO.outpb((ushort)Port, a); }
public static byte Read_Serial() { while (Serial_Received() == 0) { ; } return(KIO.inportb((short)Port)); }
public static void Serial_Init() { KIO.outpb((ushort)(Port + 1), 0x00); KIO.outpb((ushort)(Port + 3), 0x80); KIO.outpb((ushort)(Port + 0), 0x03); KIO.outpb((ushort)(Port + 1), 0x00); KIO.outpb((ushort)(Port + 3), 0x03); KIO.outpb((ushort)(Port + 2), 0xC7); KIO.outpb((ushort)(Port + 4), 0x0B); }
private static void set_CursorVisible(bool value) { CursorEnabled = value; if (value) { KIO.outpb(0x3D4, 0x0A); KIO.outpb(0x3D5, (byte)((KIO.inportb(0x3D5) & 0xC0) | CursorStart)); KIO.outpb(0x3D4, 0x0B); KIO.outpb(0x3D5, (byte)((KIO.inportb(0x3D5) & 0xE0) | CursorEnd)); } else { KIO.outpb(0x3D4, 0x0A); KIO.outpb(0x3D5, 0x20); } }
public static int is_transmit_empty() { return(KIO.inportb((short)(Port + 5)) & 0x20); }
public static int Serial_Received() { return(KIO.inportb((short)(Port + 5)) & 1); }