Subversion Repositories Kolibri OS

Rev

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