Subversion Repositories Kolibri OS

Rev

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

Rev 748 Rev 1942
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: 748 $
14
$Revision: 1942 $
15
 
15
 
Line 96... Line 96...
96
        jnz  no_apm_off
96
        jnz  no_apm_off
97
        call APM_PowerOff
97
        call APM_PowerOff
98
        jmp  $
98
        jmp  $
99
no_apm_off:
99
no_apm_off:
Line 100... Line -...
100
 
-
 
101
        dec  ax    ; 3 = reboot
100
 
102
        jnz  restart_kernel        ; 4 = restart kernel
101
        ; 3 = reboot, 4 = obsolete restart kernel
103
        push 0x40
102
        push 0x40
104
        pop  ds
103
        pop  ds
105
        mov  word[0x0072],0x1234
104
        mov  word[0x0072],0x1234
Line 147... Line 146...
147
        mov bx,1
146
        mov bx,1
148
        mov cx,3
147
        mov cx,3
149
        int 0x15
148
        int 0x15
150
;!!!!!!!!!!!!!!!!!!!!!!!!
149
;!!!!!!!!!!!!!!!!!!!!!!!!
151
        ret
150
        ret
152
 
-
 
153
restart_kernel:
-
 
154
 
-
 
155
        mov     ax,0x0003      ; set text mode for screen
-
 
156
        int     0x10
-
 
157
        jmp     0x4000:0000
-
 
158
 
-
 
159
restart_kernel_4000:
-
 
160
        cli
-
 
161
 
-
 
162
        push    ds
-
 
163
        pop     es
-
 
164
        mov     cx, 0x8000
-
 
165
        push    cx
-
 
166
        push    0x7000
-
 
167
        pop     ds
-
 
168
        xor     si, si
-
 
169
        xor     di, di
-
 
170
        rep     movsw
-
 
171
        pop     cx
-
 
172
        mov     ds, cx
-
 
173
        push    0x2000
-
 
174
        pop     es
-
 
175
        rep     movsw
-
 
176
        push    0x9000
-
 
177
        pop     ds
-
 
178
        push    0x3000
-
 
179
        pop     es
-
 
180
        mov     cx, 0xE000/2
-
 
181
        rep     movsw
-
 
182
 
-
 
183
        wbinvd  ; write and invalidate cache
-
 
184
 
-
 
185
        mov    al, 00110100b
-
 
186
        out    43h, al
-
 
187
        jcxz    $+2
-
 
188
        mov    al, 0xFF
-
 
189
        out    40h, al
-
 
190
        jcxz    $+2
-
 
191
        out    40h, al
-
 
192
        jcxz    $+2
-
 
193
        sti
-
 
194
 
-
 
195
; (hint by Black_mirror)
-
 
196
; We must read data from keyboard port,
-
 
197
; because there may be situation when previous keyboard interrupt is lost
-
 
198
; (due to return to real mode and IRQ reprogramming)
-
 
199
; and next interrupt will not be generated (as keyboard waits for handling)
-
 
200
        in      al, 0x60
-
 
201
 
-
 
202
; bootloader interface
-
 
203
        push    0x1000
-
 
204
        pop    ds
-
 
205
        mov    si, kernel_restart_bootblock
-
 
206
        mov    ax, 'KL'
-
 
207
        jmp     0x1000:0000
-
 
208
-
 
209
-