Fixed the serial port bug that caused a FIFO overflow in Bochs.
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
#ifndef KERNEL_VERSION_NUMBER
|
||||
#define KERNEL_VERSION_NUMBER "0.0.1-348"
|
||||
#define KERNEL_VERSION_NUMBER "0.0.1-354"
|
||||
#endif
|
||||
|
||||
+5
-3
@@ -7,11 +7,11 @@ void kmain()
|
||||
{
|
||||
set_serial_baud_rate(COM1_PORT, 0x03);
|
||||
configure_serial_line(COM1_PORT);
|
||||
write_to_com(COM1_PORT, "Info From Kernel: Set up COM1 for messaging.\n");
|
||||
write_to_com(COM1_PORT, "Set up COM1 for messaging.\n");
|
||||
clear_screen();
|
||||
write_to_com(COM1_PORT, "Info From Kernel: Clearing screen.\n");
|
||||
write_to_com(COM1_PORT, "Clearing screen.\n");
|
||||
print_banner();
|
||||
write_to_com(COM1_PORT, "Info From Kernel: Displaying OS banner.\n");
|
||||
write_to_com(COM1_PORT, "Displaying OS banner.\n");
|
||||
//draw_rect(20, 5, 50, 7, 0x4, 0xF);
|
||||
draw_rect(0, 5, 5, 13, 0xF, 0x4);
|
||||
draw_rect(5, 8, 10, 10, 0x4, 0xF);
|
||||
@@ -37,8 +37,10 @@ void kmain()
|
||||
//draw_s("And 2nd Row. Now the 3rd row.", 2, 9);
|
||||
move_cursor(0, 3);
|
||||
draw_string("Installing GDT...\n", 0xF, 0x0);
|
||||
write_to_com(COM1_PORT, "Installing the GDT.\n");
|
||||
gdt_install();
|
||||
move_cursor(0, 4);
|
||||
write_to_com(COM1_PORT, "GDT installed.\n");
|
||||
draw_string("Installed GDT\n", 0xf, 0x0);
|
||||
|
||||
asm("hlt");
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ void configure_serial_line(unsigned short com){
|
||||
*/
|
||||
int serial_transmit_fifo_empty(unsigned int com){
|
||||
// 0x20 = 0010 0000
|
||||
return inb((com + 5) & 0x20);
|
||||
return inb(com + 5) & 0x20;
|
||||
}
|
||||
|
||||
void write_to_com(unsigned int com, char* msg){
|
||||
|
||||
Reference in New Issue
Block a user