ext fs debugging

git-svn-id: svn://kolibrios.org@6774 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pathoswithin 2016-11-30 17:27:25 +00:00
parent aa39838a11
commit bb2b6bba8c

View File

@ -366,13 +366,13 @@ extfsExtentFree:
jc .fail jc .fail
pop eax pop eax
push ecx ebx edx push ecx ebx edx
add [ebp+EXTFS.superblock.blocksFree], ecx
mov edi, eax mov edi, eax
shr edi, 5 shr edi, 5
shl edi, 2 shl edi, 2
add edi, ebx add edi, ebx
and eax, 31
mov edx, ecx mov edx, ecx
and eax, 31
jz .aligned
mov ecx, 32 mov ecx, 32
sub ecx, eax sub ecx, eax
sub edx, ecx sub edx, ecx
@ -387,15 +387,15 @@ extfsExtentFree:
shl ebx, cl shl ebx, cl
not ebx not ebx
and [edi], ebx and [edi], ebx
mov ecx, edx
jecxz @f
shr ecx, 5
add edi, 4 add edi, 4
xor eax, eax xor eax, eax
.aligned:
mov ecx, edx
shr ecx, 5
rep stosd rep stosd
and edx, 31 and edx, 31
jz @f
mov ecx, edx mov ecx, edx
jecxz @f
not eax not eax
shl eax, cl shl eax, cl
and [edi], eax and [edi], eax
@ -404,6 +404,7 @@ extfsExtentFree:
call extfsWriteBlock call extfsWriteBlock
pop ecx pop ecx
mov eax, ecx mov eax, ecx
add [ebp+EXTFS.superblock.blocksFree], ecx
mul [ebp+EXTFS.sectorsPerBlock] mul [ebp+EXTFS.sectorsPerBlock]
sub [ebp+EXTFS.inodeBuffer.sectorsUsed], eax sub [ebp+EXTFS.inodeBuffer.sectorsUsed], eax
.ret: .ret:
@ -429,6 +430,8 @@ extfsInodeAlloc:
.test_block_group: .test_block_group:
call extfsReadDescriptor call extfsReadDescriptor
jc .fail jc .fail
cmp [ebx+BGDESCR.blocksFree], 0
jz .next
dec [ebx+BGDESCR.inodesFree] dec [ebx+BGDESCR.inodesFree]
js .next js .next
mov edx, [ebx+BGDESCR.inodeBitmap] mov edx, [ebx+BGDESCR.inodeBitmap]
@ -522,22 +525,23 @@ extfsExtentAlloc:
not eax not eax
shr eax, cl shr eax, cl
shl eax, cl shl eax, cl
bsf ebx, eax
jnz @f
mov ebx, 32 mov ebx, 32
@@: bsf ebx, eax
sub ebx, ecx sub ebx, ecx
mov eax, [esp+16] mov eax, [esp+16]
cmp ebx, eax cmp ebx, eax
jc @f jc @f
mov ebx, eax mov ebx, eax
@@: @@:
xchg ebx, ecx
or eax, -1 or eax, -1
cmp ebx, 32
jz @f
xchg ebx, ecx
shl eax, cl shl eax, cl
not eax not eax
xchg ebx, ecx xchg ebx, ecx
shl eax, cl shl eax, cl
@@:
or [esi], eax or [esi], eax
sub esi, [ebp+EXTFS.tempBlockBuffer] sub esi, [ebp+EXTFS.tempBlockBuffer]
shl esi, 3 shl esi, 3
@ -589,8 +593,9 @@ extfsExtentAlloc:
or eax, -1 or eax, -1
rep stosd rep stosd
mov ecx, ebx mov ecx, ebx
shl eax, cl neg ecx
not eax add ecx, 32
shr eax, cl
or [edi], eax or [edi], eax
.done: .done:
pop eax pop eax
@ -821,6 +826,13 @@ writeInode:
add eax, 978307200 add eax, 978307200
mov [edi+INODE.inodeModified], eax mov [edi+INODE.inodeModified], eax
pop eax pop eax
cmp eax, ROOT_INODE
jnz @f
movzx ecx, [ebp+EXTFS.superblock.inodeSize]
mov esi, edi
mov edi, [ebp+EXTFS.rootInodeBuffer]
rep movsb
@@:
call getInodeLocation call getInodeLocation
jc .ret jc .ret
mov ebx, [ebp+EXTFS.tempBlockBuffer] mov ebx, [ebp+EXTFS.tempBlockBuffer]
@ -829,10 +841,10 @@ writeInode:
test eax, eax test eax, eax
jnz @f jnz @f
mov eax, ecx mov eax, ecx
mov esi, edi
movzx ecx, [ebp+EXTFS.superblock.inodeSize] movzx ecx, [ebp+EXTFS.superblock.inodeSize]
mov edi, edx mov edi, edx
add edi, ebx add edi, ebx
mov esi, [esp]
rep movsb rep movsb
call fs_write32_sys call fs_write32_sys
.ret: .ret: