summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-05-24 11:23:53 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-05-24 11:23:53 +0200
commit432abe67d09811486b3db2ac58bb324437aa69b9 (patch)
treeb3cbe23427d6403cfced593d853f9c1724abf209
parent85888c99f8d870fbb46b630a8cf1e652bf2a7c82 (diff)
downloadabaos-432abe67d09811486b3db2ac58bb324437aa69b9.tar.gz
abaos-432abe67d09811486b3db2ac58bb324437aa69b9.tar.bz2
managed to get it running on real hardware, there are
issues with A20 method keyboard (hangs), serial console (qemu doesn't really emulate all aspect of a serial, a real serial blocks on waiting most likely)
-rw-r--r--src/kernel.c10
-rw-r--r--src/stage2_a20.asm20
2 files changed, 23 insertions, 7 deletions
diff --git a/src/kernel.c b/src/kernel.c
index fa9761a..c943087 100644
--- a/src/kernel.c
+++ b/src/kernel.c
@@ -10,8 +10,8 @@
void entry( void )
{
- serial_t serial;
- serial_init( &serial );
+// serial_t serial;
+// serial_init( &serial );
vga_t vga;
vga_init( &vga );
@@ -21,7 +21,7 @@ void entry( void )
console_t console;
console_init( &console );
console_add_vga_output( &console, &vga );
- console_add_serial_output( &console, &serial );
+// console_add_serial_output( &console, &serial );
// initialize the early console of the kernel
stdio_set_console( &console );
@@ -45,7 +45,7 @@ void entry( void )
if( i % 1000 == 1 ) {
vga_put_char_at( &vga, x_pos, y_pos, '.' );
x_pos++;
- serial_put_char( &serial, '.' );
+// serial_put_char( &serial, '.' );
//~ int y = 0;
//~ int x = 12 / y;
//~ printf( "Hex number is 0x%X and string is '%s'\n", x, "abaos" );
@@ -56,7 +56,7 @@ void entry( void )
}
}
vga_put_char_at( &vga, x_pos, y_pos, '.' );
- serial_put_char( &serial, '.' );
+// serial_put_char( &serial, '.' );
console_put_newline( &console );
diff --git a/src/stage2_a20.asm b/src/stage2_a20.asm
index 630c67a..2110621 100644
--- a/src/stage2_a20.asm
+++ b/src/stage2_a20.asm
@@ -32,9 +32,13 @@ check_A20_enabled:
pop ax
mov byte [es:di], al
+ mov al, '0'
+ call print_char
mov ax, 0 ; wrapped around (last cmp)
je .exit
+ mov al, '1'
+ call print_char
mov ax, 1 ; not wrapped around
.exit:
@@ -43,16 +47,17 @@ check_A20_enabled:
pop es
pop ds
popf
-
+
ret
check_and_enable_A20:
call check_A20_enabled
cmp ax, 1
je A20_ENABLED
- ret
A20_ENABLE_VIA_BIOS:
+ mov al, 'X'
+ call print_char
mov ax, 0x2401
int 0x15
@@ -61,6 +66,8 @@ A20_ENABLE_VIA_BIOS:
je A20_ENABLED
A20_ENABLE_KBD_PORT:
+ mov al, 'X'
+ call print_char
mov al, 0xdd
out 0x64, al
@@ -68,8 +75,13 @@ A20_ENABLE_KBD_PORT:
cmp ax, 1
je A20_ENABLED
+ jmp A20_FAST_SPECIAL_PORT
+
A20_ENABLE_KBD_OUT:
+ mov al, 'X'
+ call print_char
+
cli
call .wait_input
@@ -122,6 +134,10 @@ A20_ENABLE_KBD_OUT:
je A20_ENABLED
A20_FAST_SPECIAL_PORT:
+
+ mov al, 'X'
+ call print_char
+
in al, 0x92
or al, 2
out 0x92, al