Skip to content

Commit a4b8381

Browse files
kernel: Fix critical bugs and implement FAT filesystem
This commit addresses several critical architectural issues in Bengal Tiger OS and implements missing core functionality: 1. **Memory Management**: Fixed a conflict where the PMM could allocate pages used by the page directory/tables. Expanded identity mapping to 16MB to cover the kernel and the initial heap (at 4MB), preventing page faults during initialization. 2. **Heap Allocator**: Re-implemented `kmalloc_aligned` to store the original pointer, allowing aligned allocations to be safely freed via `kfree`. 3. **FAT Filesystem**: Replaced the stub FAT driver with a functional FAT12/16 implementation that supports boot sector parsing, directory traversal, and cluster chain following. 4. **Shell**: Fixed backspace logic and updated `ls` to use the real filesystem driver. 5. **Build System**: Updated the Makefile to handle missing ISO creation tools gracefully and added a `.gitignore` to exclude build artifacts. These changes make the OS bootable and functional for real-world use cases involving file access and stable memory allocation. Co-authored-by: mahmud-r-farhan <114731414+mahmud-r-farhan@users.noreply.github.com>
1 parent 1460c6e commit a4b8381

33 files changed

Lines changed: 279 additions & 92 deletions

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
iso/
3+
bengaltiger.iso
4+
*.o
5+
*.bin

build/boot.o

1.46 KB
Binary file not shown.

build/common.o

8.57 KB
Binary file not shown.

build/cpu.o

7.22 KB
Binary file not shown.

build/disk.o

17.1 KB
Binary file not shown.

build/fat.o

13.1 KB
Binary file not shown.

build/font.o

3.5 KB
Binary file not shown.

build/gdt.o

4.03 KB
Binary file not shown.

build/heap.o

8.66 KB
Binary file not shown.

build/idt.o

18.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)