From aa85f2aaf27d79af277867fc7ca4168f1bb117c0 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Mon, 5 Jun 2017 19:32:00 +0200 Subject: some cleanup in boot loader code and changed order of A20 gate methods --- src/boot.asm | 5 +---- src/stage2_a20.asm | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/boot.asm b/src/boot.asm index ac3dad7..8dbbb8a 100644 --- a/src/boot.asm +++ b/src/boot.asm @@ -75,10 +75,7 @@ times 510-($-$$) db 0 dw 0xaa55 stage2: - nop - nop - nop - + ; print a message that we are indeed in stage 2 now mov si, MESSAGE_STAGE_2_LOADED call print_string diff --git a/src/stage2_a20.asm b/src/stage2_a20.asm index 50f82a6..c0951ad 100644 --- a/src/stage2_a20.asm +++ b/src/stage2_a20.asm @@ -62,16 +62,6 @@ check_and_enable_A20: cmp ax, 1 je A20_ENABLED -A20_ENABLE_VIA_BIOS: - mov al, 'B' - call print_char - mov ax, 0x2401 - int 0x15 - - call check_A20_enabled - cmp ax, 1 - je A20_ENABLED - A20_ENABLE_KBD_PORT: mov al, 'K' call print_char @@ -152,6 +142,16 @@ A20_FAST_SPECIAL_PORT: cmp ax, 1 je A20_ENABLED ret + +A20_ENABLE_VIA_BIOS: + mov al, 'B' + call print_char + mov ax, 0x2401 + int 0x15 + + call check_A20_enabled + cmp ax, 1 + je A20_ENABLED A20_ENABLED: ret -- cgit v1.2.3-54-g00ecf