1)fixed wrong exported LFB address

2)replace 0x3000 0x3004 0x3010 0x3020 whith symbolic constants


git-svn-id: svn://kolibrios.org@379 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-02-28 08:52:06 +00:00
parent 73c568fb03
commit 04929cf017
29 changed files with 555 additions and 555 deletions

View File

@ -18,7 +18,7 @@ sys_cd_audio:
cmp eax,2
jnz nocdtl
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add ebx,[edi]
call sys_cdtracklist

View File

@ -4,8 +4,8 @@
; Àâòîð èñõîäíîãî òåêñòà Êóëàêîâ Âëàäèìèð Ãåííàäüåâè÷.
; Àäàïòàöèÿ è äîðàáîòêà Mario79
give_back_application_data: ; переслать приложению
mov edi,[0x3010]
give_back_application_data: ; переслать приложению
mov edi,[TASK_BASE]
mov edi,[edi+TASKDATA.mem_start]
add edi,ecx
give_back_application_data_1:
@ -16,8 +16,8 @@ give_back_application_data_1:
rep movsd
ret
take_data_from_application: ; взять из приложения
mov esi,[0x3010]
take_data_from_application: ; взять из приложени
mov esi,[TASK_BASE]
mov esi,[esi+TASKDATA.mem_start]
add esi,ecx
take_data_from_application_1:
@ -66,7 +66,7 @@ FDC_C DB ?
FDC_H DB ?
FDC_R DB ?
FDC_N DB ?
; Счетчик повторения операции чтения
; Счетчик повторения операции чтени
ReadRepCounter DB ?
; Ñ÷åò÷èê ïîâòîðåíèÿ îïåðàöèè ðåêàëèáðîâêè
RecalRepCounter DB ?
@ -136,7 +136,7 @@ FDCDataOutput:
out DX,AL
@@End_5:
; popa
pop edx ecx eax
pop edx ecx eax
ret
;******************************************
@ -174,7 +174,7 @@ FDCDataInput:
;* ÎÁÐÀÁÎÒ×ÈÊ ÏÐÅÐÛÂÀÍÈß ÎÒ ÊÎÍÒÐÎËËÅÐÀ ÍÃÌÄ *
;*********************************************
FDCInterrupt:
; Установить флаг прерывания
; Установить флаг прерывани
mov [FDD_IntFlag],1
ret
@ -194,7 +194,7 @@ WaitFDCInterrupt:
pusha
; Ñáðîñèòü áàéò ñîñòîÿíèÿ îïåðàöèè
mov [FDC_Status],FDC_Normal
; Сбросить флаг прерывания
; Сбросить флаг прерывани
mov [FDD_IntFlag],0
; Îáíóëèòü ñ÷åò÷èê òèêîâ
mov eax,[timer_ticks]
@ -352,7 +352,7 @@ SeekTrack:
; Ïîäàòü êîìàíäó "Ïîèñê"
mov AL,0Fh
call FDCDataOutput
; Передать байт номера головки/накопителя
; Передать байт номера головки/накопител
mov AL,[FDD_Head]
shl AL,2
call FDCDataOutput
@ -467,15 +467,15 @@ ReadSectWithRetr:
; Îáíóëèòü ñ÷åò÷èê ïîâòîðåíèÿ îïåðàöèè ðåêàëèáðîâêè
mov [RecalRepCounter],0
@@TryAgain:
; Обнулить счетчик повторения операции чтения
; Обнулить счетчик повторения операции чтени
mov [ReadRepCounter],0
@@ReadSector_1:
call ReadSector
cmp [FDC_Status],0
je @@Exit_2
cmp [FDC_Status],1
je @@Err_3
; Троекратное повторение чтения
je @@Err_3
; Троекратное повторение чтени
inc [ReadRepCounter]
cmp [ReadRepCounter],3
jb @@ReadSector_1
@ -565,7 +565,7 @@ WriteSectWithRetr:
; Îáíóëèòü ñ÷åò÷èê ïîâòîðåíèÿ îïåðàöèè ðåêàëèáðîâêè
mov [RecalRepCounter],0
@@TryAgain_1:
; Обнулить счетчик повторения операции чтения
; Обнулить счетчик повторения операции чтени
mov [ReadRepCounter],0
@@WriteSector_1:
call WriteSector
@ -573,7 +573,7 @@ WriteSectWithRetr:
je @@Exit_4
cmp [FDC_Status],1
je @@Err_4
; Троекратное повторение чтения
; Троекратное повторение чтени
inc [ReadRepCounter]
cmp [ReadRepCounter],3
jb @@WriteSector_1

View File

@ -19,7 +19,7 @@ sys_debug_services_table:
debug_set_event_data:
; in: ebx = pointer
; destroys eax
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
mov [eax+0x80000+APPDATA.dbg_event_mem], ebx
ret
@ -36,7 +36,7 @@ get_debuggee_slot:
jz .ret_bad
shl eax, 5
push ebx
mov ebx, [0x3000]
mov ebx, [CURRENT_TASK]
cmp [0x80000+eax*8+APPDATA.debugger_slot], ebx
pop ebx
jnz .ret_bad
@ -72,13 +72,13 @@ debug_suspend:
; destroys eax,ebx
call get_debuggee_slot
jc .ret
mov bl, [0x3000+eax+TASKDATA.state] ; process state
mov bl, [CURRENT_TASK+eax+TASKDATA.state] ; process state
test bl, bl
jz .1
cmp bl, 5
jnz .ret
mov bl, 2
.2: mov [0x3000+eax+TASKDATA.state], bl
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl
.ret:
sti
ret
@ -87,13 +87,13 @@ debug_suspend:
jmp .2
do_resume:
mov bl, [0x3000+eax+TASKDATA.state]
mov bl, [CURRENT_TASK+eax+TASKDATA.state]
cmp bl, 1
jz .1
cmp bl, 2
jnz .ret
mov bl, 5
.2: mov [0x3000+eax+TASKDATA.state], bl
.2: mov [CURRENT_TASK+eax+TASKDATA.state], bl
.ret: ret
.1: dec ebx
jmp .2
@ -380,7 +380,7 @@ debugger_notify:
pop ecx
pop ecx
pop ecx
cmp dword [0x3000], 1
cmp dword [CURRENT_TASK], 1
jnz .notos
cmp [timer_ticks], edi
jae .ret
@ -430,7 +430,7 @@ debug_exc:
jns @f
; this is exception from task switch
; set DRx registers for task and continue
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
add eax, 0x80000+APPDATA.dbg_regs
mov ecx, [eax+0]
@ -453,7 +453,7 @@ debug_exc:
mov dr6, eax
; test if debugging
cli
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
mov eax, [0x80000+eax+APPDATA.debugger_slot]
test eax, eax
@ -463,7 +463,7 @@ debug_exc:
add esp, 28h+4
mov [error_interrupt], 1
call show_error_parameters
mov edx, [0x3010]
mov edx, [TASK_BASE]
mov byte [edx+TASKDATA.state], 4
jmp change_task
.debug:
@ -483,7 +483,7 @@ debug_exc:
cmp cl, not 10h
jnz .l1
push edx ; DR6 image
mov ecx, [0x3010]
mov ecx, [TASK_BASE]
push dword [ecx+TASKDATA.pid] ; PID
push 12
pop ecx
@ -492,7 +492,7 @@ debug_exc:
pop ecx
pop ecx
pop ecx
mov edx, [0x3010]
mov edx, [TASK_BASE]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task
restore_ring3_context

View File

@ -395,7 +395,7 @@ proc init_LFB
mov edx, LFB_BASE
mov esi, [LFBAddress]
mov edi, [LFBSize]
mov dword [exp_lfb+4], esi
mov dword [exp_lfb+4], edx
shr edi, 12
mov [pg_count], edi

View File

@ -48,7 +48,7 @@ irq0:
jnz .return
call do_change_task
.return:
restore_ring3_context
iret
@ -67,11 +67,11 @@ change_task:
jne .find_next_task
mov [dma_task_switched], 0
mov ebx, [dma_process]
cmp [0x3000], ebx
cmp [CURRENT_TASK], ebx
je .return
mov edi, [dma_slot_ptr]
mov [0x3000], ebx
mov [0x3010], edi
mov [CURRENT_TASK], ebx
mov [TASK_BASE], edi
jmp @f
.find_next_task:
; \end{Mario79}
@ -103,7 +103,7 @@ endg
update_counters:
mov edi, [0x3010]
mov edi, [TASK_BASE]
mov ebx, [edi+TASKDATA.counter_add] ; time stamp counter add
call _rdtsc
sub eax, ebx
@ -119,17 +119,17 @@ ret
; [0x3000] = ebx and [0x3010] = edi
; corrupts other regs
find_next_task:
mov ebx, [0x3000]
mov edi, [0x3010]
mov ebx, [CURRENT_TASK]
mov edi, [TASK_BASE]
mov [prev_slot], ebx
.waiting_for_termination:
.waiting_for_reuse:
.waiting_for_event:
.suspended:
cmp ebx, [0x3004]
cmp ebx, [TASK_COUNT]
jb @f
mov edi, 0x3000
mov edi, CURRENT_TASK
xor ebx, ebx
@@:
@ -150,8 +150,8 @@ find_next_task:
cmp al, 9
je .waiting_for_reuse
mov [0x3000],ebx
mov [0x3010],edi
mov [CURRENT_TASK],ebx
mov [TASK_BASE],edi
cmp al, 5
jne .noevents
@ -162,8 +162,8 @@ find_next_task:
mov [edi+TASKDATA.state], byte 0
.noevents:
.found:
mov [0x3000],ebx
mov [0x3010],edi
mov [CURRENT_TASK],ebx
mov [TASK_BASE],edi
call _rdtsc
mov [edi+TASKDATA.counter_add],eax
@ -191,8 +191,8 @@ updatecputimes:
mov eax,[idleuse]
mov [idleusesec],eax
mov [idleuse],dword 0
mov ecx, [0x3004]
mov edi, 0x3020
mov ecx, [TASK_COUNT]
mov edi, TASK_DATA
.newupdate:
mov ebx,[edi+TASKDATA.counter_sum]
mov [edi+TASKDATA.cpu_usage],ebx

View File

