Rev 412 | Rev 431 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 412 | Rev 425 | ||
---|---|---|---|
- | 1 | $Revision: 425 $ |
|
1 | ; READ RAMDISK IMAGE FROM HD |
2 | ; READ RAMDISK IMAGE FROM HD |
2 | 3 | ||
3 | cmp [boot_dev],1 |
4 | cmp [boot_dev],1 |
4 | jne no_sys_on_hd |
5 | jne no_sys_on_hd |
5 | 6 | ||
6 | test [DRIVE_DATA+1],byte 0x40 |
7 | test [DRIVE_DATA+1],byte 0x40 |
7 | jz position_2 |
8 | jz position_2 |
8 | mov [hdbase],0x1f0 |
9 | mov [hdbase],0x1f0 |
9 | mov [hdid],0x0 |
10 | mov [hdid],0x0 |
10 | mov [hdpos],1 |
11 | mov [hdpos],1 |
11 | mov [fat32part],0 |
12 | mov [fat32part],0 |
12 | position_1_1: |
13 | position_1_1: |
13 | inc [fat32part] |
14 | inc [fat32part] |
14 | call search_and_read_image |
15 | call search_and_read_image |
15 | cmp [image_retrieved],1 |
16 | cmp [image_retrieved],1 |
16 | je yes_sys_on_hd |
17 | je yes_sys_on_hd |
17 | movzx eax,byte [DRIVE_DATA+2] |
18 | movzx eax,byte [DRIVE_DATA+2] |
18 | cmp [fat32part],eax |
19 | cmp [fat32part],eax |
19 | jle position_1_1 |
20 | jle position_1_1 |
20 | position_2: |
21 | position_2: |
21 | test [DRIVE_DATA+1],byte 0x10 |
22 | test [DRIVE_DATA+1],byte 0x10 |
22 | jz position_3 |
23 | jz position_3 |
23 | mov [hdbase],0x1f0 |
24 | mov [hdbase],0x1f0 |
24 | mov [hdid],0x10 |
25 | mov [hdid],0x10 |
25 | mov [hdpos],2 |
26 | mov [hdpos],2 |
26 | mov [fat32part],0 |
27 | mov [fat32part],0 |
27 | position_2_1: |
28 | position_2_1: |
28 | inc [fat32part] |
29 | inc [fat32part] |
29 | call search_and_read_image |
30 | call search_and_read_image |
30 | cmp [image_retrieved],1 |
31 | cmp [image_retrieved],1 |
31 | je yes_sys_on_hd |
32 | je yes_sys_on_hd |
32 | movzx eax,byte [DRIVE_DATA+3] |
33 | movzx eax,byte [DRIVE_DATA+3] |
33 | cmp eax,[fat32part] |
34 | cmp eax,[fat32part] |
34 | jle position_2_1 |
35 | jle position_2_1 |
35 | position_3: |
36 | position_3: |
36 | test [DRIVE_DATA+1],byte 0x4 |
37 | test [DRIVE_DATA+1],byte 0x4 |
37 | jz position_4 |
38 | jz position_4 |
38 | mov [hdbase],0x170 |
39 | mov [hdbase],0x170 |
39 | mov [hdid],0x0 |
40 | mov [hdid],0x0 |
40 | mov [hdpos],3 |
41 | mov [hdpos],3 |
41 | mov [fat32part],0 |
42 | mov [fat32part],0 |
42 | position_3_1: |
43 | position_3_1: |
43 | inc [fat32part] |
44 | inc [fat32part] |
44 | call search_and_read_image |
45 | call search_and_read_image |
45 | cmp [image_retrieved],1 |
46 | cmp [image_retrieved],1 |
46 | je yes_sys_on_hd |
47 | je yes_sys_on_hd |
47 | movzx eax,byte [DRIVE_DATA+4] |
48 | movzx eax,byte [DRIVE_DATA+4] |
48 | cmp eax,[fat32part] |
49 | cmp eax,[fat32part] |
49 | jle position_3_1 |
50 | jle position_3_1 |
50 | position_4: |
51 | position_4: |
51 | test [DRIVE_DATA+1],byte 0x1 |
52 | test [DRIVE_DATA+1],byte 0x1 |
52 | jz no_sys_on_hd |
53 | jz no_sys_on_hd |
53 | mov [hdbase],0x170 |
54 | mov [hdbase],0x170 |
54 | mov [hdid],0x10 |
55 | mov [hdid],0x10 |
55 | mov [hdpos],4 |
56 | mov [hdpos],4 |
56 | mov [fat32part],0 |
57 | mov [fat32part],0 |
57 | position_4_1: |
58 | position_4_1: |
58 | inc [fat32part] |
59 | inc [fat32part] |
59 | call search_and_read_image |
60 | call search_and_read_image |
60 | cmp [image_retrieved],1 |
61 | cmp [image_retrieved],1 |
61 | je yes_sys_on_hd |
62 | je yes_sys_on_hd |
62 | movzx eax,byte [DRIVE_DATA+5] |
63 | movzx eax,byte [DRIVE_DATA+5] |
63 | cmp eax,[fat32part] |
64 | cmp eax,[fat32part] |
64 | jle position_4_1 |
65 | jle position_4_1 |
65 | jmp yes_sys_on_hd |
66 | jmp yes_sys_on_hd |
66 | 67 | ||
67 | search_and_read_image: |
68 | search_and_read_image: |
68 | call set_FAT32_variables |
69 | call set_FAT32_variables |
69 | mov edx, bootpath |
70 | mov edx, bootpath |
70 | call read_image |
71 | call read_image |
71 | test eax, eax |
72 | test eax, eax |
72 | jz image_present |
73 | jz image_present |
73 | mov edx, bootpath2 |
74 | mov edx, bootpath2 |
74 | call read_image |
75 | call read_image |
75 | test eax, eax |
76 | test eax, eax |
76 | jz image_present |
77 | jz image_present |
77 | ret |
78 | ret |
78 | image_present: |
79 | image_present: |
79 | mov [image_retrieved],1 |
80 | mov [image_retrieved],1 |
80 | ret |
81 | ret |
81 | 82 | ||
82 | read_image: |
83 | read_image: |
83 | mov eax, hdsysimage |
84 | mov eax, hdsysimage |
84 | mov ebx, 1474560/512 |
85 | mov ebx, 1474560/512 |
85 | mov ecx, RAMDISK |
86 | mov ecx, RAMDISK |
86 | mov esi, 0 |
87 | mov esi, 0 |
87 | mov edi, 12 |
88 | mov edi, 12 |
88 | call file_read |
89 | call file_read |
89 | ret |
90 | ret |
90 | 91 | ||
91 | image_retrieved db 0 |
92 | image_retrieved db 0 |
92 | counter_of_partitions db 0 |
93 | counter_of_partitions db 0 |
93 | no_sys_on_hd: |
94 | no_sys_on_hd: |
94 | yes_sys_on_hd: |
95 | yes_sys_on_hd: |