Subversion Repositories Kolibri OS

Rev

Rev 2 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 ha 1
; READ RAMDISK IMAGE FROM HD
2
 
3
        cmp   [boot_dev],1
4
        jne   no_sys_on_hd
5
 
6
        test  [0x40001],byte 0x40
7
        jz    position_2
8
        mov   [hdbase],0x1f0
9
        mov   [hdid],0x0
10
        mov   [hdpos],1
11
        mov   [fat32part],0
12
  position_1_1:
13
        inc   [fat32part]
14
        call  search_and_read_image
15
        cmp   [image_retrieved],1
16
        je    yes_sys_on_hd
17
        movzx eax,byte [0x40002]
18
        cmp   [fat32part],eax
19
        jle     position_1_1
20
  position_2:
21
        test  [0x40001],byte 0x10
22
        jz    position_3
23
        mov   [hdbase],0x1f0
24
        mov   [hdid],0x10
25
        mov   [hdpos],2
26
        mov   [fat32part],0
27
  position_2_1:
28
        inc   [fat32part]
29
        call  search_and_read_image
30
        cmp   [image_retrieved],1
31
        je    yes_sys_on_hd
32
        movzx eax,byte [0x40003]
33
        cmp   eax,[fat32part]
34
        jle     position_2_1
35
  position_3:
36
        test  [0x40001],byte 0x4
37
        jz    position_4
38
        mov   [hdbase],0x170
39
        mov   [hdid],0x0
40
        mov   [hdpos],3
41
        mov   [fat32part],0
42
  position_3_1:
43
        inc   [fat32part]
44
        call  search_and_read_image
45
        cmp   [image_retrieved],1
46
        je    yes_sys_on_hd
47
        movzx eax,byte [0x40004]
48
        cmp   eax,[fat32part]
49
        jle     position_3_1
50
  position_4:
51
        test  [0x40001],byte 0x1
52
        jz    no_sys_on_hd
53
        mov   [hdbase],0x170
54
        mov   [hdid],0x10
55
        mov   [hdpos],4
56
        mov   [fat32part],0
57
  position_4_1:
58
        inc   [fat32part]
59
        call  search_and_read_image
60
        cmp   [image_retrieved],1
61
        je    yes_sys_on_hd
62
        movzx eax,byte [0x40005]
63
        cmp   eax,[fat32part]
64
        jle     position_4_1
65
        jmp   yes_sys_on_hd
66
 
67
  search_and_read_image:
68
;        mov   [0xfe10],dword 0    ; entries in hd cache
69
        call  set_FAT32_variables
70
        mov   edx, bootpath
71
        call  read_image
72
        test  eax, eax
73
        jz   image_present
74
        mov   edx, bootpath2
75
        call  read_image
76
        test  eax, eax
77
        jz   image_present
78
        ret
79
    image_present:
80
        mov   [image_retrieved],1
81
        ret
82
 
83
read_image:
84
        mov   eax, hdsysimage
85
        mov   ebx, 1474560/512
86
        mov   ecx, 0x100000
87
        mov   esi, 0
88
        mov   edi, 12
89
        call  file_read
90
        ret
91
 
92
image_retrieved  db 0
93
counter_of_partitions db 0
94
no_sys_on_hd:
95
yes_sys_on_hd: