translate russian comments to english #4, no code changes

git-svn-id: svn://kolibrios.org@8053 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rustem Gimadutdinov (rgimad) 2020-07-16 19:31:16 +00:00
parent f8b90e92fa
commit cdf87e6a72
3 changed files with 80 additions and 80 deletions

View File

@ -9,15 +9,15 @@ $Revision$
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
;********************************************************** ;**********************************************************
; Непосредственная работа с устройством СD (ATAPI) ; Direct work with СD (ATAPI) device
;********************************************************** ;**********************************************************
; Автор части исходного текста Кулаков Владимир Геннадьевич ; Author of a part of the source code - Kulakov Vladimir Gennadievich
; Адаптация, доработка и разработка Mario79,<Lrz> ; Adaptation, revision and development - Mario79, <Lrz>
; Максимальное количество повторений операции чтения ; Maximum number of repeats of a read operation
MaxRetr = 10 MaxRetr = 10
; Предельное время ожидания готовности к приему команды ; Maximum waiting time for ready to receive a command
; (в тиках) ; (in ticks)
BSYWaitTime = 1000 ;2 BSYWaitTime = 1000 ;2
NoTickWaitTime = 0xfffff NoTickWaitTime = 0xfffff
CDBlockSize = 2048 CDBlockSize = 2048

View File

