summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/disk_load_16.asm8
-rw-r--r--boot/mbr.asm27
-rw-r--r--boot/pm.asm1
-rw-r--r--boot/vesa_setup_16.asm7
4 files changed, 27 insertions, 16 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm
index 4222dd9..e45b89a 100644
--- a/boot/disk_load_16.asm
+++ b/boot/disk_load_16.asm
@@ -7,8 +7,8 @@
[bits 16]
-DISK_LOAD_HANG_MSG:
- db " D",0
+DISK_LOAD:
+ db "D",0
;disk_load routune (load dh sectors from drive dl to es:bx)
;lba mode has 52 sectors hardcoded!
@@ -48,10 +48,8 @@ disk_load_lba:
lea si,[lba_adr]
int 0x13
jc skip_print
-
- mov bx, 0x1000
+ mov bx, DISK_LOAD
call print_string
-
skip_print:
popa
diff --git a/boot/mbr.asm b/boot/mbr.asm
index 4ece914..ca851c3 100644
--- a/boot/mbr.asm
+++ b/boot/mbr.asm
@@ -61,7 +61,7 @@ jmp $ ;entry for other processors ;)
BOOT_DRIVE:
db 0xff
STR_VERSION:
- db "v0.4",0
+ db "v0.5",0
VESA_CHECK1:
db "1",0
VESA_CHECK2:
@@ -145,17 +145,30 @@ boot_32_pm:
; ;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
-; ;mov al, 0xdf ; command 0xdf: disable a20
- out 0x64, al ; send command to controller
+; ; does not work in virtual box (with VT-x accerleration?)
- mov eax,0
-;
+; mov al, 0xdd ; command 0xdd: enable a20
+; mov al, 0xdf ; command 0xdf: disable a20
+; out 0x64, al ; send command to controller
+
+ ;Fast A20 Gate:
+ ;http://wiki.osdev.org/A20_Line
+
+ in al, 0x92
+ or al, 2
+ out 0x92, al
+
+ ; call kernel!
+ mov eax,0 ;booting processor
call KERNEL_OFFSET ;jump into our Kernel!
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
+
+;fill partition table (4x16byte) with zeroes.
+;(otherwise my Acer Aspire will not boot)
+times 64 db 0x0
+
;so we get identified as MBR
times 510-($-$$) db 0x0
;dw 0x0
diff --git a/boot/pm.asm b/boot/pm.asm
index 8a4f745..73bb9d3 100644
--- a/boot/pm.asm
+++ b/boot/pm.asm
@@ -11,6 +11,7 @@ switch_to_pm:
cli ;switch off interrupts!
lgdt [gdt_descriptor] ;load descriptor table!
+ lldt [gdt_descriptor] ;load descriptor table! (local)
;switch on 32-bit protected mode
mov eax, cr0
diff --git a/boot/vesa_setup_16.asm b/boot/vesa_setup_16.asm
index 7180252..96e16e2 100644
--- a/boot/vesa_setup_16.asm
+++ b/boot/vesa_setup_16.asm
@@ -33,16 +33,15 @@ VesaSetup:
jmp vesa_err2
vesa_ok2:
-
;VESA: finally switch to the mode of choice!
mov ax,0x4f02 ;vesa function: Set Mode
mov bx,VESA_MODE_SELECT
int 0x10
- vesa_err3:
- mov bx, VESA_CHECK3
- call print_string
cmp ax,0x004f
je vesa_ok3
+ vesa_err3
+ mov bx, VESA_CHECK3
+ call print_string
jmp vesa_err3
vesa_ok3:
popa