Subversion Repositories Kolibri OS

Rev

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

Rev 2231 Rev 2244
Line 66... Line 66...
66
;;
66
;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
67
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 68... Line 68...
68
 
68
 
Line 69... Line 69...
69
include 'macros.inc'
69
include 'macros.inc'
Line 70... Line 70...
70
 
70
 
Line 71... Line 71...
71
$Revision: 2231 $
71
$Revision: 2244 $
Line 1939... Line 1939...
1939
     jmp   waitterm
1939
     jmp   waitterm
Line 1940... Line 1940...
1940
 
1940
 
1941
iglobal
1941
iglobal
1942
align 4
1942
align 4
1943
sys_system_table:
1943
sys_system_table:
1944
        dd      exit_for_anyone         ; 1 = obsolete
1944
        dd      sysfn_deactivate        ; 1 = deactivate window
1945
        dd      sysfn_terminate         ; 2 = terminate thread
1945
        dd      sysfn_terminate         ; 2 = terminate thread
1946
        dd      sysfn_activate          ; 3 = activate window
1946
        dd      sysfn_activate          ; 3 = activate window
1947
        dd      sysfn_getidletime       ; 4 = get idle time
1947
        dd      sysfn_getidletime       ; 4 = get idle time
1948
        dd      sysfn_getcpuclock       ; 5 = get cpu clock
1948
        dd      sysfn_getcpuclock       ; 5 = get cpu clock
Line 1964... Line 1964...
1964
        dd      sysfn_meminfo           ; 20 = get extended memory info
1964
        dd      sysfn_meminfo           ; 20 = get extended memory info
1965
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
1965
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
1966
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
1966
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
1967
sysfn_num = ($ - sys_system_table)/4
1967
sysfn_num = ($ - sys_system_table)/4
1968
endg
1968
endg
1969
 
-
 
-
 
1969
;------------------------------------------------------------------------------
1970
sys_system:
1970
sys_system:
1971
        dec     ebx
1971
        dec     ebx
1972
        cmp     ebx, sysfn_num
1972
        cmp     ebx, sysfn_num
1973
        jae     @f
1973
        jae     @f
1974
        jmp     dword [sys_system_table + ebx*4]
1974
        jmp     dword [sys_system_table + ebx*4]
1975
@@:
1975
@@:
1976
        ret
1976
        ret
1977
 
-
 
1978
 
-
 
-
 
1977
;------------------------------------------------------------------------------
1979
sysfn_shutdown:          ; 18.9 = system shutdown
1978
sysfn_shutdown:          ; 18.9 = system shutdown
1980
     cmp  ecx,1
1979
     cmp  ecx,1
1981
     jl   exit_for_anyone
1980
     jl   exit_for_anyone
1982
     cmp  ecx,4
1981
     cmp  ecx,4
1983
     jg   exit_for_anyone
1982
     jg   exit_for_anyone
Line 1990... Line 1989...
1990
 exit_for_anyone:
1989
 exit_for_anyone:
1991
     ret
1990
     ret
1992
  uglobal
1991
  uglobal
1993
   shutdown_processes: dd 0x0
1992
   shutdown_processes: dd 0x0
1994
  endg
1993
  endg
1995
 
-
 
-
 
1994
;------------------------------------------------------------------------------
1996
sysfn_terminate:        ; 18.2 = TERMINATE
1995
sysfn_terminate:        ; 18.2 = TERMINATE
1997
     cmp  ecx,2
1996
     cmp  ecx,2
1998
     jb   noprocessterminate
1997
     jb   noprocessterminate
1999
     mov  edx,[TASK_COUNT]
1998
     mov  edx,[TASK_COUNT]
2000
     cmp  ecx,edx
1999
     cmp  ecx,edx
Line 2014... Line 2013...
2014
     jne  noatsc
2013
     jne  noatsc
2015
     and  [application_table_status],0
2014
     and  [application_table_status],0
2016
   noatsc:
2015
   noatsc:
2017
   noprocessterminate:
2016
   noprocessterminate:
2018
     ret
2017
     ret
2019
 
-
 
-
 
2018
;------------------------------------------------------------------------------
2020
sysfn_terminate2:
2019
sysfn_terminate2:
2021
;lock application_table_status mutex
2020
;lock application_table_status mutex
2022
.table_status:
2021
.table_status:
2023
    cli
2022
    cli
2024
    cmp    [application_table_status],0
2023
    cmp    [application_table_status],0
Line 2041... Line 2040...
2041
    ret
2040
    ret
2042
.not_found:
2041
.not_found:
2043
    mov    [application_table_status],0
2042
    mov    [application_table_status],0
2044
    or     dword [esp+32],-1
2043
    or     dword [esp+32],-1
2045
    ret
2044
    ret
-
 
2045
;------------------------------------------------------------------------------
-
 
2046
sysfn_deactivate:         ; 18.1 = DEACTIVATE WINDOW
-
 
2047
	cmp	ecx,2
