ext2
This document describes the ext2 filesystem driver in the Kyronix kernel. It is the child of Filesystems.
Source
kernel/fs/ext2.c
Overview
The ext2 driver provides read/write access to ext2/3 filesystems. It is the primary disk-based filesystem used for the root partition.
Features
- Block size: 4096 bytes
- Inode-based file storage
- Directory entries with inode references
- Symbolic link support
- File creation, deletion, renaming
- Permission bits (mode, uid, gid)
Mount Process
- Read superblock from block device
- Validate magic number and block size
- Initialize block and inode bitmaps
- Mount at specified path
Block Allocation
The driver maintains block and inode bitmaps. Free blocks are found via linear scan of the bitmap. Block groups are used to distribute metadata across the disk.
Registration
ext2_init(); // Register ext2 filesystem driver
After registration, the kernel attempts to mount ext2 on block devices during boot.
Last reviewed: 2026-07-22