Rev 5363 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2288 | clevermous | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
10051 | ace_dent | 3 | ;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;; |
2288 | clevermous | 4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
7 | |||
8 | |||
9 | uglobal |
||
10 | dmasize db 0x0 |
||
11 | dmamode db 0x0 |
||
12 | endg |
||
13 | |||
14 | fdc_init: ;start with clean tracks. |
||
15 | mov edi, OS_BASE+0xD201 |
||
16 | mov al, 0 |
||
17 | mov ecx, 160 |
||
18 | rep stosb |
||
19 | ret |
||
20 | |||
21 | save_image: |
||
4273 | clevermous | 22 | cmp [ramdisk_actual_size], FLOPPY_CAPACITY |
23 | jnz .fail |
||
2288 | clevermous | 24 | pusha |
4273 | clevermous | 25 | mov ecx, floppy_mutex |
26 | call mutex_lock |
||
27 | mov [flp_number], bl |
||
28 | call floppy_read_bootsector |
||
2288 | clevermous | 29 | cmp [FDC_Status], 0 |
4273 | clevermous | 30 | jne .unnecessary_save_image |
3539 | clevermous | 31 | mov [FDD_Track], 0; Цилиндр |
32 | mov [FDD_Head], 0; Сторона |
||
33 | mov [FDD_Sector], 1; Сектор |
||
2288 | clevermous | 34 | mov esi, RAMDISK |
35 | call SeekTrack |
||
4273 | clevermous | 36 | .save_image_1: |
2288 | clevermous | 37 | call take_data_from_application_1 |
38 | call WriteSectWithRetr |
||
39 | ; call WriteSector |
||
40 | cmp [FDC_Status], 0 |
||
4273 | clevermous | 41 | jne .unnecessary_save_image |
2288 | clevermous | 42 | inc [FDD_Sector] |
43 | cmp [FDD_Sector], 19 |
||
4273 | clevermous | 44 | jne .save_image_1 |
2288 | clevermous | 45 | mov [FDD_Sector], 1 |
46 | inc [FDD_Head] |
||
47 | cmp [FDD_Head], 2 |
||
4273 | clevermous | 48 | jne .save_image_1 |
2288 | clevermous | 49 | mov [FDD_Head], 0 |
50 | inc [FDD_Track] |
||
51 | call SeekTrack |
||
52 | cmp [FDD_Track], 80 |
||
4273 | clevermous | 53 | jne .save_image_1 |
54 | .unnecessary_save_image: |
||
55 | cmp [FDC_Status], 0 |
||
56 | pushf |
||
57 | mov ecx, floppy_mutex |
||
58 | call mutex_unlock |
||
59 | popf |
||
2288 | clevermous | 60 | popa |
4273 | clevermous | 61 | jnz .fail |
62 | xor eax, eax |
||
2288 | clevermous | 63 | ret |
4273 | clevermous | 64 | .fail: |
65 | movi eax, 1 |
||
66 | ret |