Subversion Repositories Kolibri OS

Rev

Rev 381 | Rev 425 | Go to most recent revision | Details | Compare with Previous | 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
 
412 serge 6
        test  [DRIVE_DATA+1],byte 0x40
1 ha 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
412 serge 17
        movzx eax,byte [DRIVE_DATA+2]
1 ha 18
        cmp   [fat32part],eax
19
        jle     position_1_1
20
  position_2:
412 serge 21
        test  [DRIVE_DATA+1],byte 0x10
1 ha 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
412 serge 32
        movzx eax,byte [DRIVE_DATA+3]
1 ha 33
        cmp   eax,[fat32part]
34
        jle     position_2_1
35
  position_3:
412 serge 36
        test  [DRIVE_DATA+1],byte 0x4
1 ha 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
412 serge 47
        movzx eax,byte [DRIVE_DATA+4]
1 ha 48
        cmp   eax,[fat32part]
49
        jle     position_3_1
50
  position_4:
412 serge 51
        test  [DRIVE_DATA+1],byte 0x1
1 ha 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
412 serge 62
        movzx eax,byte [DRIVE_DATA+5]
1 ha 63
        cmp   eax,[fat32part]
64
        jle     position_4_1
65
        jmp   yes_sys_on_hd
66
 
67
  search_and_read_image:
68
        call  set_FAT32_variables
69
        mov   edx, bootpath
70
        call  read_image
71
        test  eax, eax
72
        jz   image_present
73
        mov   edx, bootpath2
74
        call  read_image
75
        test  eax, eax
76
        jz   image_present
77
        ret
78
    image_present:
79
        mov   [image_retrieved],1
80
        ret
81
 
82
read_image:
83
        mov   eax, hdsysimage
84
        mov   ebx, 1474560/512
381 serge 85
        mov   ecx, RAMDISK
1 ha 86
        mov   esi, 0
87
        mov   edi, 12
88
        call  file_read
381 serge 89
        ret
1 ha 90
 
381 serge 91
image_retrieved  db 0
1 ha 92
counter_of_partitions db 0
93
no_sys_on_hd:
94
yes_sys_on_hd: