2012-04-02 17:18:46 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
|
|
|
;; Copyright (C) KolibriOS team 2008-2011. All rights reserved. ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2009-09-17 13:55:38 +02:00
|
|
|
|
|
|
|
; Detect all BIOS hard drives.
|
|
|
|
; diamond, 2008
|
|
|
|
|
|
|
|
xor cx, cx
|
|
|
|
mov es, cx
|
|
|
|
mov di, 0x9080
|
|
|
|
mov byte [es:di-1], cl
|
|
|
|
cmp [preboot_biosdisk], 1
|
|
|
|
jnz bdde
|
|
|
|
mov dl, 80h
|
|
|
|
bdds:
|
|
|
|
mov ah, 15h
|
|
|
|
push cx dx di
|
|
|
|
int 13h
|
|
|
|
pop di dx cx
|
|
|
|
jc bddc
|
|
|
|
test ah, ah
|
|
|
|
jz bddc
|
|
|
|
inc cx
|
|
|
|
mov ah, 48h
|
|
|
|
push ds
|
|
|
|
push es
|
|
|
|
pop ds
|
|
|
|
mov si, 0xA000
|
|
|
|
mov word [si], 1Eh
|
|
|
|
mov ah, 48h
|
|
|
|
int 13h
|
|
|
|
pop ds
|
|
|
|
jc bddc2
|
|
|
|
inc byte [es:0x907F]
|
|
|
|
cmp word [es:si], 1Eh
|
|
|
|
jb bddl
|
|
|
|
cmp word [es:si+1Ah], 0xFFFF
|
|
|
|
jz bddl
|
|
|
|
mov al, dl
|
|
|
|
stosb
|
|
|
|
push ds
|
|
|
|
lds si, [es:si+1Ah]
|
|
|
|
mov al, [si+6]
|
|
|
|
and al, 0xF
|
|
|
|
stosb
|
|
|
|
mov al, byte [si+4]
|
|
|
|
shr al, 4
|
|
|
|
and ax, 1
|
|
|
|
cmp word [si], 1F0h
|
|
|
|
jz @f
|
|
|
|
inc ax
|
|
|
|
inc ax
|
|
|
|
cmp word [si], 170h
|
|
|
|
jz @f
|
2012-02-22 17:06:05 +01:00
|
|
|
or ax, -1
|
2010-01-15 12:54:11 +01:00
|
|
|
; mov ax, -1
|
2009-09-17 13:55:38 +02:00
|
|
|
@@:
|
|
|
|
stosw
|
|
|
|
pop ds
|
|
|
|
jmp bddc2
|
|
|
|
bddl:
|
|
|
|
mov al, dl
|
|
|
|
stosb
|
2012-02-22 17:06:05 +01:00
|
|
|
xor ax, ax
|
|
|
|
stosb
|
|
|
|
dec ax
|
|
|
|
stosw
|
2010-01-15 12:54:11 +01:00
|
|
|
; mov al, 0
|
|
|
|
; stosb
|
|
|
|
; mov ax, -1
|
|
|
|
; stosw
|
2009-09-17 13:55:38 +02:00
|
|
|
bddc2:
|
|
|
|
cmp cl, [es:0x475]
|
|
|
|
jae bdde
|
|
|
|
bddc:
|
|
|
|
inc dl
|
|
|
|
jnz bdds
|
|
|
|
bdde:
|