Subversion Repositories Kolibri OS

Rev

Rev 593 | Rev 2455 | 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: 766 $
  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_irq:
  29.         call [fdc_irq_func]
  30. fdc_null:
  31. ret
  32.  
  33. save_image:
  34.     call   reserve_flp
  35.     call   restorefatchain
  36.     pusha
  37.     call   check_label
  38.     cmp    [FDC_Status],0
  39.     jne    unnecessary_save_image
  40.     mov    [FDD_Track],0      ; Öèëèíäð
  41.     mov    [FDD_Head],0      ; Ñòîðîíà
  42.     mov    [FDD_Sector],1      ; Ñåêòîð
  43.     mov    esi,RAMDISK
  44.     call   SeekTrack
  45. save_image_1:
  46.     push   esi
  47.     call   take_data_from_application_1
  48.     pop    esi
  49.     add    esi,512
  50.     call   WriteSectWithRetr
  51. ;    call   WriteSector
  52.     cmp    [FDC_Status],0
  53.     jne    unnecessary_save_image
  54.     inc    [FDD_Sector]
  55.     cmp    [FDD_Sector],19
  56.     jne    save_image_1
  57.     mov    [FDD_Sector],1
  58.     inc    [FDD_Head]
  59.     cmp    [FDD_Head],2
  60.     jne    save_image_1
  61.     mov    [FDD_Head],0
  62.     inc    [FDD_Track]
  63.     call   SeekTrack
  64.     cmp    [FDD_Track],80
  65.     jne    save_image_1
  66. unnecessary_save_image:
  67.     mov    [fdc_irq_func],fdc_null
  68.     popa
  69.     mov    [flp_status],0
  70.     ret
  71.  
  72.