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