Subversion Repositories Kolibri OS

Rev

Rev 681 | Rev 1962 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 681 Rev 748
Line 9... Line 9...
9
;;  See file COPYING for details.                               ;;
9
;;  See file COPYING for details.                               ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
10
;;  Copyright 2003 Ville Turjanmaa                              ;;
11
;;                                                              ;;
11
;;                                                              ;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 13... Line 13...
13
 
13
 
Line 14... Line 14...
14
$Revision: 681 $
14
$Revision: 748 $
15
 
15
 
Line 69... Line 69...
69
        cmp  al,4
69
        cmp  al,4
70
        jle  nbw32
70
        jle  nbw32
Line 71... Line 71...
71
 
71
 
72
nbw:
72
nbw:
73
        in   al,0x60
-
 
74
        call pause_key
73
        in   al,0x60
75
        cmp  al,6
74
        cmp  al,6
76
        jae  nbw
75
        jae  nbw
77
        mov  bl,al
76
        mov  bl,al
78
nbw2:
77
nbw2:
79
        in   al,0x60
-
 
80
        call pause_key
78
        in   al,0x60
81
        cmp  al,bl
79
        cmp  al,bl
82
        je   nbw2
80
        je   nbw2
83
        cmp  al,240  ;ax,240
81
        cmp  al,240  ;ax,240
84
        jne  nbw31
82
        jne  nbw31
Line 91... Line 89...
91
        jne  nbw
89
        jne  nbw
92
        sub  al,129
90
        sub  al,129
Line 93... Line 91...
93
 
91
 
Line 94... Line -...
94
nbw32:
-
 
95
 
92
nbw32:
96
        dec  ax    ; 1 = write floppy
-
 
97
        js   nbw
-
 
98
        jnz  no_floppy_write
-
 
99
        call floppy_write
-
 
100
        jmp  temp_3456 ;nbw
-
 
101
no_floppy_write:
93
 
102
 
94
        dec  ax
103
        dec  ax    ; 2 = power off
95
        dec  ax    ; 2 = power off
104
        jnz  no_apm_off
96
        jnz  no_apm_off
105
        call APM_PowerOff
97
        call APM_PowerOff
Line 111... Line 103...
111
        push 0x40
103
        push 0x40
112
        pop  ds
104
        pop  ds
113
        mov  word[0x0072],0x1234
105
        mov  word[0x0072],0x1234
114
        jmp  0xF000:0xFFF0
106
        jmp  0xF000:0xFFF0
Line 115... Line -...
115
 
-
 
116
pause_key:
-
 
117
        mov cx,100
-
 
118
pause_key_1:
-
 
119
        loop  pause_key_1
-
 
Line 120... Line 107...
120
        ret
107
 
121
 
108
 
Line 122... Line -...
122
rdelay:
-
 
123
        ret
-
 
124
 
-
 
125
floppy_write:   ; write diskette image to physical floppy
-
 
126
 
-
 
127
        cmp  [flm],byte 1
-
 
128
        je   fwwritedone
-
 
129
        mov  [flm],byte 1
-
 
130
 
-
 
131
        xor    ax, ax        ; reset drive
-
 
132
        xor    dx, dx
-
 
133
        int     0x13
-
 
134
 
-
 
135
        mov     cx,0x0001               ; startcyl,startsector
-
 
136
        xor    dx, dx                    ; starthead,drive
-
 
137
        mov    ax, 80*2               ; read no of sect
-
 
138
 
-
 
139
fwwrites:
-
 
140
        push    ax
-
 
141
 
-
 
142
        ; move 1mb+ -> 0:a000
-
 
143
 
-
 
144
         pusha
-
 
145
        mov     si, fwmovedesc
-
 
146
        mov     cx,256*18
-
 
147
        mov     ah,0x87
-
 
148
        push    ds
-
 
149
        pop    es
-
 
150
        int     0x15
-
 
151
        add    dword [fwmovedesc+0x12], 512*18
-
 
152
        popa
-
 
153
 
-
 
154
        xor     si,si
-
 
155
        mov    es,si
-
 
156
fwnewwrite:
-
 
157
        mov     bx,0xa000               ; es:bx -> data area
-
 
158
        mov     ax,0x0300+18            ; read, no of sectors to read
-
 
159
        int     0x13
-
 
160
 
-
 
161
         test    ah, ah
-
 
162
        jz      fwgoodwrite
-
 
163
 
-
 
164
        inc    si
-
 
165
        cmp     si,10
-
 
166
        jnz     fwnewwrite
-
 
167
 
-
 
168
; can't access diskette - return
-
 
169
        pop    ax
-
 
170
        ret
-
 
171
 
-
 
172
fwgoodwrite:
-
 
173
        inc     dh
-
 
174
        cmp     dh,2
-
 
175
        jnz     fwbb2
-
 
176
        mov     dh,0
-
 
177
        inc     ch
-
 
178
fwbb2:
-
 
179
        pop     ax
-
 
180
        dec     ax
-
 
181
        jnz     fwwrites
109
rdelay:
182
        ret
110
        ret
183
 
111
 
184
APM_PowerOff:
112
APM_PowerOff:
185
        mov     ax, 5304h
113
        mov     ax, 5304h
Line 218... Line 146...
218
        mov ax,0x5307
146
        mov ax,0x5307
219
        mov bx,1
147
        mov bx,1
220
        mov cx,3
148
        mov cx,3
221
        int 0x15
149
        int 0x15
222
;!!!!!!!!!!!!!!!!!!!!!!!!
150
;!!!!!!!!!!!!!!!!!!!!!!!!
223
fwwritedone:
-
 
224
        ret
151
        ret
Line 225... Line 152...
225
 
152
 
Line 226... Line 153...
226
restart_kernel:
153
restart_kernel: