Rev 129 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 129 | Rev 384 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | ;; Copyright 2003 Ville Turjanmaa |
7 | ;; Copyright 2003 Ville Turjanmaa |
8 | ;; |
8 | ;; |
Line 9... | Line 9... | ||
9 | 9 | ||
- | 10 | ||
Line 10... | Line 11... | ||
10 | 11 | system_shutdown: ; shut down the system |
|
11 | system_shutdown: ; shut down the system |
12 | call stop_all_services |
12 | 13 | ||
13 | push 3 ; stop playing cd |
14 | push 3 ; stop playing cd |
Line 49... | Line 50... | ||
49 | mov eax,[0xfe00] |
50 | mov eax,[0xfe00] |
50 | shr eax,1 |
51 | shr eax,1 |
51 | lea esi,[eax+220] ; x end |
52 | lea esi,[eax+220] ; x end |
52 | sub eax,220 ; x start |
53 | sub eax,220 ; x start |
Line 53... | Line 54... | ||
53 | 54 | ||
54 | mov ebx,[0xfe04] |
55 | mov ebx,[ScreenHeight] |
55 | shr ebx,1 |
56 | shr ebx,1 |
56 | mov [shutdownpos],ebx |
57 | mov [shutdownpos],ebx |
57 | lea ebp,[ebx+105] ; y end |
58 | lea ebp,[ebx+105] ; y end |
Line 134... | Line 135... | ||
134 | push 27 |
135 | push 27 |
135 | pop edx |
136 | pop edx |
Line 136... | Line 137... | ||
136 | 137 | ||
137 | nrl: |
138 | nrl: |
138 | call dtext |
139 | call dtext |
- | 140 | ; sub ebx,0x050000 |
|
- | 141 | ror ebx, 16 |
|
- | 142 | sub bl, 0x05 |
|
139 | sub ebx,0x050000 |
143 | ror ebx, 16 |
140 | add eax,8 |
144 | add eax,8 |
141 | add ecx,31 |
145 | add ecx,31 |
142 | cmp cx,word 0x0001+25*31 |
146 | cmp cx,word 0x0001+25*31 |
Line 165... | Line 169... | ||
165 | mov ecx,0x10000 |
169 | mov ecx,0x10000 |
166 | call memmove |
170 | call memmove |
Line 167... | Line 171... | ||
167 | 171 | ||
Line -... | Line 172... | ||
- | 172 | call restorefatchain |
|
- | 173 | ||
- | 174 | mov al, 0xFF |
|
- | 175 | out 0x21, al |
|
168 | call restorefatchain |
176 | out 0xA1, al |
169 | 177 | ||
Line 170... | Line 178... | ||
170 | mov word [0x467+0],pr_mode_exit-0x10000 |
178 | mov word [0x467+0],pr_mode_exit-0x10000 |
171 | mov word [0x467+2],0x1000 |
179 | mov word [0x467+2],0x1000 |
Line 197... | Line 205... | ||
197 | mov al,0x11 |
205 | mov al,0x11 |
198 | out 0x20,al |
206 | out 0x20,al |
199 | call rdelay |
207 | call rdelay |
200 | out 0xA0,al |
208 | out 0xA0,al |
201 | call rdelay |
209 | call rdelay |
202 | 210 | ||
203 | mov al,0x08 |
211 | mov al,0x08 |
204 | out 0x21,al |
212 | out 0x21,al |
205 | call rdelay |
213 | call rdelay |
206 | mov al,0x70 |
214 | mov al,0x70 |
207 | out 0xA1,al |
215 | out 0xA1,al |
208 | call rdelay |
216 | call rdelay |
209 | 217 | ||
210 | mov al,0x04 |
218 | mov al,0x04 |
211 | out 0x21,al |
219 | out 0x21,al |
212 | call rdelay |
220 | call rdelay |
213 | mov al,0x02 |
221 | mov al,0x02 |
214 | out 0xA1,al |
222 | out 0xA1,al |
215 | call rdelay |
223 | call rdelay |
216 | 224 | ||
217 | mov al,0x01 |
225 | mov al,0x01 |
218 | out 0x21,al |
226 | out 0x21,al |
219 | call rdelay |
227 | call rdelay |
220 | out 0xA1,al |
228 | out 0xA1,al |
221 | call rdelay |
229 | call rdelay |
222 | 230 | ||
223 | mov al,0 |
231 | mov al,0xB8 |
224 | out 0x21,al |
232 | out 0x21,al |
225 | call rdelay |
233 | call rdelay |
- | 234 | mov al,0xBD |
|
226 | out 0xA1,al |
235 | out 0xA1,al |
227 | sti |
236 | sti |
Line 228... | Line 237... | ||
228 | 237 | ||
229 | temp_3456: |
238 | temp_3456: |
Line 232... | Line 241... | ||
232 | mov al,byte [es:0x9030] |
241 | mov al,byte [es:0x9030] |
233 | cmp al,1 |
242 | cmp al,1 |
234 | jl nbw |
243 | jl nbw |
235 | cmp al,4 |
244 | cmp al,4 |
236 | jle nbw32 |
245 | jle nbw32 |
237 | 246 | ||
238 | nbw: |
247 | nbw: |
239 | in al,0x60 |
248 | in al,0x60 |
240 | call pause_key |
249 | call pause_key |
241 | cmp al,6 |
250 | cmp al,6 |
242 | jae nbw |
251 | jae nbw |
Line 274... | Line 283... | ||
274 | 283 | ||
275 | dec ax ; 3 = reboot |
284 | dec ax ; 3 = reboot |
276 | jnz restart_kernel ; 4 = restart kernel |
285 | jnz restart_kernel ; 4 = restart kernel |
277 | push 0x40 |
286 | push 0x40 |
278 | pop ds |
287 | pop ds |
279 | mov word[0x0072],0x1234 |
288 | mov word[0x0072],0x1234 |
Line 280... | Line 289... | ||
280 | jmp 0xF000:0xFFF0 |
289 | jmp 0xF000:0xFFF0 |
281 | 290 | ||
282 | pause_key: |
291 | pause_key: |
283 | mov cx,100 |
292 | mov cx,100 |
284 | pause_key_1: |
293 | pause_key_1: |
285 | loop pause_key_1 |
- | |
286 | ret |
- | |
287 | org $+0x10000 |
- | |
288 | old_ints_h: |
- | |
289 | dw 0x400 |
- | |
290 | dd 0 |
- | |
Line 291... | Line 294... | ||
291 | dw 0 |
294 | loop pause_key_1 |
292 | org $-0x10000 |
295 | ret |
Line 293... | Line 296... | ||
293 | 296 | ||
Line 363... | Line 366... | ||
363 | jcxz $+2 |
366 | jcxz $+2 |
364 | out 40h, al |
367 | out 40h, al |
365 | jcxz $+2 |
368 | jcxz $+2 |
366 | sti |
369 | sti |
Line -... | Line 370... | ||
- | 370 | ||
- | 371 | ; (hint by Black_mirror) |
|
- | 372 | ; We must read data from keyboard port, |
|
- | 373 | ; because there may be situation when previous keyboard interrupt is lost |
|
- | 374 | ; (due to return to real mode and IRQ reprogramming) |
|
- | 375 | ; and next interrupt will not be generated (as keyboard waits for handling) |
|
- | 376 | in al, 0x60 |
|
367 | 377 | ||
368 | ; bootloader interface |
378 | ; bootloader interface |
369 | push 0x1000 |
379 | push 0x1000 |
370 | pop ds |
380 | pop ds |
371 | mov si, .bootloader_block;-0x10000 |
381 | mov si, kernel_restart_bootblock-0x10000 |
372 | mov ax, 'KL' |
382 | mov ax, 'KL' |
Line 373... | Line -... | ||
373 | jmp 0x1000:0000 |
- | |
374 | - | ||
375 | .bootloader_block: |
- | |
376 | db 1 ; version |
- | |
377 | dw 1 ; floppy image is in memory |
- | |
378 | dd 0 ; cannot save parameters |
383 | jmp 0x1000:0000 |
379 | 384 | ||
380 | APM_PowerOff: |
385 | APM_PowerOff: |
381 | mov ax, 5304h |
386 | mov ax, 5304h |
382 | xor bx, bx |
387 | xor bx, bx |
Line 504... | Line 509... | ||
504 | db "IT'S SAFE TO POWER OFF COMPUTER OR " |
509 | db "IT'S SAFE TO POWER OFF COMPUTER OR " |
505 | db ' ' |
510 | db ' ' |
506 | db '1) SAVE RAMDISK TO FLOPPY ' |
511 | db '1) SAVE RAMDISK TO FLOPPY ' |
507 | db '2) APM - POWEROFF ' |
512 | db '2) APM - POWEROFF ' |
508 | db '3) REBOOT ' |
513 | db '3) REBOOT ' |
509 | db '4) RESTART KERNEL ' |
514 | db '4) RESTART KERNEL ' |
510 | else |
515 | else if lang eq ru |
511 | shutdowntext: |
516 | shutdowntext: |
512 | db "¥§®¯ ᮥ ¢ëª«î票¥ ª®¬¯ìîâ¥à ¨«¨ " |
517 | db "¥§®¯ ᮥ ¢ëª«î票¥ ª®¬¯ìîâ¥à ¨«¨ " |
513 | db ' ' |
518 | db ' ' |
514 | db '1) ®åà ¨âì à ¬¤¨áª ¤¨áª¥âã ' |
519 | db '1) ®åà ¨âì à ¬¤¨áª ¤¨áª¥âã ' |
515 | db '2) APM - ¢ëª«î票¥ ¯¨â ¨ï ' |
520 | db '2) APM - ¢ëª«î票¥ ¯¨â ¨ï ' |
516 | db '3) ¥à¥§ £à㧪 á¨á⥬ë ' |
521 | db '3) ¥à¥§ £à㧪 á¨á⥬ë ' |
517 | db '4) ¥áâ àâ ï¤à ¨§ ' |
522 | db '4) ¥áâ àâ ï¤à ¨§ ' |
- | 523 | else |
|
- | 524 | shutdowntext: |
|
- | 525 | db "SIE KOENNEN DEN COMPUTER NUN AUSSCHALTEN" |
|
- | 526 | db ' ' |
|
- | 527 | db '1) RAMDISK AUF DISK SPEICHERN ' |
|
- | 528 | db '2) APM - AUSSCHALTEN ' |
|
- | 529 | db '3) NEUSTARTEN ' |
|
- | 530 | db '4) KERNEL NEU STARTEN ' |
|
518 | end if |
531 | end if |
519 | rosef: |
532 | rosef: |
520 | db 'ROSE TXT' |
533 | db 'ROSE TXT' |
521 | endg |
534 | endg |