Add back x86_32 support #5

Merged
Bananymous merged 46 commits from x86_32 into main 2024-04-03 02:36:29 +03:00
1 changed files with 11 additions and 0 deletions
Showing only changes of commit 2352c86048 - Show all commits

View File

@ -21,12 +21,23 @@ namespace Kernel
size_t size { 0 };
blkcnt_t blocks { 0 };
#if ARCH(x86_64)
// 2x direct blocks
// 1x singly indirect
// 1x doubly indirect
// 1x triply indirect
BAN::Array<paddr_t, 5> block;
static constexpr size_t direct_block_count = 2;
#elif ARCH(i386)
// 14x direct blocks
// 1x singly indirect
// 1x doubly indirect
// 1x triply indirect
BAN::Array<paddr_t, 17> block;
static constexpr size_t direct_block_count = 14;
#else
#error
#endif
static constexpr size_t max_size =
direct_block_count * PAGE_SIZE +
(PAGE_SIZE / sizeof(paddr_t)) * PAGE_SIZE +