summaryrefslogtreecommitdiff
path: root/boot/disk_load_16.asm
diff options
context:
space:
mode:
Diffstat (limited to 'boot/disk_load_16.asm')
-rw-r--r--boot/disk_load_16.asm49
1 files changed, 18 insertions, 31 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm
index a96ad11..4222dd9 100644
--- a/boot/disk_load_16.asm
+++ b/boot/disk_load_16.asm
@@ -2,31 +2,20 @@
;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
-;disk_load
+;disk_load_16
;
[bits 16]
-
DISK_LOAD_HANG_MSG:
db " D",0
+
;disk_load routune (load dh sectors from drive dl to es:bx)
-disk_load:
+;lba mode has 52 sectors hardcoded!
+disk_load_16:
pusha
-; mov ah,0x41
-; mov bx,0x55AA
-; ;mov dl,[disk]
-; int 0x13
-; jne disk_load_hang
-
-
- ;mov ah,0x42
- ; llea si,[lbaadr]
- ; int 0x13
-; cmp ah,0x00 ; check for error
-; jne disk_load_hang
; check if LBA is supported
pusha
@@ -36,6 +25,7 @@ disk_load:
jnc disk_load_lba
popa
+ ; load using CHS
mov ah,0x02 ;BIOS read sector func
mov al,dh ;read dh sectors (amount)
mov ch,0x00 ;cyl 0
@@ -43,17 +33,19 @@ disk_load:
mov cl,0x02 ;start at sector 2
;
int 0x13 ;bios interrupt
-; jc disk_load_hang
popa
ret
+
+ ; load using LBA
disk_load_lba:
+
popa
xor ah,ah
mov ah,0x42
- lea si,[lbaadr]
+ lea si,[lba_adr]
int 0x13
jc skip_print
@@ -65,19 +57,14 @@ disk_load_lba:
popa
ret
-lbaadr:
-dw 0x10
-dw 52
-dw 0x1000
-dw 0
-dd 1
-dd 0
+lba_adr:
-;
-;lbaadr:
-; dw 0x0010 ; 2byte, reserved - size of packet.
-; dw 0x0010 ; WORD 2bytes nr of blocks read.
-; dd 0x00001000 ; DWORD 4bytes Transfer buffer
-; ; dq 0x0000000034009605 ; QWORD 4bytes,32bit LBA address
-; dq 0x0000000000000000
+ dw 0x10 ; size of packet ( 16 byte)
+
+ dw 52 ; number of sectors to read
+
+ dw 0x1000 ; target addr.
+ dw 0 ;
+ dd 1 ; first sector to read
+ dd 0 ;