Subversion Repositories Kolibri OS

Rev

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

Rev 2259 Rev 2268
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: 2259 $
71
$Revision: 2268 $
Line 865... Line 865...
865
        stdcall load_driver, ahci_driver
865
        stdcall load_driver, ahci_driver
Line 866... Line 866...
866
 
866
 
867
; LOAD FIRST APPLICATION
867
; LOAD FIRST APPLICATION
Line 868... Line 868...
868
        cli
868
        cli
869
 
869
 
Line 870... Line 870...
870
        cmp   byte [BOOT_VAR+0x9030],1
870
;        cmp   byte [BOOT_VAR+0x9030],1
871
        jne   no_load_vrr_m
871
;        jne   no_load_vrr_m
872
 
872
 
873
        mov     ebp, vrr_m
873
;        mov     ebp, vrr_m
874
        call    fs_execute_from_sysdir
874
;        call    fs_execute_from_sysdir
875
 
875
;
876
;        cmp   eax,2                  ; if vrr_m app found (PID=2)
876
;;        cmp   eax,2                  ; if vrr_m app found (PID=2)
877
	sub   eax,2
877
;	sub   eax,2
Line 878... Line 878...
878
        jz    first_app_found
878
;        jz    first_app_found
879
 
879
;
Line 880... Line 880...
880
no_load_vrr_m:
880
;no_load_vrr_m:
Line 1933... Line 1933...
1933
     jmp   waitterm
1933
     jmp   waitterm
Line 1934... Line 1934...
1934
 
1934
 
1935
iglobal
1935
iglobal
1936
align 4
1936
align 4
1937
sys_system_table:
1937
sys_system_table:
1938
        dd      exit_for_anyone         ; 1 = obsolete
1938
        dd      sysfn_deactivate        ; 1 = deactivate window
1939
        dd      sysfn_terminate         ; 2 = terminate thread
1939
        dd      sysfn_terminate         ; 2 = terminate thread
1940
        dd      sysfn_activate          ; 3 = activate window
1940
        dd      sysfn_activate          ; 3 = activate window
1941
        dd      sysfn_getidletime       ; 4 = get idle time
1941
        dd      sysfn_getidletime       ; 4 = get idle time
1942
        dd      sysfn_getcpuclock       ; 5 = get cpu clock
1942
        dd      sysfn_getcpuclock       ; 5 = get cpu clock
Line 1958... Line 1958...
1958
        dd      sysfn_meminfo           ; 20 = get extended memory info
1958
        dd      sysfn_meminfo           ; 20 = get extended memory info
1959
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
1959
        dd      sysfn_pid_to_slot       ; 21 = get slot number for pid
1960
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
1960
        dd      sysfn_min_rest_window   ; 22 = minimize and restore any window
1961
sysfn_num = ($ - sys_system_table)/4
1961
sysfn_num = ($ - sys_system_table)/4
1962
endg
1962
endg
1963
 
-
 
-
 
1963
;------------------------------------------------------------------------------
1964
sys_system:
1964
sys_system:
1965
        dec     ebx
1965
        dec     ebx
1966
        cmp     ebx, sysfn_num
1966
        cmp     ebx, sysfn_num
1967
        jae     @f
1967
        jae     @f
1968
        jmp     dword [sys_system_table + ebx*4]
1968
        jmp     dword [sys_system_table + ebx*4]
1969
@@:
1969
@@:
1970
        ret
1970
        ret
1971
 
-
 
1972
 
-
 
-
 
1971
;------------------------------------------------------------------------------
1973
sysfn_shutdown:          ; 18.9 = system shutdown
1972
sysfn_shutdown:          ; 18.9 = system shutdown
1974
     cmp  ecx,1
1973
     cmp  ecx,1
1975
     jl   exit_for_anyone
1974
     jl   exit_for_anyone
1976
     cmp  ecx,4
1975
     cmp  ecx,4
1977
     jg   exit_for_anyone
1976
     jg   exit_for_anyone
Line 1984... Line 1983...
1984
 exit_for_anyone:
