diff --git a/libfs/rw.c b/libfs/rw.c index 94f3eff..d0a2cc3 100644 --- a/libfs/rw.c +++ b/libfs/rw.c @@ -38,6 +38,7 @@ bmap(struct fs_inode *ip, uint32_t blocknum) if (addrs[index] == 0) { addrs[index] = fs_balloc(ip->super); + fs_bio_bwrite(buff); } fs_bio_brelse(buff); return (addrs[index]); diff --git a/tools/mkfs/boot.asm b/tools/mkfs/boot.asm index c2d1c44..ff08afe 100644 --- a/tools/mkfs/boot.asm +++ b/tools/mkfs/boot.asm @@ -136,10 +136,12 @@ start: cmp edx, 7 jb .direct_loop + xchg bx, bx + .indirect_read: push ebx - mov ax, DISK_BUFFER/10 + mov ax, DISK_BUFFER/0x10 mov es, ax mov eax, [DISK_BUFFER + 512 + INODE_SIZE * 2 + inode.zones + 28] ;zones[7] == indirect @@ -147,7 +149,9 @@ start: xor bx, bx call disk_read_sectors - mov ax, LOADER_BASE/10 + xchg bx, bx + + mov ax, LOADER_BASE/0x10 mov es, ax pop ebx