Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8051 → Rev 8052

/kernel/trunk/core/memory.inc
14,11 → 14,11
pushfd
cli
push ebx
;//-
 
cmp [pg_data.pages_free], 1
jle .out_of_memory
;//-
 
 
mov ebx, [page_start]
mov ecx, [page_end]
.l1:
32,20 → 32,20
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
52,7 → 52,7
pop ebx
popfd
ret
;//-
 
endp
 
align 4
65,7 → 65,7
add eax, 7
shr eax, 3
mov [count], eax
;//-
 
mov ebx, [pg_data.pages_free]
sub ebx, 9
js .out_of_memory
72,7 → 72,7
shr ebx, 3
cmp eax, ebx
jg .out_of_memory
;//-
 
mov ecx, [page_start]
mov ebx, [page_end]
.find:
538,7 → 538,7
; eax= linear address
;
; retval
; eax= phisical page address
; eax= physical page address
 
align 4
get_pg_addr:
567,14 → 567,14
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,8 → 583,8
 
.user_space:
test eax, PG_READ
jnz .err_access ;Страница присутствует
;Ошибка доступа ?
jnz .err_access ;Page presents
;Access error ?
 
shr ebx, 12
mov ecx, ebx
591,13 → 591,13
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,17 → 652,17
 
.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
 
/kernel/trunk/core/syscall.inc
15,7 → 15,7
 
align 32
sysenter_entry:
; Настраиваем стек
; Setting up the stack
mov esp, [ss:tss._esp0]
sti
push ebp ; save app esp + 4
33,7 → 33,7
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
/kernel/trunk/core/v86.inc
358,8 → 358,8
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]
/kernel/trunk/init.inc
307,7 → 307,7
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
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