1983
 exit_for_anyone:
1985
     ret
1984
     ret
1986
  uglobal
1985
  uglobal
1987
   shutdown_processes: dd 0x0
1986
   shutdown_processes: dd 0x0
1988
  endg
1987
  endg
1989
 
-
 
-
 
1988
;------------------------------------------------------------------------------
1990
sysfn_terminate:        ; 18.2 = TERMINATE
1989
sysfn_terminate:        ; 18.2 = TERMINATE
1991
     cmp  ecx,2
1990
     cmp  ecx,2
1992
     jb   noprocessterminate
1991
     jb   noprocessterminate
1993
     mov  edx,[TASK_COUNT]
1992
     mov  edx,[TASK_COUNT]
1994
     cmp  ecx,edx
1993
     cmp  ecx,edx
Line 2008... Line 2007...
2008
     jne  noatsc
2007
     jne  noatsc
2009
     and  [application_table_status],0
2008
     and  [application_table_status],0
2010
   noatsc:
2009
   noatsc:
2011
   noprocessterminate:
2010
   noprocessterminate:
2012
     ret
2011
     ret
2013
 
-
 
-
 
2012
;------------------------------------------------------------------------------
2014
sysfn_terminate2:
2013
sysfn_terminate2:
2015
;lock application_table_status mutex
2014
;lock application_table_status mutex
2016
.table_status:
2015
.table_status:
2017
    cli
2016
    cli
2018
    cmp    [application_table_status],0
2017
    cmp    [application_table_status],0
Line 2035... Line 2034...
2035
    ret
2034
    ret
2036
.not_found:
2035
.not_found:
2037
    mov    [application_table_status],0
2036
    mov    [application_table_status],0
2038
    or     dword [esp+32],-1
2037
    or     dword [esp+32],-1
2039
    ret
2038
    ret
-
 
2039
;------------------------------------------------------------------------------
-
 
2040
sysfn_deactivate:         ; 18.1 = DEACTIVATE WINDOW
-
 
2041
	cmp	ecx,2
-
 
2042
	jb	.nowindowdeactivate
-
 
2043
	cmp	ecx,[TASK_COUNT]
-
 
2044
	ja	.nowindowdeactivate	
Line -... Line 2045...
-
 
2045
	
-
 
2046
	movzx	esi, word [WIN_STACK + ecx*2]
-
 
2047
	cmp	esi, 1
-
 
2048
	je	.nowindowdeactivate ; already deactive
-
 
2049
 
-
 
2050
	mov	edi, ecx
-
 
2051
	shl	edi, 5
-
 
2052
	add	edi, window_data
-
 
2053
	movzx	esi, word [WIN_STACK + ecx * 2]
-
 
2054
	lea	esi, [WIN_POS + esi * 2]
-
 
2055
	call	window._.window_deactivate
-
 
2056
 
-
 
2057
	xor	eax, eax
-
 
2058
	mov	byte[MOUSE_BACKGROUND], al
-
 
2059
	mov	byte[DONT_DRAW_MOUSE], al
-
 
2060
	mov	byte[MOUSE_DOWN], 0
-
 
2061
 
-
 
2062
	call	syscall_display_settings._.calculate_whole_screen
-
 
2063
	call	syscall_display_settings._.redraw_whole_screen
-
 
2064
.nowindowdeactivate:
-
 
2065
	ret
2040
 
2066
 ;------------------------------------------------------------------------------   
2041
sysfn_activate:         ; 18.3 = ACTIVATE WINDOW
2067
sysfn_activate:         ; 18.3 = ACTIVATE WINDOW
2042
     cmp  ecx,2
2068
     cmp  ecx,2
2043
     jb   .nowindowactivate
2069
     jb   .nowindowactivate
2044
     cmp  ecx,[TASK_COUNT]
2070
     cmp  ecx,[TASK_COUNT]
Line 2056... Line 2082...
2056
     movzx esi, word [WIN_STACK + ecx * 2]
2082
     movzx esi, word [WIN_STACK + ecx * 2]
2057
     lea   esi, [WIN_POS + esi * 2]
