fix: indirect block alloc
This commit is contained in:
parent
8165ea664f
commit
8505e8f23e
|
@ -38,6 +38,7 @@ bmap(struct fs_inode *ip, uint32_t blocknum)
|
||||||
if (addrs[index] == 0)
|
if (addrs[index] == 0)
|
||||||
{
|
{
|
||||||
addrs[index] = fs_balloc(ip->super);
|
addrs[index] = fs_balloc(ip->super);
|
||||||
|
fs_bio_bwrite(buff);
|
||||||
}
|
}
|
||||||
fs_bio_brelse(buff);
|
fs_bio_brelse(buff);
|
||||||
return (addrs[index]);
|
return (addrs[index]);
|
||||||
|
|
|
@ -136,10 +136,12 @@ start:
|
||||||
cmp edx, 7
|
cmp edx, 7
|
||||||
jb .direct_loop
|
jb .direct_loop
|
||||||
|
|
||||||
|
xchg bx, bx
|
||||||
|
|
||||||
.indirect_read:
|
.indirect_read:
|
||||||
push ebx
|
push ebx
|
||||||
|
|
||||||
mov ax, DISK_BUFFER/10
|
mov ax, DISK_BUFFER/0x10
|
||||||
mov es, ax
|
mov es, ax
|
||||||
|
|
||||||
mov eax, [DISK_BUFFER + 512 + INODE_SIZE * 2 + inode.zones + 28] ;zones[7] == indirect
|
mov eax, [DISK_BUFFER + 512 + INODE_SIZE * 2 + inode.zones + 28] ;zones[7] == indirect
|
||||||
|
@ -147,7 +149,9 @@ start:
|
||||||
xor bx, bx
|
xor bx, bx
|
||||||
call disk_read_sectors
|
call disk_read_sectors
|
||||||
|
|
||||||
mov ax, LOADER_BASE/10
|
xchg bx, bx
|
||||||
|
|
||||||
|
mov ax, LOADER_BASE/0x10
|
||||||
mov es, ax
|
mov es, ax
|
||||||
pop ebx
|
pop ebx
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue