Subversion Repositories Kolibri OS

Rev

Rev 412 | Rev 431 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. $Revision: 425 $
  2. ; READ RAMDISK IMAGE FROM HD
  3.  
  4.         cmp   [boot_dev],1
  5.         jne   no_sys_on_hd
  6.  
  7.         test  [DRIVE_DATA+1],byte 0x40
  8.         jz    position_2
  9.         mov   [hdbase],0x1f0
  10.         mov   [hdid],0x0
  11.         mov   [hdpos],1
  12.         mov   [fat32part],0
  13.   position_1_1:
  14.         inc   [fat32part]
  15.         call  search_and_read_image
  16.         cmp   [image_retrieved],1
  17.         je    yes_sys_on_hd
  18.         movzx eax,byte [DRIVE_DATA+2]
  19.         cmp   [fat32part],eax
  20.         jle     position_1_1
  21.   position_2:
  22.         test  [DRIVE_DATA+1],byte 0x10
  23.         jz    position_3
  24.         mov   [hdbase],0x1f0
  25.         mov   [hdid],0x10
  26.         mov   [hdpos],2
  27.         mov   [fat32part],0
  28.   position_2_1:
  29.         inc   [fat32part]
  30.         call  search_and_read_image
  31.         cmp   [image_retrieved],1
  32.         je    yes_sys_on_hd
  33.         movzx eax,byte [DRIVE_DATA+3]
  34.         cmp   eax,[fat32part]
  35.         jle     position_2_1
  36.   position_3:
  37.         test  [DRIVE_DATA+1],byte 0x4
  38.         jz    position_4
  39.         mov   [hdbase],0x170
  40.         mov   [hdid],0x0
  41.         mov   [hdpos],3
  42.         mov   [fat32part],0
  43.   position_3_1:
  44.         inc   [fat32part]
  45.         call  search_and_read_image
  46.         cmp   [image_retrieved],1
  47.         je    yes_sys_on_hd
  48.         movzx eax,byte [DRIVE_DATA+4]
  49.         cmp   eax,[fat32part]
  50.         jle     position_3_1
  51.   position_4:
  52.         test  [DRIVE_DATA+1],byte 0x1
  53.         jz    no_sys_on_hd
  54.         mov   [hdbase],0x170
  55.         mov   [hdid],0x10
  56.         mov   [hdpos],4
  57.         mov   [fat32part],0
  58.   position_4_1:
  59.         inc   [fat32part]
  60.         call  search_and_read_image
  61.         cmp   [image_retrieved],1
  62.         je    yes_sys_on_hd
  63.         movzx eax,byte [DRIVE_DATA+5]
  64.         cmp   eax,[fat32part]
  65.         jle     position_4_1
  66.         jmp   yes_sys_on_hd
  67.  
  68.   search_and_read_image:
  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, RAMDISK
  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:
  96.