-
 
2048
	jb	.nowindowdeactivate
-
 
2049
	cmp	ecx,[TASK_COUNT]
-
 
2050
	ja	.nowindowdeactivate	
-
 
2051
	
-
 
2052
	movzx	esi, word [WIN_STACK + ecx*2]
-
 
2053
	cmp	esi, 1
-
 
2054
	je	.nowindowdeactivate ; already deactive
-
 
2055
 
-
 
2056
	mov	edi, ecx
-
 
2057
	shl	edi, 5
-
 
2058
	add	edi, window_data
-
 
2059
	movzx	esi, word [WIN_STACK + ecx * 2]
-
 
2060
	lea	esi, [WIN_POS + esi * 2]
-
 
2061
	call	window._.window_deactivate
Line -... Line 2062...
-
 
2062
	
-
 
2063
	xor	eax, eax
-
 
2064
	mov	byte[MOUSE_BACKGROUND], al
-
 
2065
	mov	byte[DONT_DRAW_MOUSE], al
-
 
2066
	mov	byte[MOUSE_DOWN], 0
-
 
2067
 
-
 
2068
	call	syscall_display_settings._.calculate_whole_screen
-
 
2069
	call	syscall_display_settings._.redraw_whole_screen
-
 
2070
.nowindowdeactivate:
-
 
2071
	ret
2046
 
2072
 ;------------------------------------------------------------------------------   
2047
sysfn_activate:         ; 18.3 = ACTIVATE WINDOW
2073
sysfn_activate:         ; 18.3 = ACTIVATE WINDOW
2048
     cmp  ecx,2
2074
     cmp  ecx,2
2049
     jb   .nowindowactivate
2075
     jb   .nowindowactivate
2050
     cmp  ecx,[TASK_COUNT]
2076
     cmp  ecx,[TASK_COUNT]
Line 2062... Line 2088...
2062
     movzx esi, word [WIN_STACK + ecx * 2]
2088
     movzx esi, word [WIN_STACK + ecx * 2]
2063
     lea   esi, [WIN_POS + esi * 2]
2089
     lea   esi, [WIN_POS + esi * 2]
2064
     call  waredraw
2090
     call  waredraw
2065
.nowindowactivate:
2091
.nowindowactivate:
2066
     ret
2092
     ret
2067
 
-
 
-
 
2093
;------------------------------------------------------------------------------
2068
sysfn_getidletime:              ; 18.4 = GET IDLETIME
2094
sysfn_getidletime:              ; 18.4 = GET IDLETIME
2069
     mov  eax,[idleusesec]
2095
     mov  eax,[idleusesec]
2070
     mov  [esp+32], eax
2096
     mov  [esp+32], eax
2071
     ret
2097
     ret
2072
 
-
 
-
 
2098
;------------------------------------------------------------------------------
2073
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
2099
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
2074
     mov  eax,[CPU_FREQ]
2100
     mov  eax,[CPU_FREQ]
2075
     mov  [esp+32], eax
2101
     mov  [esp+32], eax
2076
     ret
2102
     ret
2077
 
-
 
-
 
2103
;------------------------------------------------------------------------------
2078
;  SAVE ramdisk to /hd/1/menuet.img
2104
;  SAVE ramdisk to /hd/1/menuet.img
2079
;!!!!!!!!!!!!!!!!!!!!!!!!
2105
;!!!!!!!!!!!!!!!!!!!!!!!!
2080
   include 'blkdev/rdsave.inc'
2106
   include 'blkdev/rdsave.inc'
2081
;!!!!!!!!!!!!!!!!!!!!!!!!
2107
;!!!!!!!!!!!!!!!!!!!!!!!!
-
 
2108
;------------------------------------------------------------------------------
2082
align 4
2109
align 4
2083
sysfn_getactive:        ; 18.7 = get active window
2110
sysfn_getactive:        ; 18.7 = get active window
2084
     mov  eax, [TASK_COUNT]
2111
     mov  eax, [TASK_COUNT]
2085
   movzx  eax, word [WIN_POS + eax*2]
2112
   movzx  eax, word [WIN_POS + eax*2]
2086
     mov  [esp+32],eax
2113
     mov  [esp+32],eax
2087
     ret
2114
     ret
2088
 
-
 
-
 
2115
;------------------------------------------------------------------------------
2089
sysfn_sound_flag:       ; 18.8 = get/set sound_flag
2116
sysfn_sound_flag:       ; 18.8 = get/set sound_flag
2090
;     cmp  ecx,1
2117
;     cmp  ecx,1
2091
     dec  ecx
2118
     dec  ecx
2092
     jnz  nogetsoundflag
2119
     jnz  nogetsoundflag
2093
     movzx  eax,byte [sound_flag] ; get sound_flag
2120
     movzx  eax,byte [sound_flag] ; get sound_flag
Line 2098... Line 2125...
2098
     dec  ecx
2125
     dec  ecx
2099
     jnz  nosoundflag
