summaryrefslogtreecommitdiff
path: root/boot/mbr.asm
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-08-29 15:20:17 +0200
committerMichal Idziorek <m.i@gmx.at>2014-08-29 15:20:17 +0200
commit659f1f1ae057c82a154a1fd32cc9dca040979daa (patch)
tree41afd3afb1b3e29ea6bf8445e1a7b284e7043368 /boot/mbr.asm
parent1cb4a8a202023958589d563ad132d701e27c008a (diff)
experimenting with a20 gate
Diffstat (limited to 'boot/mbr.asm')
-rw-r--r--boot/mbr.asm28
1 files changed, 21 insertions, 7 deletions
diff --git a/boot/mbr.asm b/boot/mbr.asm
index 26d13bf..4dd82d1 100644
--- a/boot/mbr.asm
+++ b/boot/mbr.asm
@@ -56,20 +56,23 @@ jmp boot_16 ;start boot process
BOOT_DRIVE:
db 0xff
STR_VERSION:
- db "Fool Boot Loader v0.3.1~",0
+ db "v0.3.1~",0
VESA_CHECK1:
- db " VESA: Get Info.",0
+ db " V1.",0
VESA_CHECK2:
- db " VESA: Get Mode Info.",0
+ db " V2",0
VESA_CHECK3:
- db " VESA: Set Mode.",0
+ db " V2",0
+CHECK_A20:
+ db " A20",0
;lets put our temporary GDT (Global Descriptor Table) here
;kernel should move this away
%include "boot/GDT.asm"
-;include 16-bit real mode routines (print_string, disk_load, vesa_setup)
+;include 16-bit real mode routines (print_string, disk_load, vesa_setup,check_a20)
%include "boot/disk_load_16.asm"
+%include "boot/check_a20_16.asm"
%include "boot/print_string_16.asm"
%include "boot/vesa_setup_16.asm"
@@ -112,6 +115,15 @@ boot_16:
call BiosGetMemoryMap ; this will also put the number of entries
; of the memory map at MEMMAP_SIZE_OFFSET
+a20check:
+
+ mov bx, STR_VERSION
+ call print_string
+
+ call check_a20
+ cmp ax,0
+ je a20check ;hang if a20 is disabled!
+
;VESA: also setup vesa stuff before entering 32 bit protected mode
call VesaSetup
@@ -127,9 +139,11 @@ boot_32_pm:
;enable A20
;http://www.brokenthorn.com/Resources/OSDev9.html
;Method 3.1: Enables A20 through keyboard controller
+ ;Not all keyboard controllers support this
;todo: check if this has any effect at all !?!?
- mov al, 0xdd ; command 0xdd: enable a20
- out 0x64, al ; send command to controller
+ ;mov al, 0xdd ; command 0xdd: enable a20
+ ;mov al, 0xdf ; command 0xdf: disable a20
+ ;out 0x64, al ; send command to controller
;pic setup
call pic_setup