@ -21,18 +21,18 @@ align 4
event_uid dd 0 event_uid dd 0
endg endg
EV_SPACE = 512 EV_SPACE = 512
FreeEvents = event_start-EVENT.fd ; "виртуальный" event, используются только поля: FreeEvents = event_start-EVENT.fd ; "virtual" event, only following field used:
; FreeEvents.fd=event_start и FreeEvents.bk=event_end ; FreeEvents.fd=event_start and FreeEvents.bk=event_end
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
init_events: ;; used from kernel.asm init_events: ;; used from kernel.asm
stdcall kernel_alloc, EV_SPACE*sizeof.EVENT stdcall kernel_alloc, EV_SPACE*sizeof.EVENT
or eax, eax or eax, eax
jz .fail jz .fail
; eax - current event, ebx - previos event below ; eax - current event, ebx - previous event below
mov ecx, EV_SPACE ; current - in allocated space mov ecx, EV_SPACE ; current - in allocated space
mov ebx, FreeEvents ; previos - начало списка mov ebx, FreeEvents ; previous - list beginning
push ebx ; оно же и конец потом будет push ebx ; it will be the end later
;-------------------------------------- ;--------------------------------------
align 4 align 4
@@: @@:
@ -41,7 +41,7 @@ align 4
mov ebx, eax ; previos <- current mov ebx, eax ; previos <- current
add eax, sizeof.EVENT ; new current add eax, sizeof.EVENT ; new current
loop @b loop @b
pop eax ; вот оно концом и стало pop eax ; here it became the end
mov [ebx+EVENT.fd], eax mov [ebx+EVENT.fd], eax
mov [eax+EVENT.bk], ebx mov [eax+EVENT.bk], ebx
;-------------------------------------- ;--------------------------------------
@ -57,8 +57,8 @@ MANUAL_DESTROY = 0x80000000 ; bit 31
align 4 align 4
create_event: ;; EXPORT use create_event: ;; EXPORT use
;info: ;info:
; Переносим EVENT из списка FreeEvents в список ObjList текущего слота ; Move EVENT from the FreeEvents list to the ObjList list of the current slot;
; EVENT.state устанавливаем из ecx, EVENT.code косвенно из esi (если esi<>0) ; EVENT.state is set from ecx, EVENT.code indirectly from esi (if esi <> 0)
;param: ;param:
; esi - event data ; esi - event data
; ecx - flags ; ecx - flags
@ -76,9 +76,9 @@ create_event: ;; EXPORT use
align 4 align 4
set_event: ;; INTERNAL use !!! don't use for Call set_event: ;; INTERNAL use !!! don't use for Call
;info: ;info:
; Берем новый event из FreeEvents, заполняем его поля, как указано в ecx,edx,esi ; We take a new event from FreeEvents, fill its fields from ecx, edx, esi
; и устанавливаем в список, указанный в ebx. ; and add it to the list, which specified in ebx.
; Возвращаем сам event (в eax), и его uid (в edx) ; Return event (to eax), and it's uid (to edx)
;param: ;param:
; ebx - start-chain "virtual" event for entry new event Right of him ; ebx - start-chain "virtual" event for entry new event Right of him
; ecx - flags (copied to EVENT.state) ; ecx - flags (copied to EVENT.state)
@ -116,13 +116,13 @@ align 4
align 4 align 4
RemoveEventTo: ;; INTERNAL use !!! don't use for Call RemoveEventTo: ;; INTERNAL use !!! don't use for Call
;param: ;param:
; eax - указатель на event, КОТОРЫЙ вставляем ; eax - pointer to event, WHICH we will insert
; ebx - указатель на event, ПОСЛЕ которого вставляем ; ebx - pointer to event, AFTER which we will insert
;scratched: ebx,ecx ;scratched: ebx,ecx
mov ecx, eax ; ecx=eax=Self, ebx=NewLeft mov ecx, eax ; ecx=eax=Self, ebx=NewLeft
xchg ecx, [ebx+EVENT.fd] ; NewLeft.fd=Self, ecx=NewRight xchg ecx, [ebx+EVENT.fd] ; NewLeft.fd=Self, ecx=NewRight
cmp eax, ecx ; стоп, себе думаю... cmp eax, ecx ; stop, I think...
je .break ; - а не дурак ли я? je .break ; - am I not a fool?
mov [ecx+EVENT.bk], eax ; NewRight.bk=Self mov [ecx+EVENT.bk], eax ; NewRight.bk=Self
xchg ebx, [eax+EVENT.bk] ; Self.bk=NewLeft, ebx=OldLeft xchg ebx, [eax+EVENT.bk] ; Self.bk=NewLeft, ebx=OldLeft
xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight xchg ecx, [eax+EVENT.fd] ; Self.fd=NewRight, ecx=OldRight
@ -143,22 +143,22 @@ NotDummyTest: ;; INTERNAL use (not returned
push edi push edi
;-------------------------------------- ;--------------------------------------
align 4 align 4
.small: ; криво как-то... .small: ; somehow ugly...
pop edi pop edi
pushfd pushfd
cli cli
call pid_to_slot ; saved all registers (eax - retval) call pid_to_slot ; saved all registers (eax - retval)
shl eax, 8 shl eax, 8
jz RemoveEventTo.break ; POPF+RET jz RemoveEventTo.break ; POPF+RET
jmp edi ; штатный возврат jmp edi ; normal return
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
raise_event: ;; EXPORT use raise_event: ;; EXPORT use
;info: ;info:
; Устанавливаем данные EVENT.code ; Setting up EVENT.code data
; Если там флаг EVENT_SIGNALED уже активен - больше ничего ; If is has flag EVENT_SIGNALED activated - nothing else
; Иначе: этот флаг взводится, за исключением случая наличия флага EVENT_WATCHED в edx ; Otherwise: activate this flag, except when the EVENT_WATCHED flag is present in edx
; В этом случае EVENT_SIGNALED взводится лишь при наличие EVENT_WATCHED в самом событии ; In this case EVENT_SIGNALED will activated only if EVENT_WATCHED presents in the event itself
;param: ;param:
; eax - event ; eax - event
; ebx - uid (for Dummy testing) ; ebx - uid (for Dummy testing)
@ -206,8 +206,8 @@ clear_event: ;; EXPORT use
align 4 align 4
send_event: ;; EXPORT use send_event: ;; EXPORT use
;info: ;info:
; Создает новый EVENT (вытаскивает из списка FreeEvents) в списке EventList ; Creates a new EVENT (pulls from the FreeEvents list) in the EventList list
; целевого слота (eax=pid), с данными из esi косвенно, и state=EVENT_SIGNALED ; of target slot (eax=pid), with data from esi indirectly, and state=EVENT_SIGNALED
;param: ;param:
; eax - slots pid, to sending new event ; eax - slots pid, to sending new event
; esi - pointer to sending data (in code field of new event) ; esi - pointer to sending data (in code field of new event)
@ -252,24 +252,24 @@ Wait_events:
align 4 align 4
Wait_events_ex: Wait_events_ex:
;info: ;info:
; Ожидание "абстрактного" события через перевод слота в 5-ю позицию. ; Waiting for an "abstract" event by moving the slot to the 5th position.
; Абстрактность заключена в том, что факт события определяется функцией APPDATA.wait_test, ; Abstractness lies in the fact, that the fact of an event is determined by the APPDATA.wait_test function,
; которая задается клиентом и может быть фактически любой. ; which is set by the client and can be actually anything.
; Это позволяет shed-у надежно определить факт события, и не совершать "холостых" переключений, ; This allows the shed to reliably determine the fact of the event, and not make "idle" switches,
; предназначенных для разборок типа "свой/чужой" внутри задачи. ; intended for showdowns like "friend / foe" within the problem.
;param: ;param:
; edx - wait_test, клиентская ф-я тестирования (адрес кода) ; edx - wait_test, client testing function (code address)
; ecx - wait_param, дополнительный параметр, возможно необходимый для [wait_test] ; ecx - wait_param, additional parameter, possibly needed for [wait_test]
; ebx - wait_timeout ; ebx - wait_timeout
;retval: ;retval:
; eax - результат вызова [wait_test] (=0 => timeout) ; eax - call result [wait_test] (=0 => timeout)
;scratched: esi ;scratched: esi
mov esi, [current_slot] mov esi, [current_slot]
mov [esi+APPDATA.wait_param], ecx mov [esi+APPDATA.wait_param], ecx
pushad pushad
mov ebx, esi;пока это вопрос, чего куды сувать.......... mov ebx, esi ;now this is a question, what where to put..........
pushfd ; это следствие общей концепции: пусть ф-я тестирования имеет pushfd ; this is a consequence of the general concept: let the test function have
cli ; право рассчитывать на закрытые прерывания, как при вызове из shed cli ; the right to hope to disable interrupts, as when called from shed
call edx call edx
popfd popfd
mov [esp+28], eax mov [esp+28], eax
@ -292,12 +292,12 @@ align 4
align 4 align 4
wait_event: ;; EXPORT use wait_event: ;; EXPORT use
;info: ;info:
; Ожидание флага EVENT_SIGNALED в совершенно конкретном Event ; Waiting for the EVENT_SIGNALED flag in a very specific Event
; (устанавливаемого, надо полагать, через raise_event) ; (set, presumably, via raise_event)
; При активном флаге MANUAL_RESET - больше ничего ; When the MANUAL_RESET flag is active, nothing else
; Иначе: флаги EVENT_SIGNALED и EVENT_WATCHED у полученного события сбрасываются, ; Otherwise: the flags EVENT_SIGNALED and EVENT_WATCHED for the received event are cleared,
; и, при активном MANUAL_DESTROY - перемещается в список ObjList текущего слота, ; and, if MANUAL_DESTROY is active, it moves to the ObjList list of the current slot,
; а при не активном - уничтожается штатно (destroy_event.internal) ; and if not active, it is destroyed normally (destroy_event.internal)
;param: ;param:
; eax - event ; eax - event
; ebx - uid (for Dummy testing) ; ebx - uid (for Dummy testing)
@ -328,16 +328,16 @@ wait_event_timeout:
align 4 align 4
get_event_ex: ;; f68:14 get_event_ex: ;; f68:14
;info: ;info:
; Ожидание любого события в очереди EventList текущего слота ; Waiting for any event in the EventList of the current slot
; Данные события code - копируются в память приложения (косвенно по edi) ; Code event data - copied to application memory (indirectly by edi)
; При активном флаге MANUAL_RESET - больше ничего ; When the MANUAL_RESET flag is active, nothing else
; Иначе: флаги EVENT_SIGNALED и EVENT_WATCHED у полученного события сбрасываются, ; Otherwise: the flags EVENT_SIGNALED and EVENT_WATCHED for the received event are cleared,
; и, при активном MANUAL_DESTROY - перемещается в список ObjList текущего слота, ; and, if MANUAL_DESTROY is active, it moves to the ObjList list of the current slot,
; а при не активном - уничтожается штатно (destroy_event.internal) ; and if not active, it is destroyed normally (destroy_event.internal)
;param: ;param:
; edi - адрес в коде приложения для копирования данных из EVENT.code ; edi - address in the application code to copy data from EVENT.code
;retval: ;retval:
; eax - собственно EVENT (будем называть это его хэндлом) ; eax - EVENT itself (we will call it a handle)
;scratched: ebx,ecx,edx,esi,edi ;scratched: ebx,ecx,edx,esi,edi
mov edx, get_event_queue ; wait_test mov edx, get_event_queue ; wait_test
call Wait_events ; timeout ignored call Wait_events ; timeout ignored
@ -363,12 +363,12 @@ wait_finish:
align 4 align 4
destroy_event: ;; EXPORT use destroy_event: ;; EXPORT use
;info: ;info:
; Переносим EVENT в список FreeEvents, чистим поля magic,destroy,pid,id ; Move EVENT to the FreeEvents list, clear the magic, destroy, pid, id fields
;param: ;param:
; eax - event ; eax - event
; ebx - uid (for Dummy testing) ; ebx - uid (for Dummy testing)
;retval: ;retval:
; eax - адрес объекта EVENT (=0 => fail) ; eax - address of EVENT object (=0 => fail)
;scratched: ebx,ecx ;scratched: ebx,ecx
call DummyTest ; not returned for fail !!! call DummyTest ; not returned for fail !!!
;-------------------------------------- ;--------------------------------------
@ -387,17 +387,17 @@ align 4
align 4 align 4
get_event_queue: get_event_queue:
;info: ;info:
; клиентская ф-я тестирования для get_event_ex ; client testing function for get_event_ex
;warning: ;warning:
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot ; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
; -may be assumed, that interrupt are disabled ; -may be assumed, that interrupt are disabled
; -it is not restriction for scratched registers ; -it is not restriction for scratched registers
;param: ;param:
; ebx - адрес APPDATA слота тестирования ; ebx - APPDATA address of testing slot
;retval: ;retval:
; eax - адрес объекта EVENT (=0 => fail) ; eax - address of EVENT object (=0 => fail)
add ebx, APP_EV_OFFSET add ebx, APP_EV_OFFSET
mov eax, [ebx+APPOBJ.bk] ; выбираем с конца, по принципу FIFO mov eax, [ebx+APPOBJ.bk] ; we choose from the end, according to the FIFO principle
cmp eax, ebx ; empty ??? cmp eax, ebx ; empty ???
je get_event_alone.ret0 je get_event_alone.ret0
;-------------------------------------- ;--------------------------------------
@ -408,15 +408,15 @@ align 4
align 4 align 4
get_event_alone: get_event_alone:
;info: ;info:
; клиентская ф-я тестирования для wait_event ; client testing function for wait_event
;warning: ;warning:
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot ; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
; -may be assumed, that interrupt are disabled ; -may be assumed, that interrupt are disabled
; -it is not restriction for scratched registers ; -it is not restriction for scratched registers
;param: ;param:
; ebx - адрес APPDATA слота тестирования ; ebx - APPDATA address of testing slot
;retval: ;retval:
; eax - адрес объекта EVENT (=0 => fail) ; eax - address of EVENT object (=0 => fail)
mov eax, [ebx+APPDATA.wait_param] mov eax, [ebx+APPDATA.wait_param]
test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24 test byte[eax+EVENT.state+3], EVENT_SIGNALED shr 24
jnz .ret jnz .ret
@ -464,7 +464,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.result: .result:
setae byte[esp+32+4] ;считаем, что исходно: dword[esp+32+4]==72 setae byte[esp+32+4] ;we consider that initially was: dword[esp+32+4]==72
;-------------------------------------- ;--------------------------------------
align 4 align 4
.retf: .retf:
@ -476,9 +476,9 @@ align 4
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
align 4 align 4
sys_getevent: ;; f11 sys_getevent: ;; f11
mov ebx, [current_slot];пока это вопрос, чего куды сувать.......... mov ebx, [current_slot] ;now this is a question, what where to put......
pushfd ; это следствие общей концепции: пусть ф-я тестирования имеет pushfd ; this is a consequence of the general concept: let the test function have
cli ; право рассчитывать на закрытые прерывания, как при вызове из shed cli ; the right to hope to disable interrupts, as when called from shed
call get_event_for_app call get_event_for_app
popfd popfd
mov [esp+32], eax mov [esp+32], eax
@ -500,15 +500,15 @@ sys_wait_event_timeout: ;; f23
align 4 align 4
get_event_for_app: ;; used from f10,f11,f23 get_event_for_app: ;; used from f10,f11,f23
;info: ;info:
; клиентская ф-я тестирования для приложений (f10,f23) ; client testing function for applications (f10,f23)
;warning: ;warning:
; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot ; -don't use [TASK_BASE],[current_slot],[CURRENT_TASK] - it is not for your slot
; -may be assumed, that interrupt are disabled ; -may be assumed, that interrupt are disabled
; -it is not restriction for scratched registers ; -it is not restriction for scratched registers
;param: ;param:
; ebx - адрес APPDATA слота тестирования ; ebx - APPDATA address of testing slot
;retval: ;retval:
; eax - номер события (=0 => no events) ; eax - event number (=0 => no events)
movzx edi, bh ; bh is assumed as [CURRENT_TASK] movzx edi, bh ; bh is assumed as [CURRENT_TASK]
shl edi, 5 shl edi, 5
add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE] add edi, CURRENT_TASK ; edi is assumed as [TASK_BASE]
@ -516,11 +516,11 @@ get_event_for_app: ;; used from f10,f11,f23
and ecx, 0x7FFFFFFF and ecx, 0x7FFFFFFF
;-------------------------------------- ;--------------------------------------
align 4 align 4
.loop: ; пока не исчерпаем все биты маски .loop: ; until we run out all the bits of the mask
bsr eax, ecx ; находим ненулевой бит маски (31 -> 0) bsr eax, ecx ; find a non-zero bit of the mask (31 -> 0)
jz .no_events ; исчерпали все биты маски, но ничего не нашли ??? jz .no_events ; ran out all the bits of the mask but found nothing ???
btr ecx, eax ; сбрасываем проверяемый бит маски btr ecx, eax ; clear the current checking bit of the mask
; переходим на обработчик этого (eax) бита ; go to the handler of this (eax) bit
cmp eax, 10 cmp eax, 10
jae .loop ; eax=[10..31], ignored (event 11...32) jae .loop ; eax=[10..31], ignored (event 11...32)

View File

@ -403,14 +403,14 @@ align 4
align 4 align 4
.no_mouseunder: .no_mouseunder:
shl ebx, 9 shl ebx, 9
lea ebx, [ebx+ebx*4] ; умножение на 5 lea ebx, [ebx+ebx*4] ; multiply by 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32) lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov edi, edx mov edi, edx
add edi, [LFBAddress] ; + LFB address add edi, [LFBAddress] ; + LFB address
mov [edi], eax ; write to LFB for Vesa2.0 mov [edi], eax ; write to LFB for Vesa2.0
shr edx, 5 ; change BytesPerPixel to 1/8 shr edx, 5 ; change BytesPerPixel to 1/8
mov edi, edx mov edi, edx
add edi, VGABasePtr ; address of pixel in VGA area add edi, VGABasePtr ; address of pixel in VGA area
and ecx, 0x07 ; bit no. (modulo 8) and ecx, 0x07 ; bit no. (modulo 8)
pushfd pushfd
; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8) ; edi = address, eax = 24bit colour, ecx = bit no. (modulo 8)
@ -501,10 +501,10 @@ VGA_draw_bar_1:
add eax, [temp.cx] add eax, [temp.cx]
and eax, 0xfff8 and eax, 0xfff8
shl ebx, 9 shl ebx, 9
lea ebx, [ebx+ebx*4]; умножение на 5 lea ebx, [ebx+ebx*4] ; multiply by 5
lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32) lea ebx, [ebx+eax*4] ; + x*BytesPerPixel (Vesa2.0 32)
mov esi, ebx mov esi, ebx
add esi, [LFBAddress] ; + LFB address add esi, [LFBAddress] ; + LFB address
shr ebx, 5 ; change BytesPerPixel to 1/8 shr ebx, 5 ; change BytesPerPixel to 1/8
mov edi, ebx mov edi, ebx
add edi, VGABasePtr ; address of pixel in VGA area add edi, VGABasePtr ; address of pixel in VGA area