summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/disk_load_16.asm41
-rw-r--r--boot/stage2.asm4
2 files changed, 37 insertions, 8 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm
index ae34360..52912f4 100644
--- a/boot/disk_load_16.asm
+++ b/boot/disk_load_16.asm
@@ -108,13 +108,42 @@ disk_load_chs:
pusha
+ ; get boot drive geometry
+ mov ah,8
+ mov dl,[BOOT_DRIVE]
+ int 0x13
+
+ add dh,1
+ and cl,0x3f
+
+ mov [bpbSectorsPerTrack],cl
+ mov [bpbHeadsPerCylinder],dh
+ ;
+
+ ;show geometry
+ mov al,dh
+ call print_hex_byte
+
+ mov bx, STR_SPACE
+ call print_string
+
+ mov al,cl
+ call print_hex_byte
+
+ call print_nextline
+ popa
+ ;
+
+ pusha
+
+
mov bx,0x1800 ;target es:bx
mov es,bx
mov bx,0
next_sectors_chs:
- jmp skip_debug
+ ;jmp skip_debug
pusha
mov bx, STR_SPACE
@@ -132,7 +161,7 @@ disk_load_chs:
mov bx, STR_SPACE
call print_string
- ;load and show next LBA numer
+ ;show next LBA numer
mov ax,[LBA]
mov al,ah
call print_hex_byte
@@ -171,7 +200,7 @@ disk_load_chs:
call lba_to_chs
; and now READ it!
- mov al,16 ;number of sectors to read
+ mov al,1 ;number of sectors to read
mov dl,[BOOT_DRIVE]
mov ah,0x02 ;BIOS read sector func
@@ -180,15 +209,15 @@ disk_load_chs:
jc disk_read_error
mov bx,es
- add bx,0x0200
- cmp bx,0x9e00
+ add bx,0x0020
+ cmp bx,0x9000
je disk_load_finish
mov es,bx
mov bx,0
mov ax,[LBA]
- add ax,16
+ add ax,1
mov [LBA],ax
jmp next_sectors_chs
diff --git a/boot/stage2.asm b/boot/stage2.asm
index 9a1c74c..517e481 100644
--- a/boot/stage2.asm
+++ b/boot/stage2.asm
@@ -39,8 +39,8 @@
;
MEMMAP_SIZE_OFFSET equ 0x7c00
MEMMAP_OFFSET equ 0x7c01
-VESA_MODES equ 0x8300 ; do NOT overwrite yourself! be careful!
-VESA_MODE_INFO equ 0x8400
+VESA_MODES equ 0x9300 ; do NOT overwrite yourself! be careful!
+VESA_MODE_INFO equ 0x9400
VESA_MODE_SELECT equ 0x4114
;