Subversion Repositories Kolibri OS

Rev

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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;                                                              ;;
  3. ;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
  4. ;; Distributed under terms of the GNU General Public License    ;;
  5. ;;                                                              ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. $Revision: 593 $
  9.  
  10.  
  11. ;****************************************************
  12. ;     ïîèñê ëîãè÷åñêèõ äèñêîâ íà îáíàðóæåííûõ HDD
  13. ;     è çàíåñåíèå äàííûõ â îáëàñòü òàáëèöû
  14. ;     àâòîð Mario79
  15. ;****************************************************
  16.       mov   [transfer_adress],DRIVE_DATA+0xa
  17.  search_partitions_ide0:
  18.       test  [DRIVE_DATA+1],byte 0x40
  19.       jz   search_partitions_ide1
  20.         mov   [hdbase],0x1f0
  21.         mov   [hdid],0x0
  22.         mov   [hdpos],1
  23.       mov  [fat32part],1
  24.  search_partitions_ide0_1:
  25.       call  set_FAT32_variables
  26.       cmp   [problem_partition],0
  27.       jne   search_partitions_ide1
  28.       inc   byte [DRIVE_DATA+2]
  29.       call  partition_data_transfer
  30.       add   [transfer_adress],100
  31.       inc   [fat32part]
  32.       jmp   search_partitions_ide0_1
  33.  
  34.  search_partitions_ide1:
  35.       test  [DRIVE_DATA+1],byte 0x10
  36.       jz   search_partitions_ide2
  37.         mov   [hdbase],0x1f0
  38.         mov   [hdid],0x10
  39.         mov   [hdpos],2
  40.       mov  [fat32part],1
  41.  search_partitions_ide1_1:
  42.       call  set_FAT32_variables
  43.       cmp   [problem_partition],0
  44.       jne   search_partitions_ide2
  45.       inc   byte [DRIVE_DATA+3]
  46.       call  partition_data_transfer
  47.       add   [transfer_adress],100
  48.       inc   [fat32part]
  49.       jmp   search_partitions_ide1_1
  50.  
  51.  search_partitions_ide2:
  52.       test  [DRIVE_DATA+1],byte 0x4
  53.       jz   search_partitions_ide3
  54.         mov   [hdbase],0x170
  55.         mov   [hdid],0x0
  56.         mov   [hdpos],3
  57.       mov  [fat32part],1
  58.  search_partitions_ide2_1:
  59.       call  set_FAT32_variables
  60.       cmp   [problem_partition],0
  61.       jne   search_partitions_ide3
  62.       inc   byte [DRIVE_DATA+4]
  63.       call  partition_data_transfer
  64.       add   [transfer_adress],100
  65.       inc   [fat32part]
  66.       jmp   search_partitions_ide2_1
  67.  
  68.  search_partitions_ide3:
  69.       test  [DRIVE_DATA+1],byte 0x1
  70.       jz   end_search_partitions_ide
  71.         mov   [hdbase],0x170
  72.         mov   [hdid],0x10
  73.         mov   [hdpos],4
  74.       mov  [fat32part],1
  75.  search_partitions_ide3_1:
  76.       call  set_FAT32_variables
  77.       cmp   [problem_partition],0
  78.       jne   end_search_partitions_ide
  79.       inc   byte [DRIVE_DATA+5]
  80.       call  partition_data_transfer
  81.       add   [transfer_adress],100
  82.       inc   [fat32part]
  83.       jmp   search_partitions_ide3_1
  84.  
  85.  
  86. partition_data_transfer:
  87.      mov edi,[transfer_adress]
  88.      mov esi,PARTITION_START
  89.      mov ecx,(file_system_data_size+3)/4
  90.      rep movsd
  91.      ret
  92. uglobal
  93. transfer_adress dd 0
  94. endg
  95. partition_data_transfer_1:
  96. ;     cli
  97.      push edi
  98.      mov edi,PARTITION_START
  99.      mov esi,[transfer_adress]
  100.      mov ecx,(file_system_data_size+3)/4
  101.      rep movsd
  102.      pop  edi
  103. ;     sti
  104.      ret
  105.  
  106.  end_search_partitions_ide:
  107.  
  108. ;PARTITION_START      dd 0x3f
  109. ;PARTITION_END        dd 0
  110. ;SECTORS_PER_FAT      dd 0x1f3a
  111. ;NUMBER_OF_FATS       dd 0x2
  112. ;SECTORS_PER_CLUSTER  dd 0x8
  113. ;BYTES_PER_SECTOR     dd 0x200   ; Note: if BPS <> 512 need lots of changes
  114. ;ROOT_CLUSTER         dd 2       ; first rootdir cluster
  115. ;FAT_START            dd 0       ; start of fat table
  116. ;ROOT_START           dd 0       ; start of rootdir (only fat16)
  117. ;ROOT_SECTORS         dd 0       ; count of rootdir sectors (only fat16)
  118. ;DATA_START           dd 0       ; start of data area (=first cluster 2)
  119. ;LAST_CLUSTER         dd 0       ; last availabe cluster
  120. ;ADR_FSINFO           dd 0       ; used only by fat32
  121. ;
  122. ;fatRESERVED          dd 0x0FFFFFF6
  123. ;fatBAD               dd 0x0FFFFFF7
  124. ;fatEND               dd 0x0FFFFFF8
  125. ;fatMASK              dd 0x0FFFFFFF
  126. ;
  127. ;fat_type             db 0       ; 0=none, 16=fat16, 32=fat32
  128.  
  129.