2126
     jnz  nosoundflag
2100
     xor  byte [sound_flag], 1
2127
     xor  byte [sound_flag], 1
2101
 nosoundflag:
2128
 nosoundflag:
2102
     ret
2129
     ret
2103
 
-
 
-
 
2130
;------------------------------------------------------------------------------
2104
sysfn_minimize:         ; 18.10 = minimize window
2131
sysfn_minimize:         ; 18.10 = minimize window
2105
     mov   [window_minimize],1
2132
     mov   [window_minimize],1
2106
     ret
2133
     ret
-
 
2134
;------------------------------------------------------------------------------
2107
align 4
2135
align 4
2108
sysfn_getdiskinfo:      ; 18.11 = get disk info table
2136
sysfn_getdiskinfo:      ; 18.11 = get disk info table
2109
;     cmp  ecx,1
2137
;     cmp  ecx,1
2110
     dec  ecx
2138
     dec  ecx
2111
     jnz  full_table
2139
     jnz  full_table
Line 2126... Line 2154...
2126
     call for_all_tables
2154
     call for_all_tables
2127
     mov ecx,16384
2155
     mov ecx,16384
2128
     cld
2156
     cld
2129
     rep movsd
2157
     rep movsd
2130
     ret
2158
     ret
2131
 
-
 
-
 
2159
;------------------------------------------------------------------------------
2132
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2160
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2133
        and     dword [esp+32], 0
2161
        and     dword [esp+32], 0
2134
        ret
2162
        ret
2135
 
-
 
-
 
2163
;------------------------------------------------------------------------------
2136
sysfn_getversion:       ; 18.13 = get kernel ID and version
2164
sysfn_getversion:       ; 18.13 = get kernel ID and version
2137
     mov edi,ecx
2165
     mov edi,ecx
2138
     mov esi,version_inf
2166
     mov esi,version_inf
2139
     mov ecx,version_end-version_inf
2167
     mov ecx,version_end-version_inf
2140
     rep movsb
2168
     rep movsb
2141
     ret
2169
     ret
2142
 
-
 
-
 
2170
;------------------------------------------------------------------------------
2143
sysfn_waitretrace:     ; 18.14 = sys wait retrace
2171
sysfn_waitretrace:     ; 18.14 = sys wait retrace
2144
     ;wait retrace functions
2172
     ;wait retrace functions
2145
 sys_wait_retrace:
2173
 sys_wait_retrace:
2146
     mov edx,0x3da
2174
     mov edx,0x3da
2147
 WaitRetrace_loop:
2175
 WaitRetrace_loop:
2148
     in al,dx
2176
     in al,dx
2149
     test al,1000b
2177
     test al,1000b
2150
     jz WaitRetrace_loop
2178
     jz WaitRetrace_loop
2151
     and [esp+32],dword 0
2179
     and [esp+32],dword 0
2152
     ret
2180
     ret
2153
 
-
 
-
 
2181
;------------------------------------------------------------------------------
2154
align 4
2182
align 4
2155
sysfn_centermouse:      ; 18.15 = mouse centered
2183
sysfn_centermouse:      ; 18.15 = mouse centered
2156
; removed here by 
2184
; removed here by 
2157
;     call  mouse_centered
2185
;     call  mouse_centered
2158
;* mouse centered - start code- Mario79
2186
;* mouse centered - start code- Mario79
Line 2167... Line 2195...
2167
;        ret
2195
;        ret
2168
;* mouse centered - end code- Mario79
2196
;* mouse centered - end code- Mario79
2169
	xor   eax,eax
2197
	xor   eax,eax
2170
        and   [esp+32],eax
2198
        and   [esp+32],eax
2171
;        pop   eax
2199
;        pop   eax
2172
 
-
 
2173
     ret
2200
     ret
-
 
2201
;------------------------------------------------------------------------------
2174
align 4
2202
align 4
2175
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
2203
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
2176
     test ecx,ecx  ; get mouse speed factor
2204
     test ecx,ecx  ; get mouse speed factor
2177
     jnz  .set_mouse_acceleration
2205
     jnz  .set_mouse_acceleration
2178
     xor  eax,eax
2206
     xor  eax,eax
Line 2215... Line 2243...
2215
     jnz  .end
2243
     jnz  .end
2216
     mov   [BTN_DOWN],dl
2244
     mov   [BTN_DOWN],dl
2217
     mov   [mouse_active],1
2245
     mov   [mouse_active],1
2218
 .end:
2246
 .end:
2219
     ret
2247
     ret
2220
 
-
 
-
 
2248
;------------------------------------------------------------------------------
2221
sysfn_getfreemem:
2249
sysfn_getfreemem:
2222
     mov eax, [pg_data.pages_free]
2250
     mov eax, [pg_data.pages_free]
2223
     shl eax, 2
2251
     shl eax, 2
2224
     mov [esp+32],eax
2252
     mov [esp+32],eax
2225
     ret
2253
     ret