@ -17,7 +17,7 @@ macro SimpleMutex name
macro WaitSimpleMutex name
{
local start_wait,ok
start_wait=$
start_wait=$
cli
cmp [name],dword 0
jz ok
@ -26,7 +26,7 @@ start_wait=$
jmp start_wait
ok=$
push eax
mov eax,dword [0x3010+second_base_address]
mov eax,dword [TASK_BASE+second_base_address]
mov eax,[eax+TASKDATA.pid]
mov [name],eax
pop eax
@ -60,7 +60,7 @@ macro WaitSimpleCriticalSection name
{
local start_wait,first_wait,inc_counter,end_wait
push eax
mov eax,[0x3010+second_base_address]
mov eax,[TASK_BASE+second_base_address]
mov eax,[eax+TASKDATA.pid]
start_wait=$
cli
@ -74,7 +74,7 @@ start_wait=$
first_wait=$
mov [name],eax
mov [name+4],dword 1
jmp end_wait
jmp end_wait
inc_counter=$
inc dword [name+4]
end_wait=$
@ -92,7 +92,7 @@ release_end=$
macro TryWaitSimpleCriticalSection name ;result in eax and in flags
{
local ok,try_end
mov eax,[0x3000+second_base_address]
mov eax,[CURRENT_TASK+second_base_address]
mov eax,[eax+TASKDATA.pid]
cmp [name],eax
jz ok

View File

@ -120,7 +120,7 @@ exc_c:
; test if debugging
cli
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
mov eax, [0x80000+eax+APPDATA.debugger_slot]
test eax, eax
@ -132,7 +132,7 @@ exc_c:
mov [error_interrupt], eax
call show_error_parameters
mov edx, [0x3010]
mov edx, [TASK_BASE]
mov [edx + TASKDATA.state], byte 4
jmp change_task
@ -143,7 +143,7 @@ exc_c:
cld
movzx ecx, bl
push ecx
mov ecx, [0x3010]
mov ecx, [TASK_BASE]
push dword [ecx+TASKDATA.pid] ; PID of current process
push 12
pop ecx
@ -152,7 +152,7 @@ exc_c:
pop ecx
pop ecx
pop ecx
mov edx, [0x3010]
mov edx, [TASK_BASE]
mov byte [edx+TASKDATA.state], 1 ; suspended
call change_task
restore_ring3_context
@ -196,9 +196,9 @@ endg
show_error_parameters:
mov [write_error_to],process_pid+43
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax, 5
mov eax,[0x3000+TASKDATA.pid+eax]
mov eax,[CURRENT_TASK+TASKDATA.pid+eax]
call writehex
mov [write_error_to],process_error+43
@ -433,9 +433,9 @@ irqhandler:
set_application_table_status:
push eax
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax, 5
add eax,0x3000+TASKDATA.pid
add eax,CURRENT_TASK+TASKDATA.pid
mov eax,[eax]
mov [application_table_status],eax
@ -448,9 +448,9 @@ set_application_table_status:
clear_application_table_status:
push eax
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax, 5
add eax,0x3000+TASKDATA.pid
add eax,CURRENT_TASK+TASKDATA.pid
mov eax,[eax]
cmp eax,[application_table_status]
@ -628,7 +628,7 @@ term9:
mov [fpu_owner],1
mov eax, [256+PROC_BASE+APPDATA.fpu_state]
clts
clts
bt [cpu_caps], CAPS_SSE
jnc .no_SSE
fxrstor [eax]
@ -737,7 +737,7 @@ term9:
jz .nodebug
push 8
pop ecx
push dword [0x3000+edi+TASKDATA.pid] ; PID
push dword [CURRENT_TASK+edi+TASKDATA.pid] ; PID
push 2
call debugger_notify
pop ecx
@ -764,7 +764,7 @@ term9:
; activate window
movzx eax, word [0xC000 + esi*2]
cmp eax, [0x3004]
cmp eax, [TASK_COUNT]
jne .dont_activate
pushad
.check_next_window:
@ -774,7 +774,7 @@ term9:
lea esi, [0xc400+eax*2]
movzx edi, word [esi] ; edi = process
shl edi, 5
cmp [0x3000 + edi + TASKDATA.state], byte 9 ; skip dead slots
cmp [CURRENT_TASK + edi + TASKDATA.state], byte 9 ; skip dead slots
je .check_next_window
add edi, window_data
; \begin{diamond}[19.09.2006]
@ -789,7 +789,7 @@ term9:
push esi ; remove hd1 & cd & flp reservation
shl esi, 5
mov esi, [esi+0x3000+TASKDATA.pid]
mov esi, [esi+CURRENT_TASK+TASKDATA.pid]
cmp [hd1_status], esi
jnz @f
call free_hd_channel
@ -809,7 +809,7 @@ term9:
pusha ; remove all irq reservations
mov eax,esi
shl eax, 5
mov eax,[eax+0x3000+TASKDATA.pid]
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
mov edi,irq_owner
mov ecx,16
newirqfree:
@ -823,7 +823,7 @@ term9:
pusha ; remove all port reservations
mov edx,esi
shl edx, 5
add edx,0x3000
add edx,CURRENT_TASK
mov edx,[edx+TASKDATA.pid]
rmpr0:
@ -867,12 +867,12 @@ term9:
popa
mov edi,esi ; do not run this process slot
shl edi, 5
mov [edi+0x3000 + TASKDATA.state],byte 9
mov [edi+CURRENT_TASK + TASKDATA.state],byte 9
; debugger test - terminate all debuggees
mov eax, 2
mov ecx, 0x80000+2*0x100+APPDATA.debugger_slot
.xd0:
cmp eax, [0x3004]
cmp eax, [TASK_COUNT]
ja .xd1
cmp dword [ecx], esi
jnz @f

View File

@ -342,7 +342,7 @@ proc CreateBuffer stdcall, format:dword, size:dword
.test_ok:
mov ebx, [CURRENT_TASK] ;hack: direct accsess
shl ebx, 5 ;to kernel data
mov ebx, [0x3000+ebx+4]
mov ebx, [CURRENT_TASK+ebx+4]
mov eax, STREAM_SIZE
call CreateObject

View File

@ -31,9 +31,9 @@ reserve_flp:
reserve_flp_ok:
push eax
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,5
mov eax,[eax+0x3000+TASKDATA.pid]
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
mov [flp_status],eax
pop eax
sti

View File

@ -16,7 +16,7 @@
;; 27.05.2006 LFN create/rewrite file - diamond ;;
;; 04.05.2006 LFN read folder - diamond ;;
;; 29.04.2006 Elimination of hangup after the ;;
;; expiration hd_wait_timeout - Mario79 ;;
;; expiration hd_wait_timeout - Mario79 ;;
;; 23.04.2006 LFN read file - diamond ;;
;; 28.01.2006 find all Fat16/32 partition in all input point ;;
;; to MBR, see file part_set.inc - Mario79 ;;
@ -124,9 +124,9 @@ reserve_hd1:
reserve_ok1:
push eax
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,5
mov eax,[eax+0x3000+TASKDATA.pid]
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
mov [hd1_status],eax
pop eax
sti
@ -184,7 +184,7 @@ free_hd_channel:
mov [IDE_Channel_2],0
ret
;********************************************
problem_partition db 0 ; used for partitions search
problem_partition db 0 ; used for partitions search
include 'part_set.inc'
@ -225,7 +225,7 @@ set_FAT:
call hd_read
cmp [hd_error],0
jne sfc_error
sfc_in_cache:
cmp [fs_type],16
@ -632,7 +632,7 @@ get_data_cluster:
gdcl1:
call hd_read
cmp [hd_error],0
jne gdc_error
jne gdc_error
add ebx,512 ; update pointer
dec edx
@ -1329,7 +1329,7 @@ delete_entry_name:
mov ebx,buffer
call hd_read ; read previous sector
cmp [hd_error],0
jne delete_name_end
jne delete_name_end
mov ebx,buffer+0x1e0 ; start from last entry
@ -1400,7 +1400,7 @@ get_hd_info:
ret
info_access_denied:
add esp,4
add esp,4
xor edx,edx
xor ebx,ebx
xor ecx,ecx
@ -1556,7 +1556,7 @@ fs_HdRead:
or ebx, -1
mov eax, ERROR_ACCESS_DENIED
ret
.noaccess_3:
add esp,4
.noaccess_1:
@ -1629,7 +1629,7 @@ fs_HdRead:
mov ebx, edx
call hd_read
cmp [hd_error],0
jne .noaccess_1
jne .noaccess_1
pop ebx
add edx, 512
sub ecx, 512

View File

@ -85,7 +85,7 @@ file_system:
cmp dword [eax+0],15 ; GET_DISK_INFO
je fs_info
cmp dword [0x3000],1 ; no memory checks for kernel requests
cmp dword [CURRENT_TASK],1 ; no memory checks for kernel requests
jz no_checks_for_kernel
mov edx,eax
cmp dword [eax+0],1
@ -96,7 +96,7 @@ file_system:
call check_region
test eax,eax
jnz area_in_app_mem
.error_output:
mov esi,buffer_failed
call sys_msg_board_str
@ -105,7 +105,7 @@ file_system:
ret
iglobal
buffer_failed db 'K : Buffer check failed',13,10,0
endg
endg
.usual_check:
cmp dword [eax+0],0
mov ecx,512
@ -274,7 +274,7 @@ endg
fs_noramdisk_write:
fs_noramdisk:
;********************************************************************
mov eax,[edi+1]
cmp eax,'FD '
@ -289,7 +289,7 @@ endg
je fs_give_dir1
mov eax,[edi+1+12]
cmp eax,'1 '
cmp eax,'1 '
je fs_yesflpdisk_first
cmp eax,'FIRS'
je fs_yesflpdisk_first
@ -342,7 +342,7 @@ endg
fs_noflpdisk:
;*****************************************************************
mov eax,[edi+1]
cmp eax,'HD0 '
je fs_yesharddisk_IDE0
@ -378,8 +378,8 @@ fs_yesharddisk_IDE3:
mov [hdpos],4
fs_yesharddisk_partition:
call reserve_hd_channel
; call choice_necessity_partition
; jmp fs_yesharddisk_all
; call choice_necessity_partition
; jmp fs_yesharddisk_all
jmp fs_for_new_semantic
choice_necessity_partition:
@ -429,7 +429,7 @@ choice_necessity_partition_1:
je fs_give_dir1
call reserve_hd1
fs_for_new_semantic:
call choice_necessity_partition
call choice_necessity_partition
fs_yesharddisk_all:
mov eax,1
@ -792,7 +792,7 @@ StringToNumber:
mov [partition_string],eax
mov edi,partition_string
xor cx,cx
i1:
i1:
mov al,[edi]
cmp al,32 ;13
je i_exit

View File

@ -23,9 +23,9 @@ reserve_cd:
reserve_ok2:
push eax
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,5
mov eax,[eax+0x3000+TASKDATA.pid]
mov eax,[eax+CURRENT_TASK+TASKDATA.pid]
mov [cd_status],eax
pop eax
sti
@ -59,13 +59,13 @@ free_cd_channel:
cmp [ChannelNumber],1
jne .IDE_Channel_2
.IDE_Channel_1:
mov [IDE_Channel_1],0
mov [IDE_Channel_1],0
ret
.IDE_Channel_2:
mov [IDE_Channel_2],0
ret
uglobal
uglobal
cd_status dd 0
endg
@ -93,7 +93,7 @@ fs_CdRead:
or ebx, -1
mov eax, ERROR_ACCESS_DENIED
ret
.noaccess_3:
pop eax edx ecx edi
jmp .noaccess_2
@ -161,7 +161,7 @@ fs_CdRead:
mov [CDDataBuf_pointer],CDDataBuf
call ReadCDWRetr ; ÷èòàåì ñåêòîð ôàéëà
cmp [DevErrorCode],0
jne .noaccess_3
jne .noaccess_3
push ecx
add ecx, ebx
cmp ecx, 2048
@ -180,7 +180,7 @@ fs_CdRead:
pop ecx
xor ebx, ebx
jmp .next
.done:
mov ebx, edx
pop eax edx ecx edi
@ -240,7 +240,7 @@ fs_CdReadFolder:
pop ecx eax
mov byte [edx], 1 ; version
mov [cd_mem_location], edx
add [cd_mem_location], 32
add [cd_mem_location], 32
; íà÷èíàåì ïåðåáðîñêó ÁÄÂÊ â ÓÑÂÊ
;.mainloop:
mov [cd_counter_block], dword 0
@ -282,7 +282,7 @@ fs_CdReadFolder:
test ecx, ecx
jz .get_names_from_buffer_1
mov edi,[cd_counter_block]
mov [edx+4],edi
mov [edx+4],edi
dec ecx
mov esi,ebp
mov edi,[cd_mem_location]
@ -377,7 +377,7 @@ cd_get_parameters_of_file:
cd_get_parameters_of_file_1:
; ïîëó÷àåì àòðèáóòû ôàéëà
xor eax,eax
; ôàéë íå àðõèâèðîâàëñÿ
; ôàéë íå àðõèâèðîâàëñ
inc al
shl eax,1
; ýòî êàòàëîã?
@ -449,7 +449,7 @@ cd_get_parameters_of_file_1:
;
; fs_CdGetFileInfo - LFN variant for CD
; get file/directory attributes structure
;
;
;----------------------------------------------------------------
fs_CdGetFileInfo:
cmp byte [esi], 0
@ -554,7 +554,7 @@ fs_CdExecute:
cmp [eax+8],dword 0
jne @f
mov ecx,[eax+4]
inc dword [eax+4]
inc dword [eax+4]
mov [CDSectorAddress],ecx
mov [CDDataBuf_pointer],CDDataBuf ;edi
call ReadCDWRetr
@ -564,7 +564,7 @@ fs_CdExecute:
push esi edi ecx
mov esi,512
imul esi,[eax+8]
add esi,CDDataBuf
add esi,CDDataBuf
mov ecx,512/4
cld
rep movsd
@ -599,7 +599,7 @@ fs_CdExecute:
.err:
popad
mov eax, 11
ret
ret
cd_find_lfn:
; in: esi->name
@ -621,10 +621,10 @@ cd_find_lfn:
jne .access_denied
; ñåêòîð ÿâëÿåòñÿ òåðìèíàòîðîì íàáîð äåñêðèïòîðîâ òîìîâ?
cmp [CDDataBuf],byte 0xff
je .access_denied
je .access_denied
; ñåêòîð ÿâëÿåòñÿ äîïîëíèòåëüíûì è óëó÷øåííûì äåñêðèïòîðîì òîìà?
cmp [CDDataBuf],byte 0x2
jne .start
jne .start
; ñåêòîð ÿâëÿåòñÿ äîïîëíèòåëüíûì äåñêðèïòîðîì òîìà?
cmp [CDDataBuf+6],byte 0x1
jne .start
@ -672,7 +672,7 @@ cd_find_lfn:
pop esi eax
clc
ret
cd_find_name_in_buffer:
mov [cd_current_pointer_of_input_2],CDDataBuf
.start:
@ -680,9 +680,9 @@ cd_find_name_in_buffer:
jc .not_found
call cd_compare_name
jc .start
.found:
.found:
clc
ret
ret
.not_found:
stc
ret
@ -713,7 +713,7 @@ cd_compare_name:
; out: if names match: ZF=1 and esi->next component of name
; else: ZF=0, esi is not changed
; destroys eax
push esi eax edi
push esi eax edi
mov edi,ebp
.loop:
cld
@ -729,7 +729,7 @@ cd_compare_name:
call char_toupper
call ansi2uni_char
xchg ah,al
cld
cld
sub edi,2
scasw
jne .name_not_coincide
@ -752,7 +752,7 @@ cd_compare_name:
add eax,ebp
sub eax,34
cmp edi,eax
je .done_1
je .done_1
; ïðîâåðêà êîíöà ïàïêè
movzx eax,byte [ebp-1]
add eax,ebp
@ -764,7 +764,7 @@ cd_compare_name:
inc esi
clc
ret
char_todown:
; convert character to uppercase, using cp866 encoding
; in: al=symbol
@ -788,7 +788,7 @@ char_todown:
.az:
add al, 0x20
ret
uni2ansi_char:
; convert UNICODE character in al to ANSI character in ax, using cp866 encoding
; in: ax=UNICODE character

View File

@ -18,39 +18,39 @@ dececx:
pop ecx
pop edx
ret
incecx:
push edx
push ecx
mov edx,2
.loop:
cmp byte [esp+edx],0xdf
jbe @f
mov [esp+edx],byte 0xdf
@@:
add [esp+edx],byte 0x20
dec edx
jns .loop
pop ecx
pop edx
ret
incecx2:
push edx
push ecx
mov edx,2
.loop:
cmp byte [esp+edx],0xeb
jbe @f
mov [esp+edx],byte 0xeb
@@:
add [esp+edx],byte 0x14
dec edx
jns .loop
pop ecx
@ -68,7 +68,7 @@ drawbuttonframes:
shr eax,16
shr ebx,16
mov edx,[0x3010]
mov edx,[TASK_BASE]
add eax,[edx-twdw + WDATA.box.left]
add ebx,[edx-twdw + WDATA.box.top]
@ -164,7 +164,7 @@ button_dececx:
sys_button:
push edi
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,8
rol eax,16
add ax,word[edi+0x80000+APPDATA.wnd_clientbox.left]
@ -197,9 +197,9 @@ sys_button:
push ebx
shr eax,16
shr ebx,16
mov edx,[0x3010]
mov esi,[edx-twdw + WDATA.box.left]
mov edi,[edx-twdw + WDATA.box.top]
mov edx,[TASK_BASE]
mov esi,[edx-twdw + WDATA.box.left]
mov edi,[edx-twdw + WDATA.box.top]
add eax,esi
add ebx,edi
mov cx,ax
@ -247,7 +247,7 @@ sys_button:
shl eax,4
add eax,edi
mov bx,[0x3000]
mov bx,[CURRENT_TASK]
mov [eax],bx
add eax,2 ; save button id number
@ -298,7 +298,7 @@ remove_button:
add eax,0x10
mov dx,[0x3000]
mov dx,[CURRENT_TASK]
cmp dx,[eax]
jnz rnewba
@ -504,7 +504,7 @@ checkbuttons:
movzx ebx,word [eax]
movzx ecx,word [0xC000 + ebx * 2]
cmp ecx,[0x3004]
cmp ecx,[TASK_COUNT]
jne buttonnewcheck
; check that button start is inside window x/y end

View File

@ -101,7 +101,7 @@ create_event:
mov ebx, [CURRENT_TASK]
shl ebx, 5
mov ebx, [0x3000+ebx+4]
mov ebx, [CURRENT_TASK+ebx+4]
mov [eax+APPOBJ.pid], ebx
mov edx, [.flags]
mov [eax+EVENT.state], edx
@ -274,7 +274,7 @@ proc get_event_ex stdcall, p_ev:dword, timeout:dword
call destroy_event.force
ret
.switch:
mov eax, [0x3010]
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], byte 5
call change_task
jmp .wait
@ -339,7 +339,7 @@ wait_event:
ret
.switch:
or [eax+EVENT.state], EVENT_WATCHED
mov eax, [0x3010]
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], byte 5
call change_task
mov eax, [.event]
@ -497,7 +497,7 @@ sys_waitforevent:
jne eventoccur
newwait:
mov eax, [0x3010]
mov eax, [TASK_BASE]
mov [eax+TASKDATA.state], byte 5
call change_task
@ -511,10 +511,10 @@ get_event_for_app:
pushad
mov edi,[0x3010] ; WINDOW REDRAW
mov edi,[TASK_BASE] ; WINDOW REDRAW
test [edi+TASKDATA.event_mask],dword 1
jz no_eventoccur1
;mov edi,[0x3010]
;mov edi,[TASK_BASE]
cmp [edi-twdw+WDATA.fl_redraw],byte 0
je no_eventoccur1
popad
@ -522,12 +522,12 @@ get_event_for_app:
ret
no_eventoccur1:
;mov edi,[0x3010] ; KEY IN BUFFER
;mov edi,[TASK_BASE] ; KEY IN BUFFER
test [edi+TASKDATA.event_mask],dword 2
jz no_eventoccur2
mov ecx, [0x3000]
mov ecx, [CURRENT_TASK]
movzx edx,word [0xC000+ecx*2]
mov eax, [0x3004]
mov eax, [TASK_COUNT]
cmp eax,edx
jne no_eventoccur2x
cmp [0xf400],byte 0
@ -546,14 +546,14 @@ get_event_for_app:
jb @b
no_eventoccur2:
;mov edi,[0x3010] ; BUTTON IN BUFFER
;mov edi,[TASK_BASE] ; BUTTON IN BUFFER
test [edi+TASKDATA.event_mask],dword 4
jz no_eventoccur3
cmp [0xf500],byte 0
je no_eventoccur3
mov ecx, [0x3000]
mov ecx, [CURRENT_TASK]
movzx edx, word [0xC000+ecx*2]
mov eax, [0x3004]
mov eax, [TASK_COUNT]
cmp eax,edx
jnz no_eventoccur3
popad
@ -572,10 +572,10 @@ get_event_for_app:
no_eventoccur3:
;mov edi,[0x3010] ; mouse event
;mov edi,[TASK_BASE] ; mouse event
test [edi+TASKDATA.event_mask],dword 00100000b
jz no_mouse_event
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,8
test [eax+0x80000+APPDATA.event_mask],dword 00100000b
jz no_mouse_event
@ -586,7 +586,7 @@ get_event_for_app:
no_mouse_event:
;mov edi,[0x3010] ; DESKTOP BACKGROUND REDRAW
;mov edi,[TASK_BASE] ; DESKTOP BACKGROUND REDRAW
test [edi+TASKDATA.event_mask],dword 16
jz no_eventoccur5
cmp [0xfff0],byte 2
@ -596,10 +596,10 @@ get_event_for_app:
ret
no_eventoccur5:
;mov edi,[0x3010] ; IPC
;mov edi,[TASK_BASE] ; IPC
test [edi+TASKDATA.event_mask],dword 01000000b
jz no_ipc
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,8
test [eax+0x80000+APPDATA.event_mask],dword 01000000b
jz no_ipc
@ -610,10 +610,10 @@ get_event_for_app:
no_ipc:
;mov edi,[0x3010] ; STACK
;mov edi,[TASK_BASE] ; STACK
test [edi+TASKDATA.event_mask],dword 10000000b
jz no_stack_event
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,8
test [eax+0x80000+APPDATA.event_mask],dword 10000000b
jz no_stack_event
@ -625,7 +625,7 @@ get_event_for_app:
test byte [edi+TASKDATA.event_mask+1], 1 ; DEBUG
jz .test_IRQ
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
test byte [eax+0x80000+APPDATA.event_mask+1], byte 1
jz .test_IRQ
@ -635,7 +635,7 @@ get_event_for_app:
ret
;.test_ext:
; mov eax, [0x3000]
; mov eax, [CURRENT_TASK]
; shl eax, 8
; test dword [eax+0x80000+APPDATA.event_mask], EVENT_EXTENDED
; jz .test_IRQ
@ -651,14 +651,14 @@ get_event_for_app:
mov ebx,0x00010000
xor ecx, ecx
irq_event_test:
mov edi,[0x3010]
mov edi,[TASK_BASE]
test [edi+TASKDATA.event_mask],ebx
jz no_irq_event
mov edi,ecx
shl edi,2
add edi,irq_owner
mov edx,[edi]
mov eax,[0x3010]
mov eax,[TASK_BASE]
mov eax,[eax+TASKDATA.pid]
cmp edx,eax
jne no_irq_event

View File

@ -365,7 +365,7 @@ drawwindow_IV:
shl eax,4
add eax,edi
mov bx,[0x3000]
mov bx,[CURRENT_TASK]
mov [eax],bx
add eax,2 ; save button id number
@ -404,7 +404,7 @@ drawwindow_IV:
shl eax,4
add eax,edi
mov bx,[0x3000]
mov bx,[CURRENT_TASK]
mov [eax],bx
add eax,2 ; save button id number

View File

@ -60,7 +60,7 @@ calculatescreen:
mov esi, 1
call setscreen
mov ebp, [0x3004] ; number of processes
mov ebp, [TASK_COUNT] ; number of processes
cmp ebp, 1
jbe .finish
align 4
@ -68,7 +68,7 @@ calculatescreen:
movzx edi, word [0xC400 + esi * 2]
shl edi, 5
cmp [0x3000+edi+TASKDATA.state], byte 9
cmp [CURRENT_TASK+edi+TASKDATA.state], byte 9
je .not_wnd
add edi, window_data
@ -213,7 +213,7 @@ pushad
pop ecx
pop ebx
pop eax
ret
ret
.free_form:
; for (y=0; y <= x_size; y++)
@ -375,7 +375,7 @@ display_settings:
cmp eax,2 ; set common window colours
jne no_com_colours
mov [windowtypechanged],dword 1
mov esi,[0x3010]
mov esi,[TASK_BASE]
add esi,TASKDATA.mem_start
add ebx,[esi]
mov esi,ebx
@ -389,7 +389,7 @@ display_settings:
cmp eax,3 ; get common window colours
jne no_get_com
mov esi,[0x3010]
mov esi,[TASK_BASE]
add esi,TASKDATA.mem_start
add ebx,[esi]
mov edi,ebx
@ -468,7 +468,7 @@ display_settings:
cmp eax,8 ; set window skin
jne no_set_skin
mov eax,ebx
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ebx,[edi+TASKDATA.mem_start] ; abs start of info block
pushd [ebx+0] [ebx+4] [ebx+8] [ebx+12]
mov dword[ebx+0],0 ; read
@ -515,7 +515,7 @@ display_settings:
repos_windows:
mov ecx,[0x3004]
mov ecx,[TASK_COUNT]
mov edi,0x20*2
mov byte[0x0000fff0],1
dec ecx
@ -911,7 +911,7 @@ windowactivate:
; if type of current active window is 3,
; it must be redrawn
mov eax, [0x3004]
mov eax, [TASK_COUNT]
movzx eax, word [0xC400 + eax*2]
shl eax, 5
add eax, window_data
@ -928,7 +928,7 @@ windowactivate:
xor esi, esi ; drop others
waloop:
cmp esi, dword [0x3004]
cmp esi, dword [TASK_COUNT]
jae wacont
inc esi
lea edi, [0xC000 + esi*2]
@ -944,13 +944,13 @@ windowactivate:
pop esi ; esi = pointer at 0xC400
movzx eax, word [esi]
mov bx, [0x3004] ; number of processes
mov bx, [TASK_COUNT] ; number of processes
mov [0xC000+eax*2], bx ; this is the last (and the upper)
; update on screen -window stack
xor esi, esi
waloop2:
mov edi, [0x3004]
mov edi, [TASK_COUNT]
cmp esi, edi
jae wacont2
inc esi
@ -992,7 +992,7 @@ checkwindowdraw:
add esi, 2
push esi
mov eax, [0x3004]
mov eax, [TASK_COUNT]
lea eax, word [0xC400 + eax * 2] ; number of the upper window
cmp esi, eax
@ -1000,7 +1000,7 @@ checkwindowdraw:
movzx eax, word [esi]
shl eax, 5
cmp [0x3000 + eax + TASKDATA.state], byte 9
cmp [CURRENT_TASK + eax + TASKDATA.state], byte 9
je .new_check ; skip dead windows
lea esi, [eax+window_data]
@ -1010,7 +1010,7 @@ checkwindowdraw:
add edx, ebx ; y0e
mov ecx, [esi+WDATA.box.top] ; y ; y check
cmp ecx, edx
cmp ecx, edx
jae .new_check ; y < y0e
mov eax, [esi+WDATA.box.height]
add ecx, eax ; ye
@ -1058,7 +1058,7 @@ waredraw: ; if redraw necessary at activate
; update screen info
pushad
mov edi, [0x3004] ; the last process (number)
mov edi, [TASK_COUNT] ; the last process (number)
movzx esi, word [0xC400 + edi * 2]
shl esi, 5
add esi, window_data
@ -1072,7 +1072,7 @@ waredraw: ; if redraw necessary at activate
add ecx, eax ; ecx = x_end
add edx, ebx ; edx = y_end
mov edi, [0x3004]
mov edi, [TASK_COUNT]
movzx esi, word [0xC400 + edi * 2]
call setscreen
popad
@ -1137,7 +1137,7 @@ restore_minimized_window:
jz .skip_redrawings
mov [edi+WDATA.fl_redraw], 1
and [edi+WDATA.fl_wstate], not WSTATE_MINIMIZED
cmp eax, [0x3004] ; the uppermost window
cmp eax, [TASK_COUNT] ; the uppermost window
jnz .no_uppermost
mov eax, [edi+WDATA.box.left]
mov ebx, [edi+WDATA.box.top]
@ -1174,7 +1174,7 @@ checkwindows:
cmp [window_minimize], 0
je .no_minimizing
mov eax, [0x3004] ; the uppermost window
mov eax, [TASK_COUNT] ; the uppermost window
mov bl, 0
xchg [window_minimize], bl
cmp bl, 1
@ -1192,7 +1192,7 @@ checkwindows:
ret
.mouse_buttons_pressed:
mov esi,[0x3004]
mov esi,[TASK_COUNT]
inc esi
cwloop:
@ -1214,7 +1214,7 @@ checkwindows:
movzx eax, word [0xfb0a]
movzx ebx, word [0xfb0c]
cmp ecx, eax
jae cwloop
cmp edx, ebx
@ -1228,7 +1228,7 @@ checkwindows:
pushad
mov eax, esi
mov ebx, [0x3004]
mov ebx, [TASK_COUNT]
cmp eax, ebx ; is this window active?
jz .move_resize_window
@ -1453,7 +1453,7 @@ checkwindows:
cwb:
cmp [0xfb40],byte 0
jne newchm
jne newchm
; new position done
mov [0xfff5],byte 1
mov cl,0
@ -1751,7 +1751,7 @@ random_shaped_window:
test eax, eax
jne rsw_no_address
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,8
mov [eax+0x80000+APPDATA.wnd_shape],ebx
@ -1759,7 +1759,7 @@ random_shaped_window:
cmp eax,1
jne rsw_no_scale
mov eax,[0x3000]
mov eax,[CURRENT_TASK]
shl eax,8
mov byte [eax+0x80000+APPDATA.wnd_shape_scale], bl
rsw_no_scale:

View File

@ -91,7 +91,7 @@ irq1:
; mov ds, ax
; mov es, ax
movzx eax,word[0x3004] ; top window process
movzx eax,word[TASK_COUNT] ; top window process
movzx eax,word[0xC400+eax*2]
shl eax,8
mov al,[0x80000+eax+APPDATA.keyboard_mode]

View File

@ -265,9 +265,9 @@ __sys_disable_mouse:
ret
@@:
pushad
cmp [0x3000],dword 1
cmp [CURRENT_TASK],dword 1
je disable_m
mov edx,[0x3000]
mov edx,[CURRENT_TASK]
shl edx,5
add edx,window_data
movzx eax, word [0xfb0a]
@ -277,7 +277,7 @@ __sys_disable_mouse:
imul ecx,ebx
add ecx,eax
add ecx, display_data
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
movzx ebx, byte [ecx]
cmp eax,ebx
je yes_mouse_disable
@ -296,7 +296,7 @@ __sys_disable_mouse:
je yes_mouse_disable
jmp no_mouse_disable
yes_mouse_disable:
mov edx,[0x3000]
mov edx,[CURRENT_TASK]
shl edx,5
add edx,window_data
movzx eax, word [0xfb0a]

View File

@ -504,9 +504,9 @@ include 'vmodeld.inc'
; LOAD FONTS I and II
mov [0x3000],dword 1
mov [0x3004],dword 1
mov [0x3010],dword 0x3020
mov [CURRENT_TASK],dword 1
mov [TASK_COUNT],dword 1
mov [TASK_BASE],dword TASK_DATA
mov esi,char
xor ebx,ebx
@ -636,9 +636,9 @@ include 'vmodeld.inc'
mov dword [0x80000+256+APPDATA.bk_obj], ebx
; task list
mov [0x3020+TASKDATA.wnd_number], 1 ; on screen number
mov [0x3020+TASKDATA.pid], 1 ; process id number
mov [0x3020+TASKDATA.mem_start], 0 ; process base address
mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number
mov [TASK_DATA+TASKDATA.pid], 1 ; process id number
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
mov edi,tss_data+tss_step
mov ecx, (tss_step)/4
@ -719,8 +719,8 @@ include 'vmodeld.inc'
call load_skin
; LOAD FIRST APPLICATION
mov [0x3000],dword 1
mov [0x3004],dword 1
mov [CURRENT_TASK],dword 1
mov [TASK_COUNT],dword 1
cli
cmp byte [0x2f0000+0x9030],1
jne no_load_vrr_m
@ -744,8 +744,8 @@ no_load_vrr_m:
first_app_found:
cli
;mov [0x3004],dword 2
mov [0x3000],dword 1 ; set OS task fisrt
;mov [TASK_COUNT],dword 2
mov [CURRENT_TASK],dword 1 ; set OS task fisrt
; SET KEYBOARD PARAMETERS
@ -1061,7 +1061,7 @@ sys_outport:
ret
sopl8:
mov edx,[0x3010]
mov edx,[TASK_BASE]
mov edx,[edx+0x4]
and ebx,65535
cld
@ -1326,7 +1326,7 @@ draw_num_text:
; edx length
; edi 1 force
; mov edi,[0x3000]
; mov edi,[CURRENT_TASK]
; shl edi,8
; add ax,word[edi+0x80000+APPDATA.wnd_clientbox.top]
; rol eax,16
@ -1339,12 +1339,12 @@ draw_num_text:
add ecx,esp
mov eax,[esp+64+32-8+4]
push edx ; add window start x & y
mov edx,[0x3010]
mov edx,[TASK_BASE]
mov ebx,[edx-twdw+WDATA.box.left]
add ebx, [(edx-0x3000)*8+0x80000+APPDATA.wnd_clientbox.left]
add ebx, [(edx-CURRENT_TASK)*8+0x80000+APPDATA.wnd_clientbox.left]
shl ebx,16
add ebx,[edx-twdw+WDATA.box.top]
add ebx, [(edx-0x3000)*8+0x80000+APPDATA.wnd_clientbox.top]
add ebx, [(edx-CURRENT_TASK)*8+0x80000+APPDATA.wnd_clientbox.top]
add eax,ebx
pop edx
mov ebx,[esp+64+32-12+4]
@ -1405,7 +1405,7 @@ endg
jnz nsyse2
cmp ebx,1
jnz kbnobase
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov eax,ecx
mov ebx,keymap
@ -1415,7 +1415,7 @@ endg
kbnobase:
cmp ebx,2
jnz kbnoshift
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov eax,ecx
mov ebx,keymap_shift
@ -1425,7 +1425,7 @@ endg
kbnoshift:
cmp ebx,3
jne kbnoalt
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov eax,ecx
mov ebx,keymap_alt
@ -1608,7 +1608,7 @@ sys_getsetup:
jne ngsyse2
cmp ebx,1
jnz kbnobaseret
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov ebx,ecx
mov eax,keymap
@ -1618,7 +1618,7 @@ sys_getsetup:
kbnobaseret:
cmp ebx,2
jnz kbnoshiftret
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov ebx,ecx
mov eax,keymap_shift
@ -1628,7 +1628,7 @@ sys_getsetup:
kbnoshiftret:
cmp ebx,3
jne kbnoaltret
mov edi,[0x3010]
mov edi,[TASK_BASE]
add ecx,[edi+TASKDATA.mem_start]
mov ebx,ecx
mov eax,keymap_alt
@ -1733,7 +1733,7 @@ mswin:
mov eax,[0xfb0a]
shl eax,16
mov ax,[0xfb0c]
mov esi,[0x3010]
mov esi,[TASK_BASE]
mov bx, word [esi-twdw+WDATA.box.left]
shl ebx,16
mov bx, word [esi-twdw+WDATA.box.top]
@ -1884,7 +1884,7 @@ include 'detect/ps2mouse.inc'
sys_end:
mov eax,[0x3010]
mov eax,[TASK_BASE]
mov [eax+TASKDATA.state], 3 ; terminate this program
waitterm: ; wait here for termination
@ -1931,7 +1931,7 @@ sysfn_shutdown: ; 18.1 = BOOT
mov [0x2f0000+0x9030],byte 0
for_shutdown_parameter:
mov eax,[0x3004]
mov eax,[TASK_COUNT]
add eax,2
mov [shutdown_processes],eax
mov [0xFF00],al
@ -1944,13 +1944,13 @@ sysfn_shutdown: ; 18.1 = BOOT
sysfn_terminate: ; 18.2 = TERMINATE
cmp ebx,2
jb noprocessterminate
mov edx,[0x3004]
mov edx,[TASK_COUNT]
cmp ebx,edx
ja noprocessterminate
mov eax,[0x3004]
mov eax,[TASK_COUNT]
shl ebx,5
mov edx,[ebx+0x3000+TASKDATA.pid]
add ebx,0x3000+TASKDATA.state
mov edx,[ebx+CURRENT_TASK+TASKDATA.pid]
add ebx,CURRENT_TASK+TASKDATA.state
cmp byte [ebx], 9
jz noprocessterminate
@ -1995,13 +1995,13 @@ sysfn_terminate2:
sysfn_activate: ; 18.3 = ACTIVATE WINDOW
cmp ebx,2
jb .nowindowactivate
cmp ebx,[0x3004]
cmp ebx,[TASK_COUNT]
ja .nowindowactivate
mov [window_minimize], 2 ; restore window if minimized
movzx esi, word [0xC000 + ebx*2]
cmp esi, [0x3004]
cmp esi, [TASK_COUNT]
je .nowindowactivate ; already active
mov edi, ebx
@ -2029,7 +2029,7 @@ sysfn_getcpuclock: ; 18.5 = GET TSC/SEC
;!!!!!!!!!!!!!!!!!!!!!!!!
sysfn_getactive: ; 18.7 = get active window
mov eax, [0x3004]
mov eax, [TASK_COUNT]
movzx eax, word [0xC400 + eax*2]
mov [esp+36],eax
ret
@ -2070,7 +2070,7 @@ sysfn_getdiskinfo: ; 18.11 = get disk info table
rep movsb
ret
for_all_tables:
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov edi,[edi+TASKDATA.mem_start]
add edi,ecx
mov esi,0x40000
@ -2089,7 +2089,7 @@ sysfn_lastkey: ; 18.12 = return 0 (backward compatibility)
ret
sysfn_getversion: ; 18.13 = get kernel ID and version
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov edi,[edi+TASKDATA.mem_start]
add edi,ebx
mov esi,version_inf
@ -2285,7 +2285,7 @@ draw_background_temp:
cmp eax,5 ; BLOCK MOVE TO BGR
jnz nosb5
; bughere
mov edi, [0x3010]
mov edi, [TASK_BASE]
add ebx, [edi+TASKDATA.mem_start]
; mov esi, ebx
; mov edi, ecx
@ -2347,9 +2347,9 @@ align 4
sys_getkey:
mov [esp+36],dword 1
; test main buffer
mov ebx, [0x3000] ; TOP OF WINDOW STACK
mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK
movzx ecx,word [0xC000 + ebx * 2]
mov edx,[0x3004]
mov edx,[TASK_COUNT]
cmp ecx,edx
jne .finish
cmp [0xf400],byte 0
@ -2395,10 +2395,10 @@ align 4
sys_getbutton:
mov ebx, [0x3000] ; TOP OF WINDOW STACK
mov ebx, [CURRENT_TASK] ; TOP OF WINDOW STACK
mov [esp+36],dword 1
movzx ecx, word [0xC000 + ebx * 2]
mov edx, [0x3004] ; less than 256 processes
mov edx, [TASK_COUNT] ; less than 256 processes
cmp ecx,edx
jne .exit
movzx eax,byte [0xf500]
@ -2427,12 +2427,12 @@ sys_cpuusage:
; +30 dword PID , process idenfification number
;
mov edi,[0x3010] ; eax = return area
mov edi,[TASK_BASE] ; eax = return area
add eax,[edi + TASKDATA.mem_start]
cmp ebx,-1 ; who am I ?
jne no_who_am_i
mov ebx,[0x3000]
mov ebx,[CURRENT_TASK]
no_who_am_i:
push eax ; return area
@ -2447,7 +2447,7 @@ sys_cpuusage:
xor edx,edx
mov eax,0x20
mul ebx
add eax,0x3000+TASKDATA.cpu_usage
add eax,CURRENT_TASK+TASKDATA.cpu_usage
mov ebx,eax
pop eax
mov ecx,[ebx]
@ -2486,7 +2486,7 @@ sys_cpuusage:
mov eax,[esp]
shl eax,5
add eax,0x3000+TASKDATA.pid
add eax,CURRENT_TASK+TASKDATA.pid
mov eax,[eax]
mov [ebx+20],eax
@ -2505,7 +2505,7 @@ sys_cpuusage:
mov eax,[esp]
shl eax,5
add eax,0x3000+TASKDATA.state
add eax,CURRENT_TASK+TASKDATA.state
mov eax,[eax]
mov [ebx+40],ax
@ -2531,7 +2531,7 @@ sys_cpuusage:
; return number of processes
mov eax,[0x3004]
mov eax,[TASK_COUNT]
mov [esp+36],eax
ret
@ -2618,7 +2618,7 @@ sys_redrawstat:
; buttons away
mov ecx,[0x3000]
mov ecx,[CURRENT_TASK]
sys_newba2:
@ -2661,8 +2661,8 @@ sys_redrawstat:
cmp eax,2
jnz srl1
mov edx,[0x3010] ; return whole screen draw area for this app
add edx,draw_data-0x3000
mov edx,[TASK_BASE] ; return whole screen draw area for this app
add edx,draw_data-CURRENT_TASK
mov [edx+RECT.left], 0
mov [edx+RECT.top], 0
mov eax,[0xfe00]
@ -2670,7 +2670,7 @@ sys_redrawstat:
mov eax,[0xfe04]
mov [edx+RECT.bottom],eax
mov edi,[0x3010]
mov edi,[TASK_BASE]
or [edi-twdw+WDATA.fl_wdrawn], 1 ; no new position & buttons from app
call sys_window_mouse
@ -2731,9 +2731,9 @@ sys_drawwindow:
; parameter for drawwindow_IV
push 0
mov edi, [0x3004]
mov edi, [TASK_COUNT]
movzx edi, word [0xC400 + edi*2]
cmp edi, [0x3000]
cmp edi, [CURRENT_TASK]
jne @f
inc dword [esp]
@@:
@ -2757,12 +2757,12 @@ draw_window_caption:
call [disable_mouse]
xor eax,eax
mov edx,[0x3004]
mov edx,[TASK_COUNT]
movzx edx,word[0xC400+edx*2]
cmp edx,[0x3000]
cmp edx,[CURRENT_TASK]
jne @f
inc eax
@@: mov edx,[0x3000]
@@: mov edx,[CURRENT_TASK]
shl edx,5
add edx,window_data
movzx ebx,[edx+WDATA.fl_wstyle]
@ -2790,7 +2790,7 @@ draw_window_caption:
;--------------------------------------------------------------
.2: ;jmp @f
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,5
test [edi+window_data+WDATA.fl_wstyle],WSTYLE_HASCAPTION
jz @f
@ -2913,7 +2913,7 @@ set_window_clientbox:
sys_set_window:
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,5
add edi,window_data
@ -2996,7 +2996,7 @@ syscall_windowsettings:
; NOTE: only window owner thread can set its caption,
; so there's no parameter for PID/TID
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,5
; have to check if caption is within application memory limit
@ -3031,7 +3031,7 @@ syscall_windowsettings:
sys_window_move:
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,5
add edi,window_data
@ -3299,7 +3299,7 @@ checkmisc:
jne mouse_not_active
mov [mouse_active], 0
xor edi, edi
mov ecx, [0x3004]
mov ecx, [TASK_COUNT]
set_mouse_event:
add edi, 256
or [edi+0x80000+APPDATA.event_mask], dword 00100000b
@ -3357,8 +3357,8 @@ checkmisc:
noshutdown:
mov eax,[0x3004] ; termination
mov ebx,0x3020+TASKDATA.state
mov eax,[TASK_COUNT] ; termination
mov ebx,TASK_DATA+TASKDATA.state
mov esi,1
newct:
@ -3475,7 +3475,7 @@ redrawscreen:
pop ecx
cmp ecx,[0x3004]
cmp ecx,[TASK_COUNT]
jle newdw2
pop eax
@ -3545,7 +3545,7 @@ delay_ms: ; delay in 1/1000 sec
set_app_param:
push edi
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov [edi+TASKDATA.event_mask],eax
pop edi
@ -3634,7 +3634,7 @@ memmove: ; memory move in bytes
;; 5 file not found
;; ebx = size of file
;
; mov edi,[0x3010]
; mov edi,[TASK_BASE]
; add edi,0x10
; add esi,[edi]
; add eax,[edi]
@ -3662,12 +3662,12 @@ align 4
sys_programirq:
mov edi,[0x3010]
mov edi,[TASK_BASE]
add eax,[edi+TASKDATA.mem_start]
cmp ebx,16
jae .not_owner
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov edi,[edi+TASKDATA.pid]
cmp edi,[irq_owner+ebx*4]
je spril1
@ -3696,7 +3696,7 @@ get_irq_data:
shl edx,2
add edx,irq_owner
mov edx,[edx]
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov edi,[edi+TASKDATA.pid]
cmp edx,edi
je gidril1
@ -3736,7 +3736,7 @@ set_io_access_rights:
pushad
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
imul edi,tss_step
add edi,tss_data+128
; add edi,128
@ -3844,7 +3844,7 @@ r_f_port_area:
mov [0x2d0000],edi
shl edi,4
add edi,0x2d0000
mov esi,[0x3010]
mov esi,[TASK_BASE]
mov esi,[esi+TASKDATA.pid]
mov [edi],esi
mov [edi+4],ebx
@ -3860,7 +3860,7 @@ free_port_area:
mov esi,[0x2d0000] ; no reserved areas ?
test esi,esi
je frpal2
mov edx,[0x3010]
mov edx,[TASK_BASE]
mov edx,[edx+TASKDATA.pid]
frpal3:
mov edi,esi
@ -3934,7 +3934,7 @@ reserve_free_irq:
lea edi,[irq_owner+ebx*4]
mov edx,[edi]
mov eax,[0x3010]
mov eax,[TASK_BASE]
cmp edx,[eax+TASKDATA.pid]
jne fril1
dec ecx
@ -3949,7 +3949,7 @@ reserve_free_irq:
cmp dword [edi], 0
jnz ril1
mov edx,[0x3010]
mov edx,[TASK_BASE]
mov edx,[edx+TASKDATA.pid]
mov [edi],edx
dec ecx
@ -4001,7 +4001,7 @@ sys_putimage:
.exit:
ret
@@:
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,8
add dx,word[edi+0x80000+APPDATA.wnd_clientbox.top]
rol edx,16
@ -4043,7 +4043,7 @@ sys_putimage_palette:
; esi = number of bits per pixel, must be 8, 24 or 32
; edi = pointer to palette
; ebp = row delta
mov eax, [0x3000]
mov eax, [CURRENT_TASK]
shl eax, 8
add dx, word [eax+0x80000+APPDATA.wnd_clientbox.top]
rol edx, 16
@ -4104,7 +4104,7 @@ putimage_get32bpp:
; edi color
__sys_drawbar:
mov esi,[0x3000]
mov esi,[CURRENT_TASK]
shl esi,8
add eax,[esi+0x80000+APPDATA.wnd_clientbox.left]
add ecx,[esi+0x80000+APPDATA.wnd_clientbox.left]
@ -4474,7 +4474,7 @@ sys_msg_board:
sys_process_def:
mov edi, [0x3000]
mov edi, [CURRENT_TASK]
dec eax ; 1 = set keyboard mode
jne no_set_keyboard_setup
@ -4635,10 +4635,10 @@ align 4 ; system functions
syscall_setpixel: ; SetPixel
mov edx,[0x3010]
mov edx,[TASK_BASE]
add eax,[edx-twdw+WDATA.box.left]
add ebx,[edx-twdw+WDATA.box.top]
mov edi,[0x3000]
mov edi,[CURRENT_TASK]
shl edi,8
add eax,[edi+0x80000+APPDATA.wnd_clientbox.left]
add ebx,[edi+0x80000+APPDATA.wnd_clientbox.top]
@ -4651,10 +4651,10 @@ align 4
syscall_writetext: ; WriteText
mov edi,[0x3010]
mov edi,[TASK_BASE]
mov ebp,[edi-twdw+WDATA.box.left]
push esi
mov esi,[0x3000]
mov esi,[CURRENT_TASK]
shl esi,8
add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
shl ebp,16
@ -4671,7 +4671,7 @@ align 4
syscall_openramdiskfile: ; OpenRamdiskFile
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
add edx,[edi]
@ -4694,7 +4694,7 @@ syscall_drawrect: ; DrawRect
shr eax,16
movzx edx,bx
shr ebx,16
mov esi,[0x3000]
mov esi,[CURRENT_TASK]
shl esi,8
add eax,[esi+0x80000+APPDATA.wnd_clientbox.left]
add ebx,[esi+0x80000+APPDATA.wnd_clientbox.top]
@ -4726,7 +4726,7 @@ align 4
syscall_delramdiskfile: ; DelRamdiskFile
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
call filedelete
@ -4737,7 +4737,7 @@ align 4
syscall_writeramdiskfile: ; WriteRamdiskFile
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
add ebx,[edi]
@ -4762,7 +4762,7 @@ align 4
syscall_readstring: ; ReadString
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
call read_string
@ -4773,10 +4773,10 @@ align 4
syscall_drawline: ; DrawLine
mov edi,[0x3010]
mov edi,[TASK_BASE]
movzx edx,word[edi-twdw+WDATA.box.left]
mov ebp,edx
mov esi,[0x3000]
mov esi,[CURRENT_TASK]
shl esi,8
add ebp,[esi+0x80000+APPDATA.wnd_clientbox.left]
add dx,word[esi+0x80000+APPDATA.wnd_clientbox.left]
@ -4860,7 +4860,7 @@ align 4
read_from_hd: ; Read from hd - fn not in use
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
add ecx,[edi]
@ -4924,7 +4924,7 @@ undefined_syscall: ; Undefined system call
; push edi
; mov edi,[0x3000] ; restore processes tss pointer in gdt, busyfl?
; mov edi,[CURRENT_TASK] ; restore processes tss pointer in gdt, busyfl?
; imul edi,8
; mov [edi+gdts+ tss0 +5], word 01010000b *256 +11101001b

View File

@ -212,7 +212,7 @@
;
; 0x0098B000 -> kernel heap
;
; 0x01FFFFFF heam min limit
; 0x01FFFFFF heap min limit
; 0x7DBFFFFF heap max limit
; 0x7DC00000 -> 0x7FBFFFFF LFB 32Mb
; 0x7DC00000 -> 0x7E3FFFFF application available LFB 8Mb

View File

@ -18,8 +18,8 @@
;; socket_read
;; socket_write
;; socket_write_tcp
;;
;;
;;
;;
;; Changes history:
;; 22.09.2003 - [Mike Hibbett] : mikeh@oceanfree.net
;; 11.11.2006 - [Johnny_B] and [smb]
@ -71,15 +71,15 @@
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; 72| Retransmit queue # NOW WINDOW SIZE TIMER INTEL format|
; +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
; 76| RX offset from
; 76| RX offset from
; 76| RX Data |
; +-+-+-.......... -+
; so, define struct
struc SOCKET
{ .Status dd ? ;+00 - Status ( of this buffer )
.PID dd ? ;+04 - Application Process ID
{ .Status dd ? ;+00 - Status ( of this buffer )
.PID dd ? ;+04 - Application Process ID
.LocalIP dd ? ;+08 - Local IP Address
.LocalPort dw ? ;+12 - Local Port
.UnusedL dw ? ;+14 - may be removed in future
@ -88,17 +88,17 @@ struc SOCKET
.UnusedR dw ? ;+22 - may be removed in future
.rxDataCount dd ? ;+24 - Rx Data Count
.TCBState dd ? ;+28 - TCB STATE
.TCBTimer dd ? ;+32 - TCB Timer (seconds)
.TCBTimer dd ? ;+32 - TCB Timer (seconds)
.ISS dd ? ;+36 - Initial Send Sequence
.IRS dd ? ;+40 - Initial Receive Sequence
.SND_UNA dd ? ;+44 - Sequence number of unack'ed sent packets
.SND_NXT dd ? ;+48 - Next send sequence number to use
.SND_NXT dd ? ;+48 - Next send sequence number to use
.SND_WND dd ? ;+52 - Send window
.RCV_NXT dd ? ;+56 - Next receive sequence number to use
.RCV_WND dd ? ;+60 - Receive window
.SEG_LEN dd ? ;+64 - Segment length
.SEG_WND dd ? ;+68 - Segment window
.wndsizeTimer dd ? ;+72 - Retransmit queue # NOW WINDOW SIZE TIMER
.wndsizeTimer dd ? ;+72 - Retransmit queue # NOW WINDOW SIZE TIMER
.rxData dd ? ;+76 - receive data buffer here
}
@ -106,11 +106,11 @@ virtual at 0
SOCKET SOCKET
end virtual
; simple macro calcing real memory address of SOCKET struct by socket's
; simple macro calcing real memory address of SOCKET struct by socket's
macro Index2RealAddr reg
{
shl reg, 12
add reg, sockets
add reg, sockets
}
;Constants
@ -211,11 +211,11 @@ socket_open:
mov [eax + SOCKET.RemotePort], cx
mov ebx, [stack_ip]
mov [eax + SOCKET.LocalIP], ebx
mov [eax + SOCKET.RemoteIP], edx
mov [eax + SOCKET.LocalIP], ebx
mov [eax + SOCKET.RemoteIP], edx
mov [eax + SOCKET.rxDataCount], dword 0 ; recieved data count
mov esi, [0x3010]
mov esi, [TASK_BASE]
mov ebx, [esi+TASKDATA.pid]
mov [eax + SOCKET.PID], ebx ; save the process ID
pop eax ; Get the socket number back, so we can return it
@ -256,19 +256,19 @@ socket_open_tcp:
mov [eax + SOCKET.wndsizeTimer], dword 0 ; Reset the window timer.
xchg bh, bl
mov [eax + SOCKET.LocalPort], bx
mov [eax + SOCKET.LocalPort], bx
; mov [eax + 12], byte bh ; Local port ( LS 16 bits )
; mov [eax + 13], byte bl ; Local port ( LS 16 bits )
xchg ch, cl
mov [eax + SOCKET.RemotePort], cx
mov [eax + SOCKET.RemotePort], cx
; mov [eax + 20], ch ; Remote Port ( LS 16 bits )
; mov [eax + 21], cl ; Remote Port ( LS 16 bits )
mov ebx, [stack_ip]
mov [eax + SOCKET.LocalIP], ebx
mov [eax + SOCKET.RemoteIP], edx
mov [eax + SOCKET.rxDataCount], dword 0
mov [eax + SOCKET.LocalIP], ebx
mov [eax + SOCKET.RemoteIP], edx
mov [eax + SOCKET.rxDataCount], dword 0
; Now fill in TCB state
mov ebx, TCB_LISTEN
@ -279,7 +279,7 @@ socket_open_tcp:
sot_001:
mov [eax + SOCKET.TCBState], ebx ; Indicate the state of the TCB
mov esi, [0x3010]
mov esi, [TASK_BASE]
mov ecx, [esi+TASKDATA.pid]
mov [eax + SOCKET.PID], ecx ; save the process ID
@ -709,7 +709,7 @@ socket_write:
pop eax ; get callers ptr to data to send
; Get the address of the callers data
mov edi, [0x3010]
mov edi, [TASK_BASE]
add edi, TASKDATA.mem_start
add eax, [edi]
mov esi, eax
@ -824,7 +824,7 @@ socket_write_tcp:
mov bl, 0x10 ; ACK
; Get the address of the callers data
mov edi, [0x3010]
mov edi, [TASK_BASE]
add edi, TASKDATA.mem_start
add edx, [edi]
mov esi, edx

View File

@ -215,7 +215,7 @@ sh_001:
mov [last_1sTick], al
stdcall arp_table_manager, ARP_TABLE_TIMER, 0, 0
stdcall arp_table_manager, ARP_TABLE_TIMER, 0, 0
call tcp_tcb_handler
sh_exit:
@ -485,8 +485,8 @@ not13:
; write the dns IP Address
mov [dns_ip], ebx
ret
ret
;<added by Frank Sommer>
not14:
cmp eax, 15
@ -495,7 +495,7 @@ not14:
; in ebx we need 4 to read the last 2 bytes
cmp ebx, dword 4
je read
; or we need 0 to read the first 4 bytes
cmp ebx, dword 0
jnz param_error
@ -504,13 +504,13 @@ not14:
read:
mov eax, [node_addr + ebx]
jmp @f
param_error:
param_error:
mov eax, -1 ; params not accepted
@@:
ret
; 0 -> arp_probe
; 1 -> arp_announce
; 2 -> arp_responce (not supported yet)
@ -518,33 +518,33 @@ param_error:
not15: ; ARP stuff
cmp eax, 16
jnz not16
cmp ebx, 0
je a_probe
cmp ebx, 1
je a_ann ; arp announce
; cmp ebx,2
; jne a_resp ; arp response
jmp param15_error
; arp probe, sender IP must be set to 0.0.0.0, target IP is set to address being probed
; ecx: pointer to target MAC, MAC should set to 0 by application
; edx: target IP
a_probe:
push dword [stack_ip]
mov edx, [stack_ip]
mov [stack_ip], dword 0
mov esi, ecx ; pointer to target MAC address
mov esi, ecx ; pointer to target MAC address
call arp_request
pop dword [stack_ip]
pop dword [stack_ip]
jmp @f
; arp announce, sender IP must be set to target IP
; ecx: pointer to target MAC
a_ann:
@ -552,10 +552,10 @@ a_ann:
mov esi, ecx ; pointer to target MAC address
call arp_request
jmp @f
param15_error:
mov eax, -1
@@:
ret
;</added by Frank Sommer>
@ -929,7 +929,7 @@ stack_get_packet:
push eax ; save address of IP data
; Get the address of the callers data
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add edx,[edi]
mov edi, edx
@ -992,7 +992,7 @@ stack_insert_packet:
pop eax ; get callers ptr to data to send
; Get the address of the callers data
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add eax,[edi]
mov esi, eax

View File

@ -1057,14 +1057,14 @@ ste_data:
; flag an event to the application
pop eax
mov ecx,1
mov esi,0x3020+TASKDATA.pid
mov esi,TASK_DATA+TASKDATA.pid
news:
cmp [esi],eax
je foundPID1
inc ecx
add esi,0x20
cmp ecx,[0x3004]
cmp ecx,[TASK_COUNT]
jbe news
foundPID1:

View File

@ -11,13 +11,13 @@
;; See file COPYING for details ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;*******************************************************************
; Interface
;
; udp_rx Handles received IP packets with the UDP protocol
;
;
;*******************************************************************
@ -63,28 +63,28 @@ end virtual
;***************************************************************************
udp_rx:
push eax
; First validate the header & checksum. Discard buffer if error
; Look for a socket where
; IP Packet UDP Destination Port = local Port
; IP Packet SA = Remote IP
movzx ebx, word [edx + 22] ; get the local port from
; the IP packet's UDP header
mov eax, SOCKETBUFFSIZE * NUM_SOCKETS
mov ecx, NUM_SOCKETS
fs1:
sub eax, SOCKETBUFFSIZE
cmp [eax + sockets + 12], bx ; bx will hold the 'wrong' value,
; but the comparision is correct
loopnz fs1 ; Return back if no match
jz fs_done
; No match, so exit
jmp udprx_001
fs_done:
; For dhcp, we must allow any remote server to respond.
; I will accept the first incoming response to be the one
@ -92,13 +92,13 @@ fs_done:
; 255.255.255.255
mov ebx, [eax + sockets + 16]
cmp ebx, 0xffffffff
je udprx_002
je udprx_002
mov ebx, [edx + 12] ; get the Source address from the IP packet
cmp [eax + sockets + 16], ebx
jne udprx_001 ; Quit if the source IP is not valid
udprx_002:
udprx_002:
; OK - we have a valid UDP packet for this socket.
; First, update the sockets remote port number with the incoming msg
; - it will have changed
@ -106,58 +106,58 @@ udprx_002:
movzx ebx, word [edx + 20] ; get the UDP source port
; ( was 69, now new )
mov [eax + sockets + 20], bx
; Now, copy data to socket. We have socket address as [eax + sockets].
; We have IP packet in edx
; get # of bytes in ecx
movzx ecx, byte [edx + 3] ; total length of IP packet. Subtract
mov ch, byte [edx + 2] ; 20 + 8 gives data length
sub ecx, 28
mov ebx, eax
add ebx, sockets ; ebx = address of actual socket
mov eax, [ebx+ 4] ; get socket owner PID
push eax
mov eax, [ebx + 24] ; get # of bytes already in buffer
add [ebx + 24], ecx ; increment the count of bytes in buffer
; point to the location to store the data
add ebx, eax
add ebx, SOCKETHEADERSIZE
add ebx, SOCKETHEADERSIZE
; ebx = location for first byte, ecx has count,
; edx points to data
add edx, 28 ; edx now points to the data
mov edi, ebx
mov esi, edx
cld
rep movsb ; copy the data across
; flag an event to the application
pop eax
mov ecx,1
mov esi,0x3020+TASKDATA.pid
mov esi,TASK_DATA+TASKDATA.pid
newsearch:
cmp [esi],eax
je foundPID
inc ecx
add esi,0x20
cmp ecx,[0x3004]
cmp ecx,[TASK_COUNT]
jbe newsearch
foundPID:
foundPID:
shl ecx,8
or dword [ecx+0x80000+APPDATA.event_mask],dword 10000000b ; stack event
mov [check_idle_semaphore],200
mov [check_idle_semaphore],200
udprx_001:
pop eax
call freeBuff ; Discard the packet
ret
ret

View File

@ -30,7 +30,7 @@ sound_interface:
cmp eax,0 ; Load data
jne no_SB16_load_music
mov edi,[0x3010]
mov edi,[TASK_BASE]
add edi,TASKDATA.mem_start
add ebx,[edi]
call code_SB16_load_music
@ -67,17 +67,17 @@ sound_interface:
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
cmp eax, edi ; this is subfunction #55 ?
jne retFunc55 ; if no then return.
cmp byte [sound_flag],0
cmp byte [sound_flag],0
jne retFunc55
movzx eax, byte [countDelayNote]
or al, al ; player is busy ?
jnz retFunc55 ; return counter delay Note
; mov eax, [0x3010]
; mov eax, [TASK_BASE]
; mov eax, [eax+0x10] ; address application im memory
; add eax, edx ; add offset Delay-Note string
; mov [memAdrNote], eax
mov [memAdrNote],edx
mov eax,[0x3010]
mov eax,[TASK_BASE]
mov eax,[eax+TASKDATA.pid]
mov [pidProcessNote],eax
xor eax, eax ; Ok! EAX = 0

View File

@ -361,7 +361,7 @@ proc load_cursor stdcall, src:dword, flags:dword
@@:
mov eax, [CURRENT_TASK]
shl eax, 5
mov eax, [0x3000+eax+4]
mov eax, [CURRENT_TASK+eax+4]
mov ebx, [src]
mov ecx, [flags]
call [create_cursor] ;eax, ebx, ecx
@ -394,7 +394,7 @@ proc delete_cursor stdcall, hcursor:dword
mov ebx, [CURRENT_TASK]
shl ebx, 5
mov ebx, [0x3000+ebx+4]
mov ebx, [CURRENT_TASK+ebx+4]
cmp ebx, [esi+CURSOR.pid]
jne .fail

View File

@ -46,82 +46,82 @@
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
; set_bank for S3 videocards, work on S3 ViRGE PCI (325)
; modified by kmeaw
set_bank:
; modified by kmeaw
set_bank:
pushfd
cli
cmp al,[0xfff2]
je retsb
mov [0xfff2],al
push ax
push dx
push cx
mov cl, al
mov dx, 0x3D4
mov al, 0x38
cli
cmp al,[0xfff2]
je retsb
mov [0xfff2],al
push ax
push dx
push cx
mov cl, al
mov dx, 0x3D4
mov al, 0x38
out dx, al ;CR38 Register Lock 1 ;Note: Traditionally 48h is used to
;unlock and 00h to lock
inc dx
mov al, 0x48
inc dx
mov al, 0x48
out dx, al ;3d5 -?
dec dx
mov al, 0x31
dec dx
mov al, 0x31
out dx, al ;CR31 Memory Configuration Register
;0 Enable Base Address Offset (CPUA BASE). Enables bank operation if set, ;disables if clear.
;4-5 Bit 16-17 of the Display Start Address. For the 801/5,928 see index 51h,
;for the 864/964 see index 69h.
inc dx
in al, dx
dec dx
mov ah, al
mov al, 0x31
out dx, ax
mov al, ah
or al, 9
inc dx
out dx, al
dec dx
mov al, 0x35
inc dx
in al, dx
dec dx
mov ah, al
mov al, 0x31
out dx, ax
mov al, ah
or al, 9
inc dx
out dx, al
dec dx
mov al, 0x35
out dx, al ;CR35 CRT Register Lock
inc dx
in al, dx
dec dx
and al, 0xF0
mov ch, cl
and ch, 0x0F
or ch, al
mov al, 0x35
out dx, al
inc dx
mov al, ch
out dx, ax
dec dx
inc dx
in al, dx
dec dx
and al, 0xF0
mov ch, cl
and ch, 0x0F
or ch, al
mov al, 0x35
out dx, al
inc dx
mov al, ch
out dx, ax
dec dx
mov al, 0x51 ;Extended System Control 2 Register
out dx, al
inc dx
in al, dx
dec dx
and al, 0xF3
shr cl, 2
and cl, 0x0C
or cl, al
mov al, 0x51
out dx, al
inc dx
mov al, cl
out dx, al
dec dx
mov al, 0x38
out dx, al
inc dx
xor al, al
out dx, al
dec dx
pop cx
pop dx
pop ax
retsb:
out dx, al
inc dx
in al, dx
dec dx
and al, 0xF3
shr cl, 2
and cl, 0x0C
or cl, al
mov al, 0x51
out dx, al
inc dx
mov al, cl
out dx, al
dec dx
mov al, 0x38
out dx, al
inc dx
xor al, al
out dx, al
dec dx
pop cx
pop dx
pop ax
retsb:
popfd
ret
@ -364,7 +364,7 @@ vesa12_drawbar:
push ebx
push ecx
push edx
mov ecx,[0x3010]
mov ecx,[TASK_BASE]
add eax,[ecx-twdw+WDATA.box.left]
add ebx,[ecx-twdw+WDATA.box.top]
push eax
@ -402,17 +402,17 @@ vesa12_drawbar:
push eax
push ecx
mov eax,[0x3010]
mov ecx,[eax+draw_data-0x3000+RECT.left]
mov eax,[TASK_BASE]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.left]
cmp ecx,0
jnz dbcblimitlset12
mov ecx,[eax+draw_data-0x3000+RECT.top]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.top]
cmp ecx,0
jnz dbcblimitlset12
mov ecx,[eax+draw_data-0x3000+RECT.right]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[0xfe00]
jnz dbcblimitlset12
mov ecx,[eax+draw_data-0x3000+RECT.bottom]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[0xfe04]
jnz dbcblimitlset12
pop ecx
@ -462,7 +462,7 @@ dbpi24bit12:
mov ebx,3
div ebx
add eax,WinMapAddress
mov ebx,[0x3000]
mov ebx,[CURRENT_TASK]
cld
dbnp2412:
@ -553,7 +553,7 @@ dbpi24bit12:
sub eax,[0xfe80]
shr eax,2
add eax,WinMapAddress
mov ebx,[0x3000]
mov ebx,[CURRENT_TASK]
cld
dbnp3212:
@ -731,7 +731,7 @@ vesa12_putimage:
push edx
movzx eax,word [esp+2]
movzx ebx,word [esp+0]
mov ecx,[0x3010]
mov ecx,[TASK_BASE]
add eax,[ecx-twdw+WDATA.box.left]
add ebx,[ecx-twdw+WDATA.box.top]
push eax
@ -760,15 +760,15 @@ vesa12_putimage:
; check limits while draw ?
push ecx
mov eax,[0x3010]
cmp dword [eax+draw_data-0x3000+RECT.left], 0
mov eax,[TASK_BASE]
cmp dword [eax+draw_data-CURRENT_TASK+RECT.left], 0
jnz dbcblimitlset212
cmp dword [eax+draw_data-0x3000+RECT.top], 0
cmp dword [eax+draw_data-CURRENT_TASK+RECT.top], 0
jnz dbcblimitlset212
mov ecx,[eax+draw_data-0x3000+RECT.right]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.right]
cmp ecx,[0xfe00]
jnz dbcblimitlset212
mov ecx,[eax+draw_data-0x3000+RECT.bottom]
mov ecx,[eax+draw_data-CURRENT_TASK+RECT.bottom]
cmp ecx,[0xfe04]
jnz dbcblimitlset212
pop ecx
@ -798,7 +798,7 @@ vesa12_putimage:
mov ebx,3
div ebx
add edx,WinMapAddress
mov ebx,[0x3000]
mov ebx,[CURRENT_TASK]
mov bh,[esp+4*3]
np2412:
@ -867,7 +867,7 @@ vesa12_putimage:
sub edx,[0xfe80]
shr edx,2
add edx,WinMapAddress
mov ebx,[0x3000]
mov ebx,[CURRENT_TASK]
mov bh,[esp+4*3]
np3212:

