Subversion Repositories Kolibri OS

Rev

Rev 129 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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.         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
  85.         mov   ecx, RAMDISK
  86.         mov   esi, 0
  87.         mov   edi, 12
  88.         call  file_read
  89.         ret
  90.  
  91. image_retrieved  db 0
  92. counter_of_partitions db 0
  93. no_sys_on_hd:
  94. yes_sys_on_hd:
  95.