diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-08-31 16:50:46 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-08-31 16:50:46 +0200 |
| commit | 594279ba194f5327ac120a09360065717709d468 (patch) | |
| tree | efbf2cd61c1f88e6d49c63710e748f973d691f83 /boot | |
| parent | 07795ca0c0719fe94fc06c43671e51c1cf60023d (diff) | |
improved comments and label for disk_load_16
Diffstat (limited to 'boot')
| -rw-r--r-- | boot/disk_load_16.asm | 49 | ||||
| -rw-r--r-- | boot/mbr.asm | 4 |
2 files changed, 20 insertions, 33 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 ; diff --git a/boot/mbr.asm b/boot/mbr.asm index 9076915..45cfd85 100644 --- a/boot/mbr.asm +++ b/boot/mbr.asm @@ -106,9 +106,9 @@ boot_16: ; ; ;Load the KERNEL (52 sectors starting at sector 2) mov bx,KERNEL_OFFSET - mov dh, 52 + mov dh, 52 ; for lba mode this is hardcoded anyway mov dl, [BOOT_DRIVE] - call disk_load + call disk_load_16 ; ; ;get memory map from bios before we enter 32 bit protected mode |