View File

@ -122,7 +122,7 @@ vesa20_putimage:
mov [putimg.image_cy], edx
; calculate absolute (i.e. screen) coordinates
mov eax, [0x3010]
mov eax, [TASK_BASE]
mov ebx, [eax-twdw + WDATA.box.left]
add ebx, [putimg.image_cx]
mov [putimg.abs_cx], ebx
@ -211,7 +211,7 @@ vesa20_putimage:
xchg eax, ebp
; get process number
mov ebx, [0x3000]
mov ebx, [CURRENT_TASK]
cmp byte [ScreenBPP], 32
je put_image_end_32
@ -294,7 +294,7 @@ put_image_end_32:
.finish:
add esp, putimg.stack_data
popad
call VGA__putimage
call VGA__putimage
mov [EGA_counter],1
ret
@ -601,7 +601,7 @@ align 4
; edx ye
; edi color
vesa20_drawbar:
pushad
call [disable_mouse]
@ -619,7 +619,7 @@ vesa20_drawbar:
mov [drbar.bar_cx], eax
mov [drbar.bar_cy], ebx
mov edi, [0x3010]
mov edi, [TASK_BASE]
add eax, [edi-twdw + WDATA.box.left] ; win_cx
add ebx, [edi-twdw + WDATA.box.top] ; win_cy
mov [drbar.abs_cx], eax
@ -638,7 +638,7 @@ vesa20_drawbar:
popad
xor eax, eax
inc eax
ret
@@:
cmp ebx, [drbar.bar_sx]
@ -658,7 +658,7 @@ vesa20_drawbar:
popad
xor eax, eax
inc eax
ret
@@:
cmp ebx, [drbar.bar_sy]
@ -701,7 +701,7 @@ vesa20_drawbar:
xchg eax, ebp
; get process number
mov ebx, [0x3000]
mov ebx, [CURRENT_TASK]
cmp byte [ScreenBPP], 24
jne draw_bar_end_32
@ -1045,109 +1045,109 @@ vesa20_drawbackground_stretch:
call calculate_edi
sdp3: ; MAIN LOOP
cmp [edi+WinMapAddress],byte 1 ; ptrBuffer^<>byte(1)
jne snbgp
push eax
push ebx
mov eax,dword [WinMapAddress-8]
imul eax, [esp+4] ;4
xor edx,edx
mov ebx,[ScreenWidth]
div ebx
mov cx,dx
lea esi,[eax+eax*2]
mov eax,dword [WinMapAddress-4]
imul eax, [esp+0] ;0
xor edx,edx
mov ebx,[ScreenHeight]
div ebx
shl ecx,16
mov cx,dx
imul eax, [esp+8] ;8
add esi,eax
mov eax,[esi+0x300000]
push eax
ror ecx,16
xor eax,eax
mov ax,cx
shl eax,1 ; óìíîæåíèå íà 2
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
xor edx,edx
mov ebx,[ScreenWidth]
div ebx
cmp eax,5
pop eax
jb @f
mov ebx,[esi+0x300000+3]
call overlapping_of_points
@@:
push eax
ror ecx,16
xor eax,eax
mov ax,cx
shl eax,1 ; óìíîæåíèå íà 2
lea eax,[eax+eax*4] ; óìíîæåíèå íà
xor edx,edx
mov ebx,[ScreenHeight]
div ebx
cmp eax,5
pop eax
jb @f
mov ebx,[display_data-8]
shl ebx,1
add ebx,[display_data-8]
add ebx,0x300000
add ebx,esi
mov ebx,[ebx]
call overlapping_of_points
@@:
and eax,0xffffff
xchg edi, ebp
stosw
shr eax,16
stosb
xchg ebp, edi ; ebp+=3
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
jz @f
inc ebp ; +1
@@:
pop ebx
pop eax
jmp shook1
sdp3: ; MAIN LOOP
cmp [edi+WinMapAddress],byte 1 ; ptrBuffer^<>byte(1)
jne snbgp
push eax
push ebx
mov eax,dword [WinMapAddress-8]
imul eax, [esp+4] ;4
xor edx,edx
mov ebx,[ScreenWidth]
div ebx
mov cx,dx
lea esi,[eax+eax*2]
mov eax,dword [WinMapAddress-4]
imul eax, [esp+0] ;0
xor edx,edx
mov ebx,[ScreenHeight]
div ebx
shl ecx,16
mov cx,dx
imul eax, [esp+8] ;8
add esi,eax
mov eax,[esi+0x300000]
push eax
ror ecx,16
xor eax,eax
mov ax,cx
shl eax,1 ; óìíîæåíèå íà 2
lea eax,[eax+eax*4] ; óìíîæåíèå íà 5
xor edx,edx
mov ebx,[ScreenWidth]
div ebx
cmp eax,5
pop eax
jb @f
mov ebx,[esi+0x300000+3]
call overlapping_of_points
@@:
push eax
ror ecx,16
xor eax,eax
mov ax,cx
shl eax,1 ; óìíîæåíèå íà 2
lea eax,[eax+eax*4] ; óìíîæåíèå íà
xor edx,edx
mov ebx,[ScreenHeight]
div ebx
cmp eax,5
pop eax
jb @f
mov ebx,[display_data-8]
shl ebx,1
add ebx,[display_data-8]
add ebx,0x300000
add ebx,esi
mov ebx,[ebx]
call overlapping_of_points
@@:
and eax,0xffffff
xchg edi, ebp
stosw
shr eax,16
stosb
xchg ebp, edi ; ebp+=3
cmp [ScreenBPP],byte 24 ; 24 or 32 bpp ? - x size
jz @f
inc ebp ; +1
@@:
pop ebx
pop eax
jmp shook1
overlapping_of_points:
push ecx edi
mov ecx,eax
mov edx,ebx
xor eax,eax
mov al,cl
xor ebx,ebx
mov bl,dl
add eax,ebx
rcr eax,1
xor edi,edi
mov di,ax
xor eax,eax
mov al,ch
xor ebx,ebx
mov bl,dh
add eax,ebx
rcr eax,1
ror edi,8
add edi,eax
ror ecx,8
ror edx,8
xor eax,eax
mov al,ch
xor ebx,ebx
mov bl,dh
add eax,ebx
rcr eax,1
ror edi,8
add eax,edi
ror eax,16
pop edi ecx
overlapping_of_points:
push ecx edi
mov ecx,eax
mov edx,ebx
xor eax,eax
mov al,cl
xor ebx,ebx
mov bl,dl
add eax,ebx
rcr eax,1
xor edi,edi
mov di,ax
xor eax,eax
mov al,ch
xor ebx,ebx
mov bl,dh
add eax,ebx
rcr eax,1
ror edi,8
add edi,eax
ror ecx,8
ror edx,8
xor eax,eax
mov al,ch
xor ebx,ebx
mov bl,dh
add eax,ebx
rcr eax,1
ror edi,8
add eax,edi
ror eax,16
pop edi ecx
ret
snbgp:

