mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-24 23:56:49 +03:00
*Remove unneeded ps2mouse.inc and m_ps2.inc
*Remove 18.1 and 18.9.1 functions (sinse 465 revision they doesn't work), so CPU now use END application for reboot NOTE: file ROSE.TXT don't used in kernel now and can be deleted from image *New END application form Leency & Veliant git-svn-id: svn://kolibrios.org@748 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
e97775cadc
commit
b9b45d733a
@ -71,13 +71,11 @@ temp_3456:
|
||||
|
||||
nbw:
|
||||
in al,0x60
|
||||
call pause_key
|
||||
cmp al,6
|
||||
jae nbw
|
||||
mov bl,al
|
||||
nbw2:
|
||||
in al,0x60
|
||||
call pause_key
|
||||
cmp al,bl
|
||||
je nbw2
|
||||
cmp al,240 ;ax,240
|
||||
@ -93,13 +91,7 @@ nbw31:
|
||||
|
||||
nbw32:
|
||||
|
||||
dec ax ; 1 = write floppy
|
||||
js nbw
|
||||
jnz no_floppy_write
|
||||
call floppy_write
|
||||
jmp temp_3456 ;nbw
|
||||
no_floppy_write:
|
||||
|
||||
dec ax
|
||||
dec ax ; 2 = power off
|
||||
jnz no_apm_off
|
||||
call APM_PowerOff
|
||||
@ -113,74 +105,10 @@ no_apm_off:
|
||||
mov word[0x0072],0x1234
|
||||
jmp 0xF000:0xFFF0
|
||||
|
||||
pause_key:
|
||||
mov cx,100
|
||||
pause_key_1:
|
||||
loop pause_key_1
|
||||
ret
|
||||
|
||||
rdelay:
|
||||
ret
|
||||
|
||||
floppy_write: ; write diskette image to physical floppy
|
||||
|
||||
cmp [flm],byte 1
|
||||
je fwwritedone
|
||||
mov [flm],byte 1
|
||||
|
||||
xor ax, ax ; reset drive
|
||||
xor dx, dx
|
||||
int 0x13
|
||||
|
||||
mov cx,0x0001 ; startcyl,startsector
|
||||
xor dx, dx ; starthead,drive
|
||||
mov ax, 80*2 ; read no of sect
|
||||
|
||||
fwwrites:
|
||||
push ax
|
||||
|
||||
; move 1mb+ -> 0:a000
|
||||
|
||||
pusha
|
||||
mov si, fwmovedesc
|
||||
mov cx,256*18
|
||||
mov ah,0x87
|
||||
push ds
|
||||
pop es
|
||||
int 0x15
|
||||
add dword [fwmovedesc+0x12], 512*18
|
||||
popa
|
||||
|
||||
xor si,si
|
||||
mov es,si
|
||||
fwnewwrite:
|
||||
mov bx,0xa000 ; es:bx -> data area
|
||||
mov ax,0x0300+18 ; read, no of sectors to read
|
||||
int 0x13
|
||||
|
||||
test ah, ah
|
||||
jz fwgoodwrite
|
||||
|
||||
inc si
|
||||
cmp si,10
|
||||
jnz fwnewwrite
|
||||
|
||||
; can't access diskette - return
|
||||
pop ax
|
||||
ret
|
||||
|
||||
fwgoodwrite:
|
||||
inc dh
|
||||
cmp dh,2
|
||||
jnz fwbb2
|
||||
mov dh,0
|
||||
inc ch
|
||||
fwbb2:
|
||||
pop ax
|
||||
dec ax
|
||||
jnz fwwrites
|
||||
ret
|
||||
|
||||
APM_PowerOff:
|
||||
mov ax, 5304h
|
||||
xor bx, bx
|
||||
@ -220,7 +148,6 @@ APM_PowerOff:
|
||||
mov cx,3
|
||||
int 0x15
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
fwwritedone:
|
||||
ret
|
||||
|
||||
restart_kernel:
|
||||
|
@ -1,141 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
||||
MouseSearch_PS2:
|
||||
jmp MouseSearch_PS2_begin
|
||||
|
||||
mouse_error equ MouseSearch_PS2_begin.error
|
||||
|
||||
kb_cmd_c:
|
||||
call kb_cmd
|
||||
jmp check_kbd
|
||||
|
||||
kb_write_c:
|
||||
call kb_write
|
||||
jmp check_kbd
|
||||
|
||||
kb_read_c:
|
||||
call kb_read
|
||||
;jmp check_kbd
|
||||
|
||||
check_kbd:
|
||||
cmp ah, 1
|
||||
je mouse_error
|
||||
ret
|
||||
|
||||
uglobal
|
||||
mouse_cmd_byte db 0
|
||||
mouse_nr_tries db 0
|
||||
mouse_nr_resends db 0
|
||||
|
||||
mouse_error_esp dd 0
|
||||
endg
|
||||
|
||||
|
||||
mouse_cmd:
|
||||
mov [mouse_cmd_byte], al
|
||||
mov [mouse_nr_resends], 5
|
||||
.resend:
|
||||
mov bl, 0xd4
|
||||
call kb_cmd_c
|
||||
mov al, [mouse_cmd_byte]
|
||||
call kb_write_c
|
||||
|
||||
call mouse_read
|
||||
|
||||
cmp al, 0xFA ; ack
|
||||
jne .noack
|
||||
ret
|
||||
.noack:
|
||||
cmp al, 0xFE ; resend
|
||||
jne .noresend
|
||||
dec [mouse_nr_resends]
|
||||
jnz .resend
|
||||
.noresend:
|
||||
jmp mouse_error
|
||||
|
||||
|
||||
mouse_read:
|
||||
mov [mouse_nr_tries], 100
|
||||
.repeat:
|
||||
call kb_read
|
||||
cmp ah, 1
|
||||
jne .fin
|
||||
mov esi, 10
|
||||
call delay_ms
|
||||
dec [mouse_nr_tries]
|
||||
jnz .repeat
|
||||
jmp mouse_error
|
||||
.fin:
|
||||
ret
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
MouseSearch_PS2_begin:
|
||||
pushad
|
||||
|
||||
mov [mouse_error_esp], esp
|
||||
|
||||
mov bl, 0xAD ; disable keyboard interface
|
||||
call kb_cmd_c
|
||||
|
||||
mov bl, 0xA8 ; enable mouse interface
|
||||
call kb_cmd_c
|
||||
|
||||
mov al, 0xFF ; reset
|
||||
call mouse_cmd
|
||||
|
||||
; now the mouse is in Reset Mode
|
||||
; get the Basic Assurance Test completion code
|
||||
call mouse_read
|
||||
cmp al, 0xAA
|
||||
jne .error ; dead mouse
|
||||
|
||||
; get device ID
|
||||
call mouse_read
|
||||
cmp al, 0x00
|
||||
jne .error ; unknown device
|
||||
|
||||
; reset completed successfully
|
||||
|
||||
; enable mouse interrupt - IRQ12
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kb_cmd_c
|
||||
call kb_read_c
|
||||
or al, 10b
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kb_cmd_c
|
||||
pop eax
|
||||
call kb_write_c
|
||||
|
||||
mov al, 0xF4 ; enable data reporting
|
||||
call mouse_cmd
|
||||
|
||||
mov [ps2_mouse_detected], 1
|
||||
mov bl, 0xAE ; enable keyboard interface
|
||||
call kb_cmd
|
||||
|
||||
mov esi, boot_setmouse_type
|
||||
call boot_log
|
||||
|
||||
jmp .finish
|
||||
|
||||
|
||||
.error:
|
||||
mov esp, [mouse_error_esp] ; clear stack frame
|
||||
mov [ps2_mouse_detected], 0
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kb_cmd
|
||||
mov bl, 0xAE ; enable keyboard interface
|
||||
call kb_cmd
|
||||
|
||||
.finish:
|
||||
popad
|
@ -631,20 +631,6 @@
|
||||
* <20>ਠ¢ë§®¢¥ í⮩ äãªæ¨¨ ¯à¨«®¦¥¨¥¬ á ¥ ªâ¨¢ë¬ ®ª®¬
|
||||
¢®§¢à é ¥âáï ®â¢¥â "¡ãä¥à ¯ãáâ".
|
||||
|
||||
======================================================================
|
||||
======== ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 1 - § ¢¥àè¨âì à ¡®âã á¨á⥬ë. ========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 1 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
‚®§¢à é ¥¬®¥ § 票¥:
|
||||
* ¢á¥£¤ ¢®§¢à é ¥âáï eax = 0 ª ª ¯à¨§ ª ãᯥå
|
||||
‡ ¬¥ç ¨ï:
|
||||
* <20> ¯®á«¥¤¥¬ è £¥ ¯®ï¢«ï¥âáï ¬¥î ¢ë室 ¨§ á¨á⥬ë, ®¦¨¤ î饥
|
||||
ॠªæ¨¨ ¯®«ì§®¢ ⥫ï.
|
||||
* ‘¬®âਠ⠪¦¥ ¯®¤äãªæ¨î 9, § ¢¥à襨¥ à ¡®âë á¨á⥬ë á ¯ à ¬¥â஬,
|
||||
ç⮡ë ä®àá¨à®¢ âì ¢ë¡®à ¢ ¬¥î ¢ë室 .
|
||||
|
||||
======================================================================
|
||||
==== ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 2 - § ¢¥àè¨âì ¯à®æ¥áá/¯®â®ª ¯® á«®âã. ====
|
||||
======================================================================
|
||||
@ -748,15 +734,12 @@
|
||||
* äãªæ¨ï ¥ ¢®§¢à é ¥â § 票ï
|
||||
|
||||
======================================================================
|
||||
= ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 9 - § ¢¥à襨¥ à ¡®âë á¨á⥬ë á ¯ à ¬¥â஬. =
|
||||
======= ”γ<CEB3>ζ¨ο 18, ―®¤δγ<CEB3>ζ¨ο 9 - § Ά¥ΰ襨¥ ΰ ΅®βλ α¨α⥬λ ========
|
||||
======================================================================
|
||||
<EFBFBD> à ¬¥âàë:
|
||||
* eax = 18 - ®¬¥à äãªæ¨¨
|
||||
* ebx = 9 - ®¬¥à ¯®¤äãªæ¨¨
|
||||
* ecx = ¯ à ¬¥âà:
|
||||
* 1 = ¯®á«¥¤¥¬ è £¥ § ¢¥à襨ï à ¡®âë á®åà ¨âì à ¬¤¨áª
|
||||
¤¨áª¥âã, ¯®á«¥ 祣® ¢ë¢¥á⨠¬¥î ¢ë室 ¨ § ¯à®á¨âì ã
|
||||
¯®«ì§®¢ â¥«ï ¤ «ì¥©è¨¥ ¤¥©á⢨ï
|
||||
* 2 = ¢ëª«îç¨âì ª®¬¯ìîâ¥à
|
||||
* 3 = ¯¥à¥§ £à㧨âì ª®¬¯ìîâ¥à
|
||||
* 4 = ¯¥à¥§ ¯ãáâ¨âì ï¤à® ¨§ ä ©« kernel.mnt à ¬¤¨áª¥
|
||||
@ -768,12 +751,6 @@
|
||||
¢ë§®¢¥, ®® ¬®¦¥â ¨§¬¥¨âìáï ¢ ¯®á«¥¤ãîé¨å ¢¥àá¨ïå ï¤à .
|
||||
* Œ®¦® ¨á¯®«ì§®¢ âì ¯®¤äãªæ¨î 1, çâ®¡ë ¯®á«¥¤¥¬ è £¥
|
||||
§ ¢¥à襨ï à ¡®âë ¯®«ì§®¢ ⥫ì á ¬ à¥è «, çâ® ¥¬ã 㦮.
|
||||
* <20>¥ ४®¬¥¤ã¥âáï ¨á¯®«ì§®¢ âì § 票¥ ecx=1 (çâ®¡ë ¥ à §¤à ¦ âì
|
||||
¯®«ì§®¢ â¥«ï ¨§«¨è¨¬¨ ¢®¯à®á ¬¨); á®åà ¨âì à ¬¤¨áª ¤¨áª¥âã
|
||||
¬®¦® äãªæ¨¥© 16 (ª®â®à ï ¤®¯ã᪠¥â ãâ®ç¥¨¥, ª ªãî ¨¬¥®
|
||||
¤¨áª¥âã ¯¨á âì), § ¢¥àè¨âì à ¡®âã á ¬¥î ¢ë室 ¬®¦® 㦥
|
||||
㯮¬ïã⮩ ¯®¤äãªæ¨¥© 1.
|
||||
|
||||
======================================================================
|
||||
======== ”ãªæ¨ï 18, ¯®¤äãªæ¨ï 10 - ᢥàãâì ®ª® ¯à¨«®¦¥¨ï. =======
|
||||
======================================================================
|
||||
|
@ -623,20 +623,6 @@ Remarks:
|
||||
* The call of this function by an application with inactive window
|
||||
will return answer "buffer is empty".
|
||||
|
||||
======================================================================
|
||||
============ Function 18, subfunction 1 - system shutdown. ===========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 18 - function number
|
||||
* ebx = 1 - subfunction number
|
||||
Returned value:
|
||||
* function always return eax = 0 as tag of success
|
||||
Remarks:
|
||||
* On the last step menu of exit from the system appears and waits
|
||||
response of the user.
|
||||
* See also subfunction 9, system shutdown with
|
||||
the parameter to force the choice in the exit menu.
|
||||
|
||||
======================================================================
|
||||
= Function 18, subfunction 2 - terminate process/thread by the slot. =
|
||||
======================================================================
|
||||
@ -744,15 +730,12 @@ Returned value:
|
||||
* function does not return value
|
||||
|
||||
======================================================================
|
||||
== Function 18, subfunction 9 - system shutdown with the parameter. ==
|
||||
============ Function 18, subfunction 9 - system shutdown. ===========
|
||||
======================================================================
|
||||
Parameters:
|
||||
* eax = 18 - function number
|
||||
* ebx = 9 - subfunction number
|
||||
* ecx = parameter:
|
||||
* 1 = on the last step of shutdown save ramdisk on a floppy and
|
||||
then show the exit menu and request further operations
|
||||
from the user
|
||||
* 2 = turn off computer
|
||||
* 3 = reboot computer
|
||||
* 4 = restart the kernel from the file 'kernel.mnt' on ramdisk
|
||||
@ -765,12 +748,6 @@ Remarks:
|
||||
changed in future versions of the kernel.
|
||||
* It is possible to use subfunction 1, that on the last step
|
||||
the user makes choice himself.
|
||||
* It is not recommended to use value ecx=1 (to not irritate the user
|
||||
with excessive questions); to save ramdisk on a floppy use
|
||||
function 16 (which admits specification, on which floppy to
|
||||
write), and to shutdown with the exit menu use already mentioned
|
||||
subfunction 1.
|
||||
|
||||
======================================================================
|
||||
===== Function 18, subfunction 10 - minimize application window. =====
|
||||
======================================================================
|
||||
|
@ -1,176 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
||||
; Номер принимаемого от мыши байта
|
||||
MouseByteNumber_2 DB 0
|
||||
; Трехбайтовая структура данных, передаваемая мышью
|
||||
FirstByte_2 DB 0
|
||||
SecondByte_2 DB 0
|
||||
ThirdByte_2 DB 0
|
||||
timer_ticks_ps2 dd 0
|
||||
|
||||
;**************************************
|
||||
;* ОБРАБОТЧИК ПРЕРЫВАНИЯ ОТ МЫШИ PS/2 *
|
||||
;**************************************
|
||||
check_mouse_data_ps2:
|
||||
cmp [ps2_mouse_detected],0
|
||||
je @@EndMouseInterrupt_2
|
||||
call Wait8042BufferEmpty ;очистка буфера
|
||||
in AL,0x60 ;получить скэн-код
|
||||
; Выбирать порядковый номер принимаемого байта
|
||||
cmp [MouseByteNumber_2],0
|
||||
je @@SaveFirstByte
|
||||
cmp [MouseByteNumber_2],1
|
||||
je @@SaveSecondByte
|
||||
cmp [MouseByteNumber_2],2
|
||||
je @@SaveThirdByte
|
||||
jmp @@Error_2
|
||||
; Записать первый байт посылки
|
||||
@@SaveFirstByte:
|
||||
test AL,1000b ;первый байт посылки?
|
||||
jz @@Error_2 ;сбой синхронизации
|
||||
mov [FirstByte_2],AL
|
||||
inc [MouseByteNumber_2]
|
||||
jmp @@EndMouseInterrupt_2
|
||||
; Записать второй байт посылки
|
||||
@@SaveSecondByte:
|
||||
mov [SecondByte_2],AL
|
||||
inc [MouseByteNumber_2]
|
||||
jmp @@EndMouseInterrupt_2
|
||||
; Записать третий байт посылки
|
||||
@@SaveThirdByte:
|
||||
mov [ThirdByte_2],AL
|
||||
mov [MouseByteNumber_2],0
|
||||
; (пакет данных от мыши принят полностью)
|
||||
; Записать новое значение байта состояния кнопок
|
||||
mov al,[FirstByte_2] ;[0xfb01]
|
||||
and eax,3
|
||||
mov [BTN_DOWN],al
|
||||
mov [mouse_active],1
|
||||
; Вычислить новую X-координату курсора
|
||||
; Занести в AX перемещение по X
|
||||
mov AH,0 ;дублируем знак во все разряды AH
|
||||
mov AL,[FirstByte_2]
|
||||
test AL,10000b
|
||||
jz @@M0
|
||||
mov AH,0FFh
|
||||
; Занести в AL младший байт
|
||||
@@M0:
|
||||
mov AL,[SecondByte_2]
|
||||
call mouse_acceleration_ps2
|
||||
; Вычислить новое значение координаты
|
||||
; курсора по X
|
||||
add AX,[MOUSE_X] ;[XCoordinate]
|
||||
jns @@M1
|
||||
xor eax, eax
|
||||
jmp @@M2
|
||||
@@M1:
|
||||
cmp AX,[ScreenWidth] ;ScreenLength
|
||||
jl @@M2
|
||||
mov AX,[ScreenWidth] ;ScreenLength-1
|
||||
@@M2:
|
||||
mov [MOUSE_X],AX ;[XCoordinate]
|
||||
|
||||
; Вычисляем новую Y-координату курсора
|
||||
; Занести в AX перемещение по Y
|
||||
mov AH,0 ;дублируем знак во все разряды AH
|
||||
mov AL,[FirstByte_2]
|
||||
test AL,100000b
|
||||
jz @@M3
|
||||
mov AH,0FFh
|
||||
; Занести в AL младший байт
|
||||
@@M3:
|
||||
mov AL,[ThirdByte_2]
|
||||
call mouse_acceleration_ps2
|
||||
; Вычислить новое значение координаты курсора
|
||||
; по Y (Y-координата мыши PS/2 направлена
|
||||
; противоположно экранной)
|
||||
neg AX
|
||||
add AX,[MOUSE_Y] ;[YCoordinate]
|
||||
jns @@M4
|
||||
xor eax, eax
|
||||
jmp @@M5
|
||||
@@M4:
|
||||
cmp AX,[ScreenHeight] ;ScreenHeigth
|
||||
jl @@M5
|
||||
mov AX,[ScreenHeight] ;ScreenHeigth-1
|
||||
@@M5:
|
||||
mov [MOUSE_Y],AX ;[YCoordinate]
|
||||
|
||||
; Показать курсор в новой позиции
|
||||
mov eax,[timer_ticks]
|
||||
mov [timer_ticks_ps2],eax
|
||||
jmp @@EndMouseInterrupt_2
|
||||
|
||||
; Обнаружен сбой в порядке передачи информации от мыши
|
||||
@@Error_2:
|
||||
mov [MouseByteNumber_2],0
|
||||
; Нормальное завершение прерывани
|
||||
@@EndMouseInterrupt_2:
|
||||
call ready_for_next_irq_1
|
||||
ret
|
||||
|
||||
mouse_acceleration_ps2:
|
||||
push eax
|
||||
mov eax,[timer_ticks]
|
||||
sub eax,[timer_ticks_ps2]
|
||||
cmp eax,[mouse_delay]
|
||||
pop eax
|
||||
ja @f
|
||||
imul ax,[mouse_speed_factor]
|
||||
@@:
|
||||
ret
|
||||
;***********************************************
|
||||
;* ОЖИДАНИЕ ОЧИСТКИ ВХОДНОГО БУФЕРА I8042 *
|
||||
;* При выходе из процедуры: *
|
||||
;* флаг ZF установлен - нормальное завершение, *
|
||||
;* флаг ZF сброшен - ошибка тайм-аута. *
|
||||
;***********************************************
|
||||
Wait8042BufferEmpty:
|
||||
; push CX
|
||||
; mov CX,0FFFFh ;задать число циклов ожидани
|
||||
;@@kb:
|
||||
; in AL,64h ;получить статус
|
||||
; test AL,10b ;буфер i8042 свободен?
|
||||
; loopnz @@kb ;если нет, то цикл
|
||||
; pop CX
|
||||
push ecx
|
||||
xor ecx,ecx
|
||||
@@:
|
||||
in al,64h
|
||||
test al,00000010b
|
||||
loopnz @b
|
||||
pop ecx
|
||||
;Если при выходе из подпрограммы сброшен
|
||||
;флаг ZF - ошибка
|
||||
ret ;возврат в подпрограмму
|
||||
|
||||
;***************************************
|
||||
;* ОЖИДАНИЕ ПОСТУПЛЕНИЯ ДАННЫХ ОТ МЫШИ *
|
||||
;***************************************
|
||||
WaitMouseData:
|
||||
; push CX
|
||||
; mov CX,0FFFFh ;задать число циклов ожидани
|
||||
;@@mouse:
|
||||
; in AL,64h ;опросить регистр статуса
|
||||
; test AL,100000b ;данные поступили?
|
||||
; loopz @@mouse ;если нет, то цикл
|
||||
; pop CX
|
||||
push ecx
|
||||
mov ECX,0FFFFh
|
||||
@@:
|
||||
in al,64h
|
||||
test al,100000b
|
||||
loopz @b
|
||||
pop ecx
|
||||
;Если при выходе из подпрограммы установлен
|
||||
;флаг ZF - ошибка
|
||||
ret
|
||||
|
@ -2026,7 +2026,7 @@ sys_end:
|
||||
iglobal
|
||||
align 4
|
||||
sys_system_table:
|
||||
dd sysfn_shutdown ; 1 = system shutdown
|
||||
dd 0 ; 1 = system shutdown
|
||||
dd sysfn_terminate ; 2 = terminate thread
|
||||
dd sysfn_activate ; 3 = activate window
|
||||
dd sysfn_getidletime ; 4 = get idle time
|
||||
@ -2034,7 +2034,7 @@ sys_system_table:
|
||||
dd sysfn_saveramdisk ; 6 = save ramdisk
|
||||
dd sysfn_getactive ; 7 = get active window
|
||||
dd sysfn_sound_flag ; 8 = get/set sound_flag
|
||||
dd sysfn_shutdown_param ; 9 = shutdown with parameter
|
||||
dd sysfn_shutdown ; 9 = shutdown with parameter
|
||||
dd sysfn_minimize ; 10 = minimize window
|
||||
dd sysfn_getdiskinfo ; 11 = get disk subsystem info
|
||||
dd sysfn_lastkey ; 12 = get last pressed key
|
||||
@ -2060,14 +2060,19 @@ sys_system:
|
||||
@@:
|
||||
ret
|
||||
|
||||
sysfn_shutdown: ; 18.1 = BOOT
|
||||
mov [BOOT_VAR+0x9030],byte 0
|
||||
for_shutdown_parameter:
|
||||
|
||||
sysfn_shutdown: ; 18.9 = system shutdown
|
||||
cmp ecx,1
|
||||
jl exit_for_anyone
|
||||
cmp ecx,4
|
||||
jg exit_for_anyone
|
||||
mov [BOOT_VAR+0x9030],cl
|
||||
|
||||
mov eax,[TASK_COUNT]
|
||||
mov [SYS_SHUTDOWN],al
|
||||
mov [shutdown_processes],eax
|
||||
and dword [esp+32], 0
|
||||
exit_for_anyone:
|
||||
ret
|
||||
uglobal
|
||||
shutdown_processes: dd 0x0
|
||||
@ -2179,17 +2184,8 @@ sysfn_sound_flag: ; 18.8 = get/set sound_flag
|
||||
nosoundflag:
|
||||
ret
|
||||
|
||||
sysfn_shutdown_param: ; 18.9 = system shutdown with param
|
||||
cmp ecx,1
|
||||
jl exit_for_anyone
|
||||
cmp ecx,4
|
||||
jg exit_for_anyone
|
||||
mov [BOOT_VAR+0x9030],cl
|
||||
jmp for_shutdown_parameter
|
||||
|
||||
sysfn_minimize: ; 18.10 = minimize window
|
||||
mov [window_minimize],1
|
||||
exit_for_anyone:
|
||||
ret
|
||||
|
||||
sysfn_getdiskinfo: ; 18.11 = get disk info table
|
||||
|
@ -120,8 +120,8 @@ still_end:
|
||||
jmp still_end
|
||||
|
||||
reboot:
|
||||
mov eax,18
|
||||
mov ebx,1
|
||||
mov eax,70
|
||||
mov ebx,sys_reboot
|
||||
int 0x40
|
||||
;close program if we going to reboot
|
||||
|
||||
@ -582,6 +582,14 @@ file_start: dd 7
|
||||
start_application: db '/sys/LAUNCHER',0
|
||||
times 60 db 32
|
||||
|
||||
sys_reboot:
|
||||
dd 7
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
dd 0
|
||||
db '/sys/end',0
|
||||
|
||||
if lang eq de
|
||||
text:
|
||||
db ' NAME/BEENDEN PID CPU-LAST % '
|
||||
|
1
programs/system/end/trunk/back.raw
Normal file
1
programs/system/end/trunk/back.raw
Normal file
File diff suppressed because one or more lines are too long
3
programs/system/end/trunk/build.bat
Normal file
3
programs/system/end/trunk/build.bat
Normal file
@ -0,0 +1,3 @@
|
||||
@fasm end.asm end
|
||||
@kpack end
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix en >lang.inc
|
||||
@fasm end.asm end
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix et >lang.inc
|
||||
@fasm end.asm end
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ge >lang.inc
|
||||
@fasm end.asm end
|
||||
@erase lang.inc
|
||||
@pause
|
@ -1,5 +0,0 @@
|
||||
@erase lang.inc
|
||||
@echo lang fix ru >lang.inc
|
||||
@fasm end.asm end
|
||||
@erase lang.inc
|
||||
@pause
|
@ -4,95 +4,56 @@
|
||||
; <diamond> note that 'mov al,xx' is shorter than 'mov eax,xx'
|
||||
; and if we know that high 24 bits of eax are zero, we can use 1st form
|
||||
; the same about ebx,ecx,edx
|
||||
;
|
||||
; 15.02.2007 merge old END with new one (fron Veliant & Leency) by Heavyiron
|
||||
|
||||
include "lang.inc"
|
||||
include "..\..\..\macros.inc"
|
||||
|
||||
meos_app_start
|
||||
code
|
||||
|
||||
do_draw:
|
||||
|
||||
mov eax,48
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,sizeof.system_colors
|
||||
mcall
|
||||
draw:
|
||||
|
||||
mov al,12 ; eax=12 - tell os about redraw start
|
||||
mov bl,1
|
||||
mov ebx,1
|
||||
mcall
|
||||
|
||||
mov al,14 ; eax=14 - get screen max x & max y
|
||||
mcall
|
||||
|
||||
movzx ecx,ax
|
||||
|
||||
shr eax,17
|
||||
shl eax,16
|
||||
lea ebx,[eax-110*10000h+220]
|
||||
|
||||
shr ecx,1
|
||||
shl ecx,16
|
||||
sub ecx,50*10000h - 120
|
||||
movzx ecx, ax
|
||||
shr eax, 16
|
||||
shr ecx, 1
|
||||
shr eax, 1
|
||||
sub eax, 157
|
||||
sub ecx, 100
|
||||
mov ebx, eax
|
||||
shl ebx, 16
|
||||
add ebx, 253
|
||||
shl ecx, 16
|
||||
add ecx, 154
|
||||
|
||||
xor eax,eax ; define and draw window
|
||||
mov edx,[sc.work]
|
||||
mov esi,edx
|
||||
mov edi,edx
|
||||
mov edx,0x41ffffff
|
||||
mcall
|
||||
|
||||
mov edx,0x444444
|
||||
mov al,13
|
||||
mcall ,18 shl 16+90,29 shl 16+27
|
||||
push ebx
|
||||
mcall ,121 shl 16+90
|
||||
xchg ebx,[esp]
|
||||
mcall ,,63 shl 16+27
|
||||
pop ebx
|
||||
mcall
|
||||
mcall ,179 shl 16+30,99 shl 16+15
|
||||
|
||||
xor edx,edx
|
||||
mov al,8
|
||||
inc edx
|
||||
mcall ,15 shl 16+87,26 shl 16+24,,0xbb0055
|
||||
inc edx
|
||||
mcall ,118 shl 16+87,,,0xaaaa ;cccc
|
||||
inc edx
|
||||
mcall ,15 shl 16+87,60 shl 16+24,,0x9900
|
||||
inc edx
|
||||
mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc
|
||||
inc edx
|
||||
mcall ,175 shl 16+30,95 shl 16+15,,[sc.work_button]
|
||||
|
||||
mov al,4 ; 0x00000004 = write text
|
||||
mov ebx,75*65536+10
|
||||
mov ecx,[sc.work_text] ; 8b window nro - RR GG BB color
|
||||
or ecx,0x90000000
|
||||
mov edx,label1 ; pointer to text beginning
|
||||
mov al, 7
|
||||
mov ebx, background
|
||||
mov ecx, 254 shl 16 + 155
|
||||
xor edx, edx
|
||||
mcall
|
||||
|
||||
mov ebx,15*65536+101
|
||||
mov edx,label4
|
||||
mcall
|
||||
|
||||
mov ecx,0x90eeeeee ; 8b window nro - RR GG BB color
|
||||
mov ebx,25*65536+30
|
||||
mov edx,label2 ; pointer to text beginning
|
||||
mcall
|
||||
|
||||
mov ebx,20*65536+64
|
||||
mov edx,label3
|
||||
mcall
|
||||
|
||||
mov ebx,45*65536+41
|
||||
mov edx,label5
|
||||
mcall
|
||||
|
||||
mov ebx,40*65536+75
|
||||
mov edx,label6
|
||||
mcall
|
||||
|
||||
mov al,8
|
||||
mcall ,58 shl 16 + 32,59 shl 16 + 34, 1 shl 30 + 1
|
||||
inc edx
|
||||
mcall ,110 shl 16 + 32,54 shl 16 + 32
|
||||
inc edx
|
||||
mcall ,161 shl 16 + 32,59 shl 16 + 34
|
||||
inc edx
|
||||
mcall ,193 shl 16 + 43,125 shl 16 + 16,
|
||||
inc edx
|
||||
mcall ,144 shl 16 + 43
|
||||
|
||||
mov al,12 ;end of redraw
|
||||
mov ebx,2
|
||||
@ -104,7 +65,7 @@ still:
|
||||
mcall
|
||||
|
||||
dec eax
|
||||
jz do_draw
|
||||
jz draw
|
||||
dec eax
|
||||
jnz button
|
||||
key:
|
||||
@ -126,10 +87,10 @@ still:
|
||||
mcall
|
||||
xchg al,ah
|
||||
dec eax
|
||||
jz power_off
|
||||
dec eax
|
||||
jz restart_kernel
|
||||
dec eax
|
||||
jz power_off
|
||||
dec eax
|
||||
jz restart
|
||||
dec eax
|
||||
jnz run_rdsave
|
||||
@ -162,53 +123,7 @@ run_rdsave:
|
||||
jmp still
|
||||
|
||||
data
|
||||
|
||||
if lang eq ru
|
||||
label1:
|
||||
db '‚ è ¢ë¡®à:',0
|
||||
label2:
|
||||
db '‚몫îç¨âì Ÿ¤à®',0
|
||||
label3:
|
||||
db '<27>¥à¥§ ¯ã᪠Žâ¬¥ ',0
|
||||
label4:
|
||||
db '‘®åà ¨âì áâனª¨',0
|
||||
|
||||
else if lang eq en
|
||||
label1:
|
||||
db ' SELECT:',0
|
||||
label2:
|
||||
db 'POWER OFF KERNEL',0
|
||||
label3:
|
||||
db ' RESTART CANCEL',0
|
||||
label4:
|
||||
db 'Save settings',0
|
||||
|
||||
else if lang eq et
|
||||
label1:
|
||||
db ' VALI:',0
|
||||
label2:
|
||||
db 'LÜLITA VÄLJA KERNEL',0
|
||||
label3:
|
||||
db ' RESTART TÜHISTA',0
|
||||
label4:
|
||||
db 'Save settings',0
|
||||
|
||||
else
|
||||
label1:
|
||||
db 'WAEHLEN:',0
|
||||
label2:
|
||||
db ' BEENDEN KERNEL',0
|
||||
label3:
|
||||
db ' NEUSTART ABBRECHEN',0
|
||||
label4:
|
||||
db 'Save settings',0
|
||||
|
||||
end if
|
||||
label5:
|
||||
db '(End) (Home)',0
|
||||
label6:
|
||||
db '(Enter) (Esc)',0
|
||||
|
||||
background file 'back.raw'
|
||||
rdsave:
|
||||
dd 7
|
||||
dd 0
|
||||
@ -217,6 +132,5 @@ rdsave:
|
||||
dd 0
|
||||
db '/sys/rdsave',0
|
||||
udata
|
||||
sc system_colors
|
||||
|
||||
meos_app_end
|
||||
|
Loading…
Reference in New Issue
Block a user