Rev 1229 | Rev 2288 | Go to most recent revision | 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 |
||
1424 | diamond | 13 | inc cx |
709 | diamond | 14 | mov di, 0x9080 |
15 | mov byte [es:di-1], cl |
||
1424 | diamond | 16 | mov byte [es:di], 80h |
17 | inc di |
||
709 | diamond | 18 | cmp [preboot_biosdisk], 1 |
19 | jnz bdde |
||
1424 | diamond | 20 | mov dl, 81h |
709 | diamond | 21 | bdds: |
22 | mov ah, 15h |
||
23 | push cx dx di |
||
24 | int 13h |
||
25 | pop di dx cx |
||
26 | jc bddc |
||
27 | test ah, ah |
||
28 | jz bddc |
||
29 | inc cx |
||
30 | mov ah, 48h |
||
31 | push ds |
||
32 | push es |
||
33 | pop ds |
||
34 | mov si, 0xA000 |
||
35 | mov word [si], 1Eh |
||
36 | mov ah, 48h |
||
37 | int 13h |
||
38 | pop ds |
||
39 | jc bddc2 |
||
40 | inc byte [es:0x907F] |
||
41 | cmp word [es:si], 1Eh |
||
42 | jb bddl |
||
43 | cmp word [es:si+1Ah], 0xFFFF |
||
44 | jz bddl |
||
45 | mov al, dl |
||
46 | stosb |
||
47 | push ds |
||
48 | lds si, [es:si+1Ah] |
||
49 | mov al, [si+6] |
||
50 | and al, 0xF |
||
51 | stosb |
||
52 | mov al, byte [si+4] |
||
53 | shr al, 4 |
||
54 | and ax, 1 |
||
55 | cmp word [si], 1F0h |
||
56 | jz @f |
||
57 | inc ax |
||
58 | inc ax |
||
59 | cmp word [si], 170h |
||
60 | jz @f |
||
1229 | Lrz | 61 | or ax,-1 |
62 | ; mov ax, -1 |
||
709 | diamond | 63 | @@: |
64 | stosw |
||
65 | pop ds |
||
66 | jmp bddc2 |
||
67 | bddl: |
||
68 | mov al, dl |
||
69 | stosb |
||
1229 | Lrz | 70 | xor ax,ax |
71 | stosb |
||
72 | dec ax |
||
73 | stosw |
||
74 | ; mov al, 0 |
||
75 | ; stosb |
||
76 | ; mov ax, -1 |
||
77 | ; stosw |
||
709 | diamond | 78 | bddc2: |
79 | cmp cl, [es:0x475] |
||
80 | jae bdde |
||
81 | bddc: |
||
82 | inc dl |
||
83 | jnz bdds |
||
84 | bdde: |