View File

@ -53,8 +53,8 @@ paletteVGA:
add ah,1
loop palvganew
; mov dx, 3ceh
; mov ax, 0005h
; out dx, ax
; mov ax, 0005h
; out dx, ax
ret
palette320x200:
@ -114,7 +114,7 @@ uglobal
novesachecksum dd 0x0
EGA_counter db 0
VGA_drawing_screen db 0
VGA_8_pixels:
VGA_8_pixels:
rb 16
temp:
.cx dd 0
@ -196,7 +196,7 @@ checkVga_N13:
ret
VGA_drawbackground:
; draw all
; draw all
cmp [0xfe0c],dword 0x12
jne .end
pushad
@ -206,7 +206,7 @@ VGA_drawbackground:
mov edx,480
@@:
push ebx edx esi edi
shl edx,9
shl edx,9
lea edx,[edx+edx*4]
add esi,edx
shr edx,5
@ -224,7 +224,7 @@ VGA_draw_long_line:
mov dx,3ceh
mov ax,0ff08h
cli
out dx, ax
out dx, ax
mov ax,0005h
out dx, ax
m12pix:
@ -318,7 +318,7 @@ VGA_putpixel:
; ebx = y
mov ecx,eax
mov eax, [esp+32-8+4] ; color
shl ebx,9
shl ebx,9
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov edi,edx
@ -346,7 +346,7 @@ VGA_putpixel:
cmp ah,170
jbe .p13red
or dl,0x08
.p13red:
.p13red:
shr eax,8
cmp ah,85
jbe .p13cont
@ -369,7 +369,7 @@ VGA_putpixel:
popfd
;.end:
ret
VGA__putimage:
; ecx = size [x|y]
; edx = coordinates [x|y]
@ -409,12 +409,12 @@ VGA_draw_bar:
VGA_draw_bar_1:
mov [temp.cx],eax
mov eax, [0x3010]
mov eax, [TASK_BASE]
add ebx, [eax-twdw + 4]
mov eax, [eax-twdw + 0]
add eax, [temp.cx]
and eax,0xfff8
shl ebx,9
shl ebx,9
lea ebx,[ebx+ebx*4] ; óìíîæåíèå íà 5
lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov esi,ebx
@ -434,7 +434,7 @@ VGA_draw_bar_1:
VGA_draw_long_line_1:
push ebx edx esi edi
shl edx,9
shl edx,9
lea edx,[edx+edx*4]
add esi,edx
shr edx,5