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