Subversion Repositories Kolibri OS

Rev

Rev 129 | Go to most recent revision | Show entire file | Regard 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 218... Line 226...
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
Line 222... Line 230...
222
    
230
 
223
    mov  al,0
231
    mov  al,0xB8
224
    out  0x21,al
232
    out  0x21,al
-
 
233
    call rdelay
225
    call rdelay
234
    mov  al,0xBD
226
    out  0xA1,al
235
    out  0xA1,al
Line 227... Line 236...
227
    sti
236
    sti
228
 
237
 
Line 282... Line 291...
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
294
      loop  pause_key_1
286
      ret
295
      ret
287
org $+0x10000
-
 
288
old_ints_h:
-
 
289
        dw      0x400
-
 
290
        dd      0
-
 
291
        dw      0
-
 
292
org $-0x10000
-
 
Line 293... Line 296...
293
 
296
 
294
rdelay:
297
rdelay:
Line 295... Line 298...
295
    ret
298
    ret
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 505... Line 510...
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