Subversion Repositories Kolibri OS

Rev

Rev 431 | Rev 766 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
431 serge 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
 
593 mikedld 8
$Revision: 593 $
431 serge 9
 
593 mikedld 10
 
1 ha 11
iglobal
19 mario79 12
  ;function pointers.
13
  fdc_irq_func    dd fdc_null
1 ha 14
endg
15
 
16
uglobal
17
  dmasize         db 0x0
18
  dmamode         db 0x0
19
endg
20
 
21
fdc_init:                               ;start with clean tracks.
389 serge 22
        mov edi,OS_BASE+0xD201
1 ha 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
389 serge 35
        add eax,OS_BASE+0xD201
1 ha 36
        mov [eax],byte 1                ;This track is now dirty.
37
        popa
38
ret
39
 
19 mario79 40
fdc_irq:
41
        call [fdc_irq_func]
42
fdc_null:
1 ha 43
ret
44
 
19 mario79 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      ; Сторона
381 serge 54
    mov    [FDD_Sector],1      ; Сектор
55
    mov    esi,RAMDISK
19 mario79 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
381 serge 70
    inc    [FDD_Head]
19 mario79 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
1 ha 83