2083
     lea   esi, [WIN_POS + esi * 2]
2058
     call  waredraw
2084
     call  waredraw
2059
.nowindowactivate:
2085
.nowindowactivate:
2060
     ret
2086
     ret
2061
 
-
 
-
 
2087
;------------------------------------------------------------------------------
2062
sysfn_getidletime:              ; 18.4 = GET IDLETIME
2088
sysfn_getidletime:              ; 18.4 = GET IDLETIME
2063
     mov  eax,[idleusesec]
2089
     mov  eax,[idleusesec]
2064
     mov  [esp+32], eax
2090
     mov  [esp+32], eax
2065
     ret
2091
     ret
2066
 
-
 
-
 
2092
;------------------------------------------------------------------------------
2067
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
2093
sysfn_getcpuclock:              ; 18.5 = GET TSC/SEC
2068
     mov  eax,[CPU_FREQ]
2094
     mov  eax,[CPU_FREQ]
2069
     mov  [esp+32], eax
2095
     mov  [esp+32], eax
2070
     ret
2096
     ret
2071
 
-
 
-
 
2097
;------------------------------------------------------------------------------
2072
;  SAVE ramdisk to /hd/1/menuet.img
2098
;  SAVE ramdisk to /hd/1/menuet.img
2073
;!!!!!!!!!!!!!!!!!!!!!!!!
2099
;!!!!!!!!!!!!!!!!!!!!!!!!
2074
   include 'blkdev/rdsave.inc'
2100
   include 'blkdev/rdsave.inc'
2075
;!!!!!!!!!!!!!!!!!!!!!!!!
2101
;!!!!!!!!!!!!!!!!!!!!!!!!
-
 
2102
;------------------------------------------------------------------------------
2076
align 4
2103
align 4
2077
sysfn_getactive:        ; 18.7 = get active window
2104
sysfn_getactive:        ; 18.7 = get active window
2078
     mov  eax, [TASK_COUNT]
2105
     mov  eax, [TASK_COUNT]
2079
   movzx  eax, word [WIN_POS + eax*2]
2106
   movzx  eax, word [WIN_POS + eax*2]
2080
     mov  [esp+32],eax
2107
     mov  [esp+32],eax
2081
     ret
2108
     ret
2082
 
-
 
-
 
2109
;------------------------------------------------------------------------------
2083
sysfn_sound_flag:       ; 18.8 = get/set sound_flag
2110
sysfn_sound_flag:       ; 18.8 = get/set sound_flag
2084
;     cmp  ecx,1
2111
;     cmp  ecx,1
2085
     dec  ecx
2112
     dec  ecx
2086
     jnz  nogetsoundflag
2113
     jnz  nogetsoundflag
2087
     movzx  eax,byte [sound_flag] ; get sound_flag
2114
     movzx  eax,byte [sound_flag] ; get sound_flag
Line 2092... Line 2119...
2092
     dec  ecx
2119
     dec  ecx
2093
     jnz  nosoundflag
2120
     jnz  nosoundflag
2094
     xor  byte [sound_flag], 1
2121
     xor  byte [sound_flag], 1
2095
 nosoundflag:
2122
 nosoundflag:
2096
     ret
2123
     ret
2097
 
-
 
-
 
2124
;------------------------------------------------------------------------------
2098
sysfn_minimize:         ; 18.10 = minimize window
2125
sysfn_minimize:         ; 18.10 = minimize window
2099
     mov   [window_minimize],1
2126
     mov   [window_minimize],1
2100
     ret
2127
     ret
-
 
2128
;------------------------------------------------------------------------------
2101
align 4
2129
align 4
2102
sysfn_getdiskinfo:      ; 18.11 = get disk info table
2130
sysfn_getdiskinfo:      ; 18.11 = get disk info table
2103
;     cmp  ecx,1
2131
;     cmp  ecx,1
2104
     dec  ecx
2132
     dec  ecx
2105
     jnz  full_table
2133
     jnz  full_table
Line 2120... Line 2148...
2120
     call for_all_tables
