diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-08-31 15:04:44 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-08-31 15:04:44 +0200 |
| commit | 3fa203061bdae80c75c5f08afa1a607b1c62c075 (patch) | |
| tree | 6bd278bc41d741531ce61438bca5d2b180c4ab64 /boot/disk_load_16.asm | |
| parent | cd7312578948b7aee6bba8e91fbbc84b06f2f586 (diff) | |
updated boot loader supports for LBA mode
Now booting from usb stick on my Acer Aspire works fine too :)
Diffstat (limited to 'boot/disk_load_16.asm')
| -rw-r--r-- | boot/disk_load_16.asm | 59 |
1 files changed, 58 insertions, 1 deletions
diff --git a/boot/disk_load_16.asm b/boot/disk_load_16.asm index 3d0951d..a96ad11 100644 --- a/boot/disk_load_16.asm +++ b/boot/disk_load_16.asm @@ -8,19 +8,76 @@ [bits 16] +DISK_LOAD_HANG_MSG: + db " D",0 ;disk_load routune (load dh sectors from drive dl to es:bx) disk_load: 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 + mov ah,0x41 + mov bx,0x55aa + int 0x13 + jnc disk_load_lba + popa mov ah,0x02 ;BIOS read sector func mov al,dh ;read dh sectors (amount) mov ch,0x00 ;cyl 0 mov dh,0x00 ;head 0 mov cl,0x02 ;start at sector 2 - +; int 0x13 ;bios interrupt +; jc disk_load_hang + + popa + ret + +disk_load_lba: + popa + + xor ah,ah + mov ah,0x42 + lea si,[lbaadr] + int 0x13 + jc skip_print + + mov bx, 0x1000 + call print_string + + skip_print: popa ret +lbaadr: +dw 0x10 +dw 52 +dw 0x1000 +dw 0 +dd 1 +dd 0 + +; +;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 + |
