Rev 2382 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2540 | hidnplayr | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
3 | ;; Copyright (C) KolibriOS team 2008-2011. All rights reserved. ;; |
||
4 | ;; Distributed under terms of the GNU General Public License ;; |
||
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
709 | diamond | 7 | |
8 | ; Detect all BIOS hard drives. |
||
9 | ; diamond, 2008 |
||
10 | |||
11 | xor cx, cx |
||
12 | mov es, cx |
||
13 | mov di, 0x9080 |
||
14 | mov byte [es:di-1], cl |
||
15 | cmp [preboot_biosdisk], 1 |
||
16 | jnz bdde |
||
17 | mov dl, 80h |
||
18 | bdds: |
||
19 | mov ah, 15h |
||
20 | push cx dx di |
||
21 | int 13h |
||
22 | pop di dx cx |
||
23 | jc bddc |
||
24 | test ah, ah |
||
25 | jz bddc |
||
26 | inc cx |
||
27 | mov ah, 48h |
||
28 | push ds |
||
29 | push es |
||
30 | pop ds |
||
31 | mov si, 0xA000 |
||
32 | mov word [si], 1Eh |
||
33 | mov ah, 48h |
||
34 | int 13h |
||
35 | pop ds |
||
36 | jc bddc2 |
||
37 | inc byte [es:0x907F] |
||
38 | cmp word [es:si], 1Eh |
||
39 | jb bddl |
||
40 | cmp word [es:si+1Ah], 0xFFFF |
||
41 | jz bddl |
||
42 | mov al, dl |
||
43 | stosb |
||
44 | push ds |
||
45 | lds si, [es:si+1Ah] |
||
46 | mov al, [si+6] |
||
47 | and al, 0xF |
||
48 | stosb |
||
49 | mov al, byte [si+4] |
||
50 | shr al, 4 |
||
51 | and ax, 1 |
||
52 | cmp word [si], 1F0h |
||
53 | jz @f |
||
54 | inc ax |
||
55 | inc ax |
||
56 | cmp word [si], 170h |
||
57 | jz @f |
||
2382 | hidnplayr | 58 | or ax, -1 |
1229 | Lrz | 59 | ; mov ax, -1 |
709 | diamond | 60 | @@: |
61 | stosw |
||
62 | pop ds |
||
63 | jmp bddc2 |
||
64 | bddl: |
||
65 | mov al, dl |
||
66 | stosb |
||
2382 | hidnplayr | 67 | xor ax, ax |
68 | stosb |
||
69 | dec ax |
||
70 | stosw |
||
1229 | Lrz | 71 | ; mov al, 0 |
72 | ; stosb |
||
73 | ; mov ax, -1 |
||
74 | ; stosw |
||
709 | diamond | 75 | bddc2: |
76 | cmp cl, [es:0x475] |
||
77 | jae bdde |
||
78 | bddc: |
||
79 | inc dl |
||
80 | jnz bdds |
||
81 | bdde: |