diff options
author | Anton Kling <anton@kling.gg> | 2024-12-09 18:35:54 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-12-09 19:17:57 +0100 |
commit | e7272b29feb855f4678c5c510d331f297351d3a2 (patch) | |
tree | a1961628a7466af9320f14827cb528ac688ddb76 /kernel/fs | |
parent | 906923ad3f2ecb2c73d286924e2ac05f8f3ae502 (diff) |
mmu: Make certain allocations physical and virtual mapping linear
Previously it was possible for fragmentation to occur and as a result
certain allocations would have a linear virtual address space but not a
linear physical address space. This is bad since a lot of calls to
kmalloc_align rely upon both being linear, it has now been changed such
that all allocations done by kmalloc_align now guarantee this mapping
holds for both virtual and physical addresses.
It was due to oversight and sheer luck that this had been working for so
long.
Diffstat (limited to 'kernel/fs')
-rw-r--r-- | kernel/fs/ext2.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/fs/ext2.c b/kernel/fs/ext2.c index 948b0af..fe09834 100644 --- a/kernel/fs/ext2.c +++ b/kernel/fs/ext2.c @@ -382,7 +382,6 @@ int get_free_blocks(int allocate, int entries[], u32 num_entries) { u32 current_entry = 0; bgdt_t block_group; if (num_entries > superblock->num_blocks_unallocated) { - kprintf("greater than\n"); return 0; } assert(0 == superblock->num_blocks_in_group % 8); @@ -975,7 +974,7 @@ ext2_mount_error: } void parse_superblock(void) { - superblock = ksbrk(2 * SECTOR_SIZE); + superblock = kmalloc(2 * SECTOR_SIZE); raw_vfs_pread(mount_fd, superblock, 2 * SECTOR_SIZE, EXT2_SUPERBLOCK_SECTOR * SECTOR_SIZE); |