Rev 3520 | Rev 3535 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3520 | Rev 3534 | ||
---|---|---|---|
Line 69... | Line 69... | ||
69 | format binary as "mnt" |
69 | format binary as "mnt" |
Line 70... | Line 70... | ||
70 | 70 | ||
71 | include 'macros.inc' |
71 | include 'macros.inc' |
Line 72... | Line 72... | ||
72 | include 'struct.inc' |
72 | include 'struct.inc' |
Line 73... | Line 73... | ||
73 | 73 | ||
Line 74... | Line 74... | ||
74 | $Revision: 3520 $ |
74 | $Revision: 3534 $ |
Line 346... | Line 346... | ||
346 | call mutex_init |
346 | call mutex_init |
Line 347... | Line 347... | ||
347 | 347 | ||
348 | mov ecx, unpack_mutex |
348 | mov ecx, unpack_mutex |
Line -... | Line 349... | ||
- | 349 | call mutex_init |
|
- | 350 | ||
- | 351 | mov ecx, application_table_mutex |
|
349 | call mutex_init |
352 | call mutex_init |
350 | 353 | ||
351 | ; SAVE REAL MODE VARIABLES |
354 | ; SAVE REAL MODE VARIABLES |
352 | mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR] |
355 | mov ax, [BOOT_VAR + BOOT_IDE_BASE_ADDR] |
Line 521... | Line 524... | ||
521 | 524 | ||
522 | call build_interrupt_table ;lidt is executed |
525 | call build_interrupt_table ;lidt is executed |
Line 523... | Line 526... | ||
523 | ;lidt [idtreg] |
526 | ;lidt [idtreg] |
524 | 527 | ||
525 | call init_kernel_heap |
528 | call init_kernel_heap |
Line 526... | Line 529... | ||
526 | stdcall kernel_alloc, RING0_STACK_SIZE+512 |
529 | stdcall kernel_alloc, (RING0_STACK_SIZE+512) * 2 |
Line 527... | Line 530... | ||
527 | mov [os_stack_seg], eax |
530 | mov [os_stack_seg], eax |
Line 601... | Line 604... | ||
601 | stdcall kernel_alloc, [_WinMapSize] |
604 | stdcall kernel_alloc, [_WinMapSize] |
602 | mov [_WinMapAddress], eax |
605 | mov [_WinMapAddress], eax |
Line 603... | Line 606... | ||
603 | 606 | ||
604 | xor eax, eax |
607 | xor eax, eax |
605 | inc eax |
- | |
606 | mov [CURRENT_TASK], eax ;dword 1 |
- | |
607 | mov [TASK_COUNT], eax ;dword 1 |
- | |
608 | mov [TASK_BASE], dword TASK_DATA |
- | |
Line 609... | Line 608... | ||
609 | mov [current_slot], SLOT_BASE+256 |
608 | inc eax |
Line 610... | Line 609... | ||
610 | 609 | ||
611 | ; set background |
610 | ; set background |
Line 619... | Line 618... | ||
619 | ; SET UP OS TASK |
618 | ; SET UP OS TASK |
Line 620... | Line 619... | ||
620 | 619 | ||
621 | mov esi, boot_setostask |
620 | mov esi, boot_setostask |
Line 622... | Line 621... | ||
622 | call boot_log |
621 | call boot_log |
623 | - | ||
624 | xor eax, eax |
- | |
625 | mov dword [SLOT_BASE+APPDATA.fpu_state], fpu_data |
- | |
626 | mov dword [SLOT_BASE+APPDATA.exc_handler], eax |
- | |
627 | mov dword [SLOT_BASE+APPDATA.except_mask], eax |
- | |
628 | - | ||
629 | ; name for OS/IDLE process |
- | |
630 | - | ||
631 | mov dword [SLOT_BASE+256+APPDATA.app_name], dword 'OS/I' |
622 | |
632 | mov dword [SLOT_BASE+256+APPDATA.app_name+4], dword 'DLE ' |
- | |
633 | mov edi, [os_stack_seg] |
623 | mov edx, SLOT_BASE+256 |
634 | mov dword [SLOT_BASE+256+APPDATA.pl0_stack], edi |
- | |
635 | add edi, 0x2000-512 |
- | |
636 | mov dword [SLOT_BASE+256+APPDATA.fpu_state], edi |
- | |
637 | mov dword [SLOT_BASE+256+APPDATA.saved_esp0], edi; just for case |
- | |
638 | mov dword [SLOT_BASE+256+APPDATA.terminate_protection], 80000001h |
624 | mov ebx, [os_stack_seg] |
639 | 625 | add ebx, 0x2000 |
|
640 | mov esi, fpu_data |
- | |
641 | mov ecx, 512/4 |
- | |
642 | cld |
- | |
643 | rep movsd |
626 | call setup_os_slot |
644 | 627 | mov dword [edx], 'IDLE' |
|
645 | mov dword [SLOT_BASE+256+APPDATA.exc_handler], eax |
- | |
646 | mov dword [SLOT_BASE+256+APPDATA.except_mask], eax |
628 | sub [edx+APPDATA.saved_esp], 4 |
647 | 629 | mov eax, [edx+APPDATA.saved_esp] |
|
648 | mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET |
630 | mov dword [eax], idle_thread |
649 | mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx |
631 | mov ecx, IDLE_PRIORITY |
650 | mov dword [SLOT_BASE+256+APPDATA.bk_obj], ebx |
- | |
651 | 632 | call scheduler_add_thread |
|
652 | mov dword [SLOT_BASE+256+APPDATA.cur_dir], sysdir_path |
- | |
653 | mov dword [SLOT_BASE+256+APPDATA.tls_base], eax |
633 | |
654 | - | ||
655 | ; task list |
634 | mov edx, SLOT_BASE+256*2 |
656 | mov dword [TASK_DATA+TASKDATA.mem_start], eax; process base address |
635 | mov ebx, [os_stack_seg] |
657 | inc eax |
636 | call setup_os_slot |
658 | mov dword [CURRENT_TASK], eax |
637 | mov dword [edx], 'OS' |
659 | mov dword [TASK_COUNT], eax |
- | |
660 | mov [current_slot], SLOT_BASE+256 |
- | |
661 | mov [TASK_BASE], dword TASK_DATA |
- | |
Line -... | Line 638... | ||
- | 638 | xor ecx, ecx |
|
- | 639 | call scheduler_add_thread |
|
662 | mov byte[TASK_DATA+TASKDATA.wnd_number], al ; on screen number |
640 | |
- | 641 | mov dword [CURRENT_TASK], 2 |
|
Line 663... | Line 642... | ||
663 | mov dword [TASK_DATA+TASKDATA.pid], eax ; process id number |
642 | mov dword [TASK_COUNT], 2 |
664 | 643 | mov dword [current_slot], SLOT_BASE + 256*2 |
|
665 | mov [SLOT_BASE + 256 + APPDATA.dir_table], sys_pgdir - OS_BASE |
644 | mov dword [TASK_BASE], CURRENT_TASK + 32*2 |
666 | 645 | ||
Line 826... | Line 805... | ||
826 | call boot_log |
805 | call boot_log |
827 | call reserve_irqs_ports |
806 | call reserve_irqs_ports |
Line 828... | Line 807... | ||
828 | 807 | ||
829 | call init_display |
808 | call init_display |
830 | mov eax, [def_cursor] |
- | |
831 | mov [SLOT_BASE+APPDATA.cursor], eax |
809 | mov eax, [def_cursor] |
- | 810 | mov [SLOT_BASE+APPDATA.cursor+256], eax |
|
Line 832... | Line 811... | ||
832 | mov [SLOT_BASE+APPDATA.cursor+256], eax |
811 | mov [SLOT_BASE+APPDATA.cursor+256*2], eax |
Line 833... | Line 812... | ||
833 | 812 | ||
834 | ; PRINT CPU FREQUENCY |
813 | ; PRINT CPU FREQUENCY |
Line 945... | Line 924... | ||
945 | 924 | ||
Line 946... | Line 925... | ||
946 | first_app_found: |
925 | first_app_found: |
Line 947... | Line -... | ||
947 | - | ||
948 | cli |
- | |
949 | - | ||
950 | ;mov [TASK_COUNT],dword 2 |
- | |
951 | push 1 |
926 | |
952 | pop dword [CURRENT_TASK] ; set OS task fisrt |
927 | cli |
953 | 928 | ||
954 | ; SET KEYBOARD PARAMETERS |
929 | ; SET KEYBOARD PARAMETERS |
955 | mov al, 0xf6 ; reset keyboard, scan enabled |
930 | mov al, 0xf6 ; reset keyboard, scan enabled |
Line 1066... | Line 1041... | ||
1066 | cmp [IDEContrRegsBaseAddr], 0 |
1041 | cmp [IDEContrRegsBaseAddr], 0 |
1067 | setnz [dma_hdd] |
1042 | setnz [dma_hdd] |
1068 | mov [timer_ticks_enable], 1 ; for cd driver |
1043 | mov [timer_ticks_enable], 1 ; for cd driver |
Line 1069... | Line 1044... | ||
1069 | 1044 | ||
1070 | sti |
1045 | sti |
Line 1071... | Line 1046... | ||
1071 | call change_task |
1046 | ; call change_task |
Line 1072... | Line 1047... | ||
1072 | 1047 | ||
Line 1095... | Line 1070... | ||
1095 | 1070 | ||
Line 1096... | Line 1071... | ||
1096 | popad |
1071 | popad |
Line -... | Line 1072... | ||
- | 1072 | ||
- | 1073 | ret |
|
- | 1074 | ||
- | 1075 | ; in: edx -> APPDATA for OS/IDLE slot |
|
- | 1076 | ; in: ebx = stack base |
|
- | 1077 | proc setup_os_slot |
|
- | 1078 | xor eax, eax |
|
- | 1079 | mov ecx, 256/4 |
|
- | 1080 | mov edi, edx |
|
- | 1081 | rep stosd |
|
- | 1082 | ||
- | 1083 | mov dword [edx+APPDATA.pl0_stack], ebx |
|
- | 1084 | lea edi, [ebx+0x2000-512] |
|
- | 1085 | mov dword [edx+APPDATA.fpu_state], edi |
|
- | 1086 | mov dword [edx+APPDATA.saved_esp0], edi |
|
- | 1087 | mov dword [edx+APPDATA.saved_esp], edi |
|
- | 1088 | mov dword [edx+APPDATA.terminate_protection], 1 ; make unkillable |
|
- | 1089 | ||
- | 1090 | mov esi, fpu_data |
|
- | 1091 | mov ecx, 512/4 |
|
- | 1092 | cld |
|
- | 1093 | rep movsd |
|
- | 1094 | ||
- | 1095 | lea eax, [edx+APP_OBJ_OFFSET] |
|
- | 1096 | mov dword [edx+APPDATA.fd_obj], eax |
|
- | 1097 | mov dword [edx+APPDATA.bk_obj], eax |
|
- | 1098 | ||
- | 1099 | mov dword [edx+APPDATA.cur_dir], sysdir_path |
|
- | 1100 | ||
- | 1101 | mov [edx + APPDATA.dir_table], sys_pgdir - OS_BASE |
|
- | 1102 | ||
- | 1103 | mov eax, edx |
|
- | 1104 | shr eax, 3 |
|
- | 1105 | add eax, CURRENT_TASK - (SLOT_BASE shr 3) |
|
- | 1106 | mov [eax+TASKDATA.wnd_number], dh |
|
- | 1107 | mov byte [eax+TASKDATA.pid], dh |
|
- | 1108 | ||
1097 | 1109 | ret |
|
1098 | ret |
1110 | endp |
1099 | 1111 | ||
1100 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1112 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1101 | ; ; |
1113 | ; ; |
1102 | ; MAIN OS LOOP START ; |
1114 | ; MAIN OS LOOP START ; |
1103 | ; ; |
1115 | ; ; |
- | 1116 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 1117 | align 32 |
|
- | 1118 | osloop: |
|
- | 1119 | mov edx, osloop_has_work? |
|
- | 1120 | xor ecx, ecx |
|
- | 1121 | call Wait_events |
|
- | 1122 | xor eax, eax |
|
1104 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1123 | xchg eax, [osloop_nonperiodic_work] |
1105 | align 32 |
1124 | test eax, eax |
1106 | osloop: |
1125 | jz .no_periodic |
1107 | ; call [draw_pointer] |
1126 | ; call [draw_pointer] |
1108 | call __sys_draw_pointer |
1127 | call __sys_draw_pointer |
1109 | call window_check_events |
1128 | call window_check_events |
- | 1129 | call mouse_check_events |
|
1110 | call mouse_check_events |
1130 | call checkmisc |
1111 | call checkmisc |
- | |
1112 | call checkVga_N13 |
1131 | call checkVga_N13 |
1113 | call stack_handler |
1132 | .no_periodic: |
1114 | call checkidle |
1133 | call stack_handler |
1115 | call check_fdd_motor_status |
1134 | call check_fdd_motor_status |
1116 | call check_ATAPI_device_event |
1135 | call check_ATAPI_device_event |
1117 | call check_lights_state |
1136 | call check_lights_state |
1118 | call check_timers |
1137 | call check_timers |
1119 | jmp osloop |
1138 | jmp osloop |
1120 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1139 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1121 | ; ; |
1140 | ; ; |
1122 | ; MAIN OS LOOP END ; |
1141 | ; MAIN OS LOOP END ; |
1123 | ; ; |
1142 | ; ; |
1124 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1143 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1125 | align 4 |
1144 | proc osloop_has_work? |
1126 | checkidle: |
1145 | cmp [osloop_nonperiodic_work], 0 |
1127 | pushad |
- | |
1128 | call change_task |
1146 | jnz .yes |
1129 | jmp idle_loop_entry |
1147 | call stack_handler_has_work? |
1130 | idle_loop: |
1148 | jnz .yes |
1131 | cmp eax, [idlemem] ; eax == [timer_ticks] |
1149 | call check_fdd_motor_status_has_work? |
- | 1150 | jnz .yes |
|
1132 | jne idle_exit |
1151 | call check_ATAPI_device_event_has_work? |
1133 | rdtsc ;call _rdtsc |
1152 | jnz .yes |
1134 | mov ecx, eax |
1153 | call check_lights_state_has_work? |
- | 1154 | jnz .yes |
|
1135 | hlt |
1155 | call check_timers_has_work? |
1136 | rdtsc ;call _rdtsc |
1156 | jnz .yes |
1137 | sub eax, ecx |
- | |
- | 1157 | .no: |
|
1138 | add [idleuse], eax |
1158 | xor eax, eax |
1139 | idle_loop_entry: |
1159 | ret |
1140 | mov eax, [timer_ticks]; eax = [timer_ticks] |
1160 | .yes: |
- | 1161 | xor eax, eax |
|
- | 1162 | inc eax |
|
1141 | cmp [check_idle_semaphore], 0 |
1163 | ret |
1142 | je idle_loop |
1164 | endp |
1143 | dec [check_idle_semaphore] |
- | |
1144 | idle_exit: |
1165 | |
- | 1166 | proc wakeup_osloop |
|
Line 1145... | Line 1167... | ||
1145 | mov [idlemem], eax ; eax == [timer_ticks] |
1167 | mov [osloop_nonperiodic_work], 1 |
1146 | popad |
- | |
1147 | ret |
- | |
1148 | 1168 | ret |
|
1149 | uglobal |
1169 | endp |
1150 | idlemem dd 0x0 |
1170 | |
Line -... | Line 1171... | ||
- | 1171 | uglobal |
|
- | 1172 | align 4 |
|
- | 1173 | osloop_nonperiodic_work dd ? |
|
- | 1174 | endg |
|
- | 1175 | ||
- | 1176 | align 4 |
|
- | 1177 | idle_thread: |
|
Line 1151... | Line 1178... | ||
1151 | idleuse dd 0x0 |
1178 | sti |
1152 | idleusesec dd 0x0 |
1179 | idle_loop: |
1153 | check_idle_semaphore dd 0x0 |
1180 | hlt |
Line 1198... | Line 1225... | ||
1198 | 1225 | ||
Line 1199... | Line 1226... | ||
1199 | ret |
1226 | ret |
1200 | 1227 | ||
1201 | 1228 | ||
Line 1202... | Line 1229... | ||
1202 | iglobal |
1229 | iglobal |
Line 1203... | Line 1230... | ||
1203 | process_number dd 0x1 |
1230 | process_number dd 0x2 |
Line 1215... | Line 1242... | ||
1215 | shr ax, 1 |
1242 | shr ax, 1 |
1216 | shl eax, 16 |
1243 | shl eax, 16 |
1217 | mov ax, [BOOT_VAR+BOOT_X_RES] |
1244 | mov ax, [BOOT_VAR+BOOT_X_RES] |
1218 | shr ax, 1 |
1245 | shr ax, 1 |
1219 | mov [MOUSE_X], eax |
1246 | mov [MOUSE_X], eax |
- | 1247 | call wakeup_osloop |
|
Line 1220... | Line 1248... | ||
1220 | 1248 | ||
1221 | xor eax, eax |
1249 | xor eax, eax |
Line 1222... | Line 1250... | ||
1222 | mov [BTN_ADDR], dword BUTTON_INFO ; address of button list |
1250 | mov [BTN_ADDR], dword BUTTON_INFO ; address of button list |
Line 2005... | Line 2033... | ||
2005 | stdcall user_free, eax |
2033 | stdcall user_free, eax |
2006 | @@: |
2034 | @@: |
Line 2007... | Line 2035... | ||
2007 | 2035 | ||
2008 | mov eax, [TASK_BASE] |
2036 | mov eax, [TASK_BASE] |
- | 2037 | mov [eax+TASKDATA.state], 3; terminate this program |
|
Line 2009... | Line 2038... | ||
2009 | mov [eax+TASKDATA.state], 3; terminate this program |
2038 | call wakeup_osloop |
2010 | 2039 | ||
2011 | waitterm: ; wait here for termination |
2040 | waitterm: ; wait here for termination |
2012 | mov ebx, 100 |
2041 | mov ebx, 100 |
Line 2038... | Line 2067... | ||
2038 | push esi |
2067 | push esi |
2039 | call [_display.select_cursor] |
2068 | call [_display.select_cursor] |
2040 | mov [current_cursor], esi |
2069 | mov [current_cursor], esi |
2041 | @@: |
2070 | @@: |
2042 | mov [redrawmouse_unconditional], 1 |
2071 | mov [redrawmouse_unconditional], 1 |
- | 2072 | call wakeup_osloop |
|
2043 | popfd |
2073 | popfd |
2044 | ret |
2074 | ret |
2045 | ;------------------------------------------------------------------------------ |
2075 | ;------------------------------------------------------------------------------ |
2046 | iglobal |
2076 | iglobal |
2047 | align 4 |
2077 | align 4 |
Line 2090... | Line 2120... | ||
2090 | mov [BOOT_VAR+0x9030], cl |
2120 | mov [BOOT_VAR+0x9030], cl |
Line 2091... | Line 2121... | ||
2091 | 2121 | ||
2092 | mov eax, [TASK_COUNT] |
2122 | mov eax, [TASK_COUNT] |
2093 | mov [SYS_SHUTDOWN], al |
2123 | mov [SYS_SHUTDOWN], al |
- | 2124 | mov [shutdown_processes], eax |
|
2094 | mov [shutdown_processes], eax |
2125 | call wakeup_osloop |
2095 | and dword [esp+32], 0 |
2126 | and dword [esp+32], 0 |
2096 | exit_for_anyone: |
2127 | exit_for_anyone: |
2097 | ret |
2128 | ret |
2098 | uglobal |
2129 | uglobal |
Line 2135... | Line 2166... | ||
2135 | popa |
2166 | popa |
2136 | .restore_end: |
2167 | .restore_end: |
2137 | ;-------------------------------------- |
2168 | ;-------------------------------------- |
2138 | ;call MEM_Heap_Lock ;guarantee that process isn't working with heap |
2169 | ;call MEM_Heap_Lock ;guarantee that process isn't working with heap |
2139 | mov [ecx], byte 3; clear possible i40's |
2170 | mov [ecx], byte 3; clear possible i40's |
- | 2171 | call wakeup_osloop |
|
2140 | ;call MEM_Heap_UnLock |
2172 | ;call MEM_Heap_UnLock |
Line 2141... | Line 2173... | ||
2141 | 2173 | ||
2142 | cmp edx, [application_table_status]; clear app table stat |
2174 | cmp edx, [application_table_owner]; clear app table stat |
2143 | jne noatsc |
2175 | jne noatsc |
2144 | and [application_table_status], 0 |
2176 | call unlock_application_table |
2145 | noatsc: |
2177 | noatsc: |
2146 | noprocessterminate: |
2178 | noprocessterminate: |
2147 | add esp, 4 |
2179 | add esp, 4 |
2148 | ret |
2180 | ret |
2149 | ;------------------------------------------------------------------------------ |
2181 | ;------------------------------------------------------------------------------ |
2150 | sysfn_terminate2: |
2182 | sysfn_terminate2: |
2151 | ;lock application_table_status mutex |
2183 | ;lock application_table_status mutex |
2152 | .table_status: |
- | |
2153 | cli |
- | |
2154 | cmp [application_table_status], 0 |
- | |
2155 | je .stf |
- | |
2156 | sti |
- | |
2157 | call change_task |
- | |
2158 | jmp .table_status |
- | |
2159 | .stf: |
2184 | .table_status: |
2160 | call set_application_table_status |
2185 | call lock_application_table |
2161 | mov eax, ecx |
2186 | mov eax, ecx |
2162 | call pid_to_slot |
2187 | call pid_to_slot |
2163 | test eax, eax |
2188 | test eax, eax |
2164 | jz .not_found |
2189 | jz .not_found |
2165 | mov ecx, eax |
2190 | mov ecx, eax |
2166 | cli |
2191 | cli |
2167 | call sysfn_terminate |
2192 | call sysfn_terminate |
2168 | and [application_table_status], 0 |
2193 | call unlock_application_table |
2169 | sti |
2194 | sti |
2170 | and dword [esp+32], 0 |
2195 | and dword [esp+32], 0 |
2171 | ret |
2196 | ret |
2172 | .not_found: |
2197 | .not_found: |
2173 | mov [application_table_status], 0 |
2198 | call unlock_application_table |
2174 | or dword [esp+32], -1 |
2199 | or dword [esp+32], -1 |
2175 | ret |
2200 | ret |
2176 | ;------------------------------------------------------------------------------ |
2201 | ;------------------------------------------------------------------------------ |
2177 | sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW |
2202 | sysfn_deactivate: ; 18.1 = DEACTIVATE WINDOW |
Line 2217... | Line 2242... | ||
2217 | call change_task |
2242 | call change_task |
2218 | jmp @b |
2243 | jmp @b |
2219 | @@: |
2244 | @@: |
2220 | ;------------------------------------- |
2245 | ;------------------------------------- |
2221 | mov [window_minimize], 2; restore window if minimized |
2246 | mov [window_minimize], 2; restore window if minimized |
- | 2247 | call wakeup_osloop |
|
Line 2222... | Line 2248... | ||
2222 | 2248 | ||
2223 | movzx esi, word [WIN_STACK + ecx*2] |
2249 | movzx esi, word [WIN_STACK + ecx*2] |
2224 | cmp esi, [TASK_COUNT] |
2250 | cmp esi, [TASK_COUNT] |
Line 2232... | Line 2258... | ||
2232 | call waredraw |
2258 | call waredraw |
2233 | .nowindowactivate: |
2259 | .nowindowactivate: |
2234 | ret |
2260 | ret |
2235 | ;------------------------------------------------------------------------------ |
2261 | ;------------------------------------------------------------------------------ |
2236 | sysfn_getidletime: ; 18.4 = GET IDLETIME |
2262 | sysfn_getidletime: ; 18.4 = GET IDLETIME |
2237 | mov eax, [idleusesec] |
2263 | mov eax, [CURRENT_TASK+32+TASKDATA.cpu_usage] |
2238 | mov [esp+32], eax |
2264 | mov [esp+32], eax |
2239 | ret |
2265 | ret |
2240 | ;------------------------------------------------------------------------------ |
2266 | ;------------------------------------------------------------------------------ |
2241 | sysfn_getcpuclock: ; 18.5 = GET TSC/SEC |
2267 | sysfn_getcpuclock: ; 18.5 = GET TSC/SEC |
2242 | mov eax, dword [cpu_freq] |
2268 | mov eax, dword [cpu_freq] |
Line 2274... | Line 2300... | ||
2274 | nosoundflag: |
2300 | nosoundflag: |
2275 | ret |
2301 | ret |
2276 | ;------------------------------------------------------------------------------ |
2302 | ;------------------------------------------------------------------------------ |
2277 | sysfn_minimize: ; 18.10 = minimize window |
2303 | sysfn_minimize: ; 18.10 = minimize window |
2278 | mov [window_minimize], 1 |
2304 | mov [window_minimize], 1 |
- | 2305 | call wakeup_osloop |
|
2279 | ret |
2306 | ret |
2280 | ;------------------------------------------------------------------------------ |
2307 | ;------------------------------------------------------------------------------ |
2281 | align 4 |
2308 | align 4 |
2282 | sysfn_getdiskinfo: ; 18.11 = get disk info table |
2309 | sysfn_getdiskinfo: ; 18.11 = get disk info table |
2283 | ; cmp ecx,1 |
2310 | ; cmp ecx,1 |
Line 2336... | Line 2363... | ||
2336 | shr eax, 1 |
2363 | shr eax, 1 |
2337 | mov [MOUSE_X], ax |
2364 | mov [MOUSE_X], ax |
2338 | mov eax, [Screen_Max_Y] |
2365 | mov eax, [Screen_Max_Y] |
2339 | shr eax, 1 |
2366 | shr eax, 1 |
2340 | mov [MOUSE_Y], ax |
2367 | mov [MOUSE_Y], ax |
- | 2368 | call wakeup_osloop |
|
2341 | ; ret |
2369 | ; ret |
2342 | ;* mouse centered - end code- Mario79 |
2370 | ;* mouse centered - end code- Mario79 |
2343 | xor eax, eax |
2371 | xor eax, eax |
2344 | and [esp+32], eax |
2372 | and [esp+32], eax |
2345 | ; pop eax |
2373 | ; pop eax |
Line 2380... | Line 2408... | ||
2380 | ja .end |
2408 | ja .end |
2381 | rol edx, 16 |
2409 | rol edx, 16 |
2382 | cmp dx, word[Screen_Max_X] |
2410 | cmp dx, word[Screen_Max_X] |
2383 | ja .end |
2411 | ja .end |
2384 | mov [MOUSE_X], edx |
2412 | mov [MOUSE_X], edx |
- | 2413 | call wakeup_osloop |
|
2385 | ret |
2414 | ret |
2386 | .set_mouse_button: |
2415 | .set_mouse_button: |
2387 | ; cmp ecx,5 ; set mouse button features |
2416 | ; cmp ecx,5 ; set mouse button features |
2388 | dec ecx |
2417 | dec ecx |
2389 | jnz .end |
2418 | jnz .end |
2390 | mov [BTN_DOWN], dl |
2419 | mov [BTN_DOWN], dl |
2391 | mov [mouse_active], 1 |
2420 | mov [mouse_active], 1 |
- | 2421 | call wakeup_osloop |
|
2392 | .end: |
2422 | .end: |
2393 | ret |
2423 | ret |
2394 | ;------------------------------------------------------------------------------ |
2424 | ;------------------------------------------------------------------------------ |
2395 | sysfn_getfreemem: |
2425 | sysfn_getfreemem: |
2396 | mov eax, [pg_data.pages_free] |
2426 | mov eax, [pg_data.pages_free] |
Line 2846... | Line 2876... | ||
2846 | 2876 | ||
2847 | mov [draw_data+32 + RECT.right], ecx |
2877 | mov [draw_data+32 + RECT.right], ecx |
Line 2848... | Line 2878... | ||
2848 | mov [draw_data+32 + RECT.bottom], edx |
2878 | mov [draw_data+32 + RECT.bottom], edx |
- | 2879 | ||
2849 | 2880 | inc byte[REDRAW_BACKGROUND] |
|
2850 | inc byte[REDRAW_BACKGROUND] |
2881 | call wakeup_osloop |
2851 | ;-------------------------------------- |
2882 | ;-------------------------------------- |
2852 | align 4 |
2883 | align 4 |
2853 | .exit: |
2884 | .exit: |
Line 2872... | Line 2903... | ||
2872 | mov ebx, [Screen_Max_Y] |
2903 | mov ebx, [Screen_Max_Y] |
2873 | mov [draw_data+32 + RECT.right], eax |
2904 | mov [draw_data+32 + RECT.right], eax |
2874 | mov [draw_data+32 + RECT.bottom], ebx |
2905 | mov [draw_data+32 + RECT.bottom], ebx |
2875 | pop ebx eax |
2906 | pop ebx eax |
2876 | inc byte[REDRAW_BACKGROUND] |
2907 | inc byte[REDRAW_BACKGROUND] |
- | 2908 | call wakeup_osloop |
|
2877 | ret |
2909 | ret |
2878 | ;------------------------------------------------------------------------------ |
2910 | ;------------------------------------------------------------------------------ |
2879 | align 4 |
2911 | align 4 |
2880 | sys_getbackground: |
2912 | sys_getbackground: |
2881 | ; cmp eax,1 ; SIZE |
2913 | ; cmp eax,1 ; SIZE |
Line 3530... | Line 3562... | ||
3530 | jz @f |
3562 | jz @f |
3531 | mov [edx+TASKDATA.state], byte 3 |
3563 | mov [edx+TASKDATA.state], byte 3 |
3532 | @@: |
3564 | @@: |
3533 | add edx, 0x20 |
3565 | add edx, 0x20 |
3534 | loop markz |
3566 | loop markz |
- | 3567 | call wakeup_osloop |
|
3535 | ;-------------------------------------- |
3568 | ;-------------------------------------- |
3536 | align 4 |
3569 | align 4 |
3537 | @@: |
3570 | @@: |
3538 | no_mark_system_shutdown: |
3571 | no_mark_system_shutdown: |
3539 | dec byte [SYS_SHUTDOWN] |
3572 | dec byte [SYS_SHUTDOWN] |
Line 3681... | Line 3714... | ||
3681 | mov dl, 1 |
3714 | mov dl, 1 |
3682 | ;-------------------------------------- |
3715 | ;-------------------------------------- |
3683 | align 4 |
3716 | align 4 |
3684 | @@: |
3717 | @@: |
3685 | add byte[REDRAW_BACKGROUND], dl |
3718 | add byte[REDRAW_BACKGROUND], dl |
- | 3719 | call wakeup_osloop |
|
3686 | jmp newdw8 |
3720 | jmp newdw8 |
3687 | ;-------------------------------------- |
3721 | ;-------------------------------------- |
3688 | align 4 |
3722 | align 4 |
3689 | .az: |
3723 | .az: |
3690 | mov eax, edi |
3724 | mov eax, edi |
Line 3702... | Line 3736... | ||
3702 | sub eax, draw_data-window_data |
3736 | sub eax, draw_data-window_data |
Line 3703... | Line 3737... | ||
3703 | 3737 | ||
3704 | cmp dword [esp], 1 |
3738 | cmp dword [esp], 1 |
3705 | jne nobgrd |
3739 | jne nobgrd |
- | 3740 | inc byte[REDRAW_BACKGROUND] |
|
3706 | inc byte[REDRAW_BACKGROUND] |
3741 | call wakeup_osloop |
3707 | ;-------------------------------------- |
3742 | ;-------------------------------------- |
3708 | align 4 |
3743 | align 4 |
3709 | newdw8: |
3744 | newdw8: |
Line 4696... | Line 4731... | ||
4696 | cmp word [msg_board_pos], ax |
4731 | cmp word [msg_board_pos], ax |
4697 | jbe @f |
4732 | jbe @f |
4698 | mov word [msg_board_pos], 10 |
4733 | mov word [msg_board_pos], 10 |
4699 | @@: |
4734 | @@: |
4700 | end if |
4735 | end if |
- | 4736 | if 0 |
|
- | 4737 | pusha |
|
- | 4738 | mov al, bl |
|
- | 4739 | mov edx, 402h |
|
- | 4740 | out dx, al |
|
- | 4741 | popa |
|
- | 4742 | end if |
|
4701 | inc ecx |
4743 | inc ecx |
4702 | and ecx, msg_board_data_size - 1 |
4744 | and ecx, msg_board_data_size - 1 |
4703 | mov [msg_board_count], ecx |
4745 | mov [msg_board_count], ecx |
4704 | mov [check_idle_semaphore], 5 |
- | |
4705 | ret |
4746 | ret |
4706 | .smbl1: |
4747 | .smbl1: |
4707 | cmp eax, 2 |
4748 | cmp eax, 2 |
4708 | jne .smbl2 |
4749 | jne .smbl2 |
4709 | test ecx, ecx |
4750 | test ecx, ecx |