Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
444 serge 1
$Revision: 431 $
440 serge 2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;;                                                              ;;
4
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
5
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
6
;; Distributed under terms of the GNU General Public License    ;;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8
 
9
 
1 ha 10
iglobal
19 mario79 11
  ;function pointers.
12
  fdc_irq_func    dd fdc_null
1 ha 13
endg
14
 
15
uglobal
16
  dmasize         db 0x0
17
  dmamode         db 0x0
18
endg
19
 
20
fdc_init:                               ;start with clean tracks.
388 serge 21
        mov edi,OS_BASE+0xD201
1 ha 22
        mov al,0
23
        mov ecx,160
24
        rep stosb
25
ret
26
 
27
fdc_filesave:                   ;ebx: cluster to be saved.
28
        pusha                   ;returns immediately. does not trigger a write.
29
        mov eax,ebx
30
        add eax,31
31
        mov bl,18
32
        div bl
33
        mov ah,0
388 serge 34
        add eax,OS_BASE+0xD201
1 ha 35
        mov [eax],byte 1                ;This track is now dirty.
36
        popa
37
ret
38
 
19 mario79 39
fdc_irq:
40
        call [fdc_irq_func]
41
fdc_null:
1 ha 42
ret
43
 
19 mario79 44
save_image:
45
    call   reserve_flp
46
    call   restorefatchain
47
    pusha
48
    call   check_label
49
    cmp    [FDC_Status],0
50
    jne    unnecessary_save_image
51
    mov    [FDD_Track],0      ; Цилиндр
52
    mov    [FDD_Head],0      ; Сторона
381 serge 53
    mov    [FDD_Sector],1      ; Сектор
54
    mov    esi,RAMDISK
19 mario79 55
    call   SeekTrack
56
save_image_1:
57
    push   esi
58
    call   take_data_from_application_1
59
    pop    esi
60
    add    esi,512
61
    call   WriteSectWithRetr
62
;    call   WriteSector
63
    cmp    [FDC_Status],0
64
    jne    unnecessary_save_image
65
    inc    [FDD_Sector]
66
    cmp    [FDD_Sector],19
67
    jne    save_image_1
68
    mov    [FDD_Sector],1
381 serge 69
    inc    [FDD_Head]
19 mario79 70
    cmp    [FDD_Head],2
71
    jne    save_image_1
72
    mov    [FDD_Head],0
73
    inc    [FDD_Track]
74
    call   SeekTrack
75
    cmp    [FDD_Track],80
76
    jne    save_image_1
77
unnecessary_save_image:
78
    mov    [fdc_irq_func],fdc_null
79
    popa
80
    mov    [flp_status],0
81
    ret
1 ha 82