2148
     call for_all_tables
2121
     mov ecx,16384
2149
     mov ecx,16384
2122
     cld
2150
     cld
2123
     rep movsd
2151
     rep movsd
2124
     ret
2152
     ret
2125
 
-
 
-
 
2153
;------------------------------------------------------------------------------
2126
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2154
sysfn_lastkey:          ; 18.12 = return 0 (backward compatibility)
2127
        and     dword [esp+32], 0
2155
        and     dword [esp+32], 0
2128
        ret
2156
        ret
2129
 
-
 
-
 
2157
;------------------------------------------------------------------------------
2130
sysfn_getversion:       ; 18.13 = get kernel ID and version
2158
sysfn_getversion:       ; 18.13 = get kernel ID and version
2131
     mov edi,ecx
2159
     mov edi,ecx
2132
     mov esi,version_inf
2160
     mov esi,version_inf
2133
     mov ecx,version_end-version_inf
2161
     mov ecx,version_end-version_inf
2134
     rep movsb
2162
     rep movsb
2135
     ret
2163
     ret
2136
 
-
 
-
 
2164
;------------------------------------------------------------------------------
2137
sysfn_waitretrace:     ; 18.14 = sys wait retrace
2165
sysfn_waitretrace:     ; 18.14 = sys wait retrace
2138
     ;wait retrace functions
2166
     ;wait retrace functions
2139
 sys_wait_retrace:
2167
 sys_wait_retrace:
2140
     mov edx,0x3da
2168
     mov edx,0x3da
2141
 WaitRetrace_loop:
2169
 WaitRetrace_loop:
2142
     in al,dx
2170
     in al,dx
2143
     test al,1000b
2171
     test al,1000b
2144
     jz WaitRetrace_loop
2172
     jz WaitRetrace_loop
2145
     and [esp+32],dword 0
2173
     and [esp+32],dword 0
2146
     ret
2174
     ret
2147
 
-
 
-
 
2175
;------------------------------------------------------------------------------
2148
align 4
2176
align 4
2149
sysfn_centermouse:      ; 18.15 = mouse centered
2177
sysfn_centermouse:      ; 18.15 = mouse centered
2150
; removed here by 
2178
; removed here by 
2151
;     call  mouse_centered
2179
;     call  mouse_centered
2152
;* mouse centered - start code- Mario79
2180
;* mouse centered - start code- Mario79
Line 2161... Line 2189...
2161
;        ret
2189
;        ret
2162
;* mouse centered - end code- Mario79
2190
;* mouse centered - end code- Mario79
2163
	xor   eax,eax
2191
	xor   eax,eax
2164
        and   [esp+32],eax
2192
        and   [esp+32],eax
2165
;        pop   eax
2193
;        pop   eax
2166
 
-
 
2167
     ret
2194
     ret
-
 
2195
;------------------------------------------------------------------------------
2168
align 4
2196
align 4
2169
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
2197
sysfn_mouse_acceleration: ; 18.19 = set/get mouse features
2170
     test ecx,ecx  ; get mouse speed factor
2198
     test ecx,ecx  ; get mouse speed factor
2171
     jnz  .set_mouse_acceleration
2199
     jnz  .set_mouse_acceleration
2172
     xor  eax,eax
2200
     xor  eax,eax
Line 2209... Line 2237...
2209
     jnz  .end
2237
     jnz  .end
2210
     mov   [BTN_DOWN],dl
2238
     mov   [BTN_DOWN],dl
2211
     mov   [mouse_active],1
2239
     mov   [mouse_active],1
2212
 .end:
2240
 .end:
2213
     ret
2241
     ret
2214
 
-
 
-
 
2242
;------------------------------------------------------------------------------
2215
sysfn_getfreemem:
2243
sysfn_getfreemem:
2216
     mov eax, [pg_data.pages_free]
2244
     mov eax, [pg_data.pages_free]
2217
     shl eax, 2
2245
     shl eax, 2
2218
     mov [esp+32],eax
2246
     mov [esp+32],eax
2219
     ret
2247
     ret