2008-02-04 16:31:59 +01:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
|
|
|
;; Copyright (C) KolibriOS team 2008. All rights reserved. ;;
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
; Detect all BIOS hard drives.
|
|
|
|
; diamond, 2008
|
|
|
|
|
|
|
|
xor cx, cx
|
|
|
|
mov es, cx
|
2010-02-28 17:06:46 +01:00
|
|
|
inc cx
|
2008-02-04 16:31:59 +01:00
|
|
|
mov di, 0x9080
|
|
|
|
mov byte [es:di-1], cl
|
2010-02-28 17:06:46 +01:00
|
|
|
mov byte [es:di], 80h
|
|
|
|
inc di
|
2008-02-04 16:31:59 +01:00
|
|
|
cmp [preboot_biosdisk], 1
|
|
|
|
jnz bdde
|
2010-02-28 17:06:46 +01:00
|
|
|
mov dl, 81h
|
2008-02-04 16:31:59 +01:00
|
|
|
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
|
2009-10-23 19:35:26 +02:00
|
|
|
or ax,-1
|
|
|
|
; mov ax, -1
|
2008-02-04 16:31:59 +01:00
|
|
|
@@:
|
|
|
|
stosw
|
|
|
|
pop ds
|
|
|
|
jmp bddc2
|
|
|
|
bddl:
|
|
|
|
mov al, dl
|
|
|
|
stosb
|
2009-10-23 19:35:26 +02:00
|
|
|
xor ax,ax
|
|
|
|
stosb
|
|
|
|
dec ax
|
|
|
|
stosw
|
|
|
|
; mov al, 0
|
|
|
|
; stosb
|
|
|
|
; mov ax, -1
|
|
|
|
; stosw
|
2008-02-04 16:31:59 +01:00
|
|
|
bddc2:
|
|
|
|
cmp cl, [es:0x475]
|
|
|
|
jae bdde
|
|
|
|
bddc:
|
|
|
|
inc dl
|
|
|
|
jnz bdds
|
|
|
|
bdde:
|