From 18334aa2f887f0610c1e75e1d873febd403a006b Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Tue, 9 Jan 2007 11:34:31 +0000 Subject: [PATCH] ntfs.inc: bugfix kernel.asm: normal keyboard typematic rate&delay git-svn-id: svn://kolibrios.org@265 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/fs/ntfs.inc | 43 ++++++++++++++++++++++++++++------------ kernel/trunk/kernel.asm | 33 +++++++++++++++--------------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/kernel/trunk/fs/ntfs.inc b/kernel/trunk/fs/ntfs.inc index 4604d31a17..8184d3ba5f 100755 --- a/kernel/trunk/fs/ntfs.inc +++ b/kernel/trunk/fs/ntfs.inc @@ -284,6 +284,8 @@ ntfs_cur_offs dd ? ; in sectors ntfs_cur_size dd ? ; in sectors ntfs_cur_buf dd ? ntfs_cur_read dd ? ; [output] +ntfs_bCanContinue db ? + rb 3 ntfs_attrlist_buf rb 0x400 ntfs_bitmap_buf rb 0x400 @@ -296,6 +298,7 @@ ntfs_attr_size dq ? ntfs_cur_tail dd ? endg + ntfs_read_attr: ; in: global variables ; out: [ntfs_cur_read] @@ -442,9 +445,19 @@ ntfs_read_attr: ; c) Check for required offset and length mov ecx, [ntfs_attr_offs] jecxz .noattr + push [ntfs_cur_size] + push [ntfs_cur_read] call .doreadattr + pop edx + pop eax jc @f - cmp [ntfs_cur_size], 0 + cmp [ntfs_bCanContinue], 0 + jz @f + sub edx, [ntfs_cur_read] + neg edx + shr edx, 9 + sub eax, edx + mov [ntfs_cur_size], eax jnz .not_in_cur @@: popad @@ -613,6 +626,7 @@ ntfs_read_attr: jmp .scanliststart .doreadattr: + mov [ntfs_bCanContinue], 0 cmp byte [ecx+8], 0 jnz .nonresident mov eax, [ecx+10h] ; length @@ -724,6 +738,8 @@ ntfs_read_attr: inc [ntfs_cur_offs] loop @b pop ecx + xor eax, eax + xor edx, edx cmp [ntfs_cur_size], 0 jnz .readloop add esp, 10h @@ -739,6 +755,7 @@ ntfs_read_attr: jmp .errret .break: add esp, 10h ; CF=0 + mov [ntfs_bCanContinue], 1 ret ntfs_read_file_record: @@ -752,12 +769,12 @@ ntfs_read_file_record: shrd eax, edx, 9 shr edx, 9 jnz .err - push [ntfs_attr_iRecord] - push [ntfs_attr_iBaseRecord] - push [ntfs_attr_offs] - push [ntfs_attr_list] - push dword [ntfs_attr_size+4] - push dword [ntfs_attr_size] + push [ntfs_attr_iRecord] + push [ntfs_attr_iBaseRecord] + push [ntfs_attr_offs] + push [ntfs_attr_list] + push dword [ntfs_attr_size+4] + push dword [ntfs_attr_size] push [ntfs_cur_iRecord] push [ntfs_cur_attr] push [ntfs_cur_offs] @@ -779,12 +796,12 @@ ntfs_read_file_record: pop [ntfs_cur_offs] pop [ntfs_cur_attr] pop [ntfs_cur_iRecord] - pop dword [ntfs_attr_size] - pop dword [ntfs_attr_size+4] - pop [ntfs_attr_list] - pop [ntfs_attr_offs] - pop [ntfs_attr_iBaseRecord] - pop [ntfs_attr_iRecord] + pop dword [ntfs_attr_size] + pop dword [ntfs_attr_size+4] + pop [ntfs_attr_list] + pop [ntfs_attr_offs] + pop [ntfs_attr_iBaseRecord] + pop [ntfs_attr_iRecord] pop edx ecx jc .errret cmp eax, [ntfs_data.frs_size] diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 6791a2b6d2..cb2dd82225 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -719,12 +719,11 @@ first_app_found: call kb_write ; wait until 8042 is ready -; xor ecx,ecx -; @@: -; in al,64h -; and al,00000010b -; loopnz @b - call Wait8042BufferEmpty + xor ecx,ecx + @@: + in al,64h + and al,00000010b + loopnz @b ; mov al, 0xED ; svetodiody - only for testing! ; call kb_write @@ -735,10 +734,10 @@ first_app_found: mov al, 0xF3 ; set repeat rate & delay call kb_write - call kb_read +; call kb_read mov al, 0 ; 30 250 ;00100010b ; 24 500 ;00100100b ; 20 500 call kb_write - call kb_read +; call kb_read ;// mike.dld [ call set_lights ;// mike.dld ] @@ -4114,15 +4113,15 @@ kb_write: push ecx edx mov dl,al - mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's - kw_loop1: - in al,0x64 - test al,0x20 - jz kw_ok1 - loop kw_loop1 - mov ah,1 - jmp kw_exit - kw_ok1: +; mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's +; kw_loop1: +; in al,0x64 +; test al,0x20 +; jz kw_ok1 +; loop kw_loop1 +; mov ah,1 +; jmp kw_exit +; kw_ok1: in al,0x60 mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's kw_loop: