diff --git a/kernel/trunk/core/memory.inc b/kernel/trunk/core/memory.inc index 075b53dc2e..7f156c9a8b 100644 --- a/kernel/trunk/core/memory.inc +++ b/kernel/trunk/core/memory.inc @@ -14,10 +14,10 @@ proc alloc_page pushfd cli push ebx -;//- + cmp [pg_data.pages_free], 1 jle .out_of_memory -;//- + mov ebx, [page_start] mov ecx, [page_end] @@ -32,27 +32,27 @@ proc alloc_page xor eax, eax ret .found: -;//- + dec [pg_data.pages_free] jz .out_of_memory -;//- + btr [ebx], eax mov [page_start], ebx sub ebx, sys_pgmap lea eax, [eax+ebx*8] shl eax, 12 -;//- dec [pg_data.pages_free] +; dec [pg_data.pages_free] pop ebx popfd ret -;//- + .out_of_memory: mov [pg_data.pages_free], 1 xor eax, eax pop ebx popfd ret -;//- + endp align 4 @@ -65,14 +65,14 @@ proc alloc_pages stdcall, count:dword add eax, 7 shr eax, 3 mov [count], eax -;//- + mov ebx, [pg_data.pages_free] sub ebx, 9 js .out_of_memory shr ebx, 3 cmp eax, ebx jg .out_of_memory -;//- + mov ecx, [page_start] mov ebx, [page_end] .find: @@ -538,7 +538,7 @@ endp ; eax= linear address ; ; retval -; eax= phisical page address +; eax= physical page address align 4 get_pg_addr: @@ -567,14 +567,14 @@ proc page_fault_handler mov eax, [pf_err_code] cmp ebx, OS_BASE ;ebx == .err_addr - jb .user_space ;страница в памяти приложения ; + jb .user_space ;page in application memory cmp ebx, page_tabs - jb .kernel_space ;страница в памяти ядра + jb .kernel_space ;page in kernel memory cmp ebx, kernel_tabs - jb .alloc;.app_tabs ;таблицы страниц приложения ; - ;просто создадим одну + jb .alloc;.app_tabs ;page tables of application ; + ;simply create one .core_tabs: .fail: ;simply return to caller mov esp, ebp @@ -583,21 +583,21 @@ proc page_fault_handler .user_space: test eax, PG_READ - jnz .err_access ;Страница присутствует - ;Ошибка доступа ? + jnz .err_access ;Page presents + ;Access error ? shr ebx, 12 mov ecx, ebx shr ecx, 10 mov edx, [master_tab+ecx*4] test edx, PG_READ - jz .fail ;таблица страниц не создана - ;неверный адрес в программе + jz .fail ;page table is not created + ;incorrect address in program mov eax, [page_tabs+ebx*4] test eax, 2 - jz .fail ;адрес не зарезервирован для ; - ;использования. Ошибка + jz .fail ;address is not reserved for usage. Error + .alloc: call alloc_page test eax, eax @@ -652,16 +652,16 @@ proc page_fault_handler .kernel_space: test eax, PG_READ - jz .fail ;страница не присутствует + jz .fail ;page does not present test eax, 12 ;U/S (+below) - jnz .fail ;приложение обратилось к памяти - ;ядра + jnz .fail ;application requested kernel memory + ;test eax, 8 - ;jnz .fail ;установлен зарезервированный бит - ;в таблицах страниц. добавлено в P4/Xeon + ;jnz .fail ;the reserved bit is set in page tables. Added in P4/Xeon + -;попытка записи в защищённую страницу ядра +;an attempt to write to a protected kernel page cmp ebx, tss._io_map_0 jb .fail diff --git a/kernel/trunk/core/syscall.inc b/kernel/trunk/core/syscall.inc index 83f6354018..d78bd2516b 100644 --- a/kernel/trunk/core/syscall.inc +++ b/kernel/trunk/core/syscall.inc @@ -15,7 +15,7 @@ $Revision$ align 32 sysenter_entry: - ; Настраиваем стек + ; Setting up the stack mov esp, [ss:tss._esp0] sti push ebp ; save app esp + 4 @@ -33,7 +33,7 @@ sysenter_entry: call unprotect_from_terminate popad ;------------------ - xchg ecx, [ss:esp] ; в вершин стека - app ecx, ecx - app esp + 4 + xchg ecx, [ss:esp] ; in the stack top - app ecx, ecx - app esp + 4 sub ecx, 4 xchg edx, [ecx] ; edx - return point, & save original edx push edx diff --git a/kernel/trunk/core/v86.inc b/kernel/trunk/core/v86.inc index 18169816d7..ba3312d674 100644 --- a/kernel/trunk/core/v86.inc +++ b/kernel/trunk/core/v86.inc @@ -358,8 +358,8 @@ v86_exc_c: jnz .nogp ; Otherwise we can safely access byte at CS:IP ; (because it is #GP, not #PF handler) -; Если бы мы могли схлопотать исключение только из-за чтения байтов кода, -; мы бы его уже схлопотали и это было бы не #GP +; If we could get an exception just because of reading code bytes, +; we would have got it already and it wouldn't be #GP movzx esi, word [esp+v86_regs.cs] shl esi, 4 add esi, [esp+v86_regs.eip] diff --git a/kernel/trunk/init.inc b/kernel/trunk/init.inc index 6cb6111701..b4ceb7b618 100644 --- a/kernel/trunk/init.inc +++ b/kernel/trunk/init.inc @@ -307,7 +307,7 @@ init_BIOS32: test al, al jnz .PCI_BIOS32_not_found - ; здесь создаются дискрипторы для PCI BIOS + ; descriptors for PCI BIOS are created here add ebx, OS_BASE dec ecx @@ -331,7 +331,7 @@ init_BIOS32: mov [(pci_bios_entry-OS_BASE)], edx ; jmp .end .PCI_BIOS32_not_found: - ; здесь должна заполнятся pci_emu_dat + ; pci_emu_dat structure should be filled here .BIOS32_not_found: .end: ret