Subversion Repositories Kolibri OS

Rev

Rev 431 | Rev 766 | 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. ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
  5. ;; Distributed under terms of the GNU General Public License    ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8. $Revision: 593 $
  9.  
  10.  
  11. iglobal
  12.   ;function pointers.
  13.   fdc_irq_func    dd fdc_null
  14. endg
  15.  
  16. uglobal
  17.   dmasize         db 0x0
  18.   dmamode         db 0x0
  19. endg
  20.  
  21. fdc_init:                               ;start with clean tracks.
  22.         mov edi,OS_BASE+0xD201
  23.         mov al,0
  24.         mov ecx,160
  25.         rep stosb
  26. ret
  27.  
  28. fdc_filesave:                   ;ebx: cluster to be saved.
  29.         pusha                   ;returns immediately. does not trigger a write.
  30.         mov eax,ebx
  31.         add eax,31
  32.         mov bl,18
  33.         div bl
  34.         mov ah,0
  35.         add eax,OS_BASE+0xD201
  36.         mov [eax],byte 1                ;This track is now dirty.
  37.         popa
  38. ret
  39.  
  40. fdc_irq:
  41.         call [fdc_irq_func]
  42. fdc_null:
  43. ret
  44.  
  45. save_image:
  46.     call   reserve_flp
  47.     call   restorefatchain
  48.     pusha
  49.     call   check_label
  50.     cmp    [FDC_Status],0
  51.     jne    unnecessary_save_image
  52.     mov    [FDD_Track],0      ; Öèëèíäð
  53.     mov    [FDD_Head],0      ; Ñòîðîíà
  54.     mov    [FDD_Sector],1      ; Ñåêòîð
  55.     mov    esi,RAMDISK
  56.     call   SeekTrack
  57. save_image_1:
  58.     push   esi
  59.     call   take_data_from_application_1
  60.     pop    esi
  61.     add    esi,512
  62.     call   WriteSectWithRetr
  63. ;    call   WriteSector
  64.     cmp    [FDC_Status],0
  65.     jne    unnecessary_save_image
  66.     inc    [FDD_Sector]
  67.     cmp    [FDD_Sector],19
  68.     jne    save_image_1
  69.     mov    [FDD_Sector],1
  70.     inc    [FDD_Head]
  71.     cmp    [FDD_Head],2
  72.     jne    save_image_1
  73.     mov    [FDD_Head],0
  74.     inc    [FDD_Track]
  75.     call   SeekTrack
  76.     cmp    [FDD_Track],80
  77.     jne    save_image_1
  78. unnecessary_save_image:
  79.     mov    [fdc_irq_func],fdc_null
  80.     popa
  81.     mov    [flp_status],0
  82.     ret
  83.  
  84.