Posts

Showing posts from June, 2025

IMFS_statvfs: API to get IMFS statistics

Over the past few weeks, I had the opportunity to implement the IMFS_statvfs function in the RTEMS kernel. This was an engaging and educational experience that gave me a deeper understanding of how virtual file systems work and how the IMFS (In-Memory File System) is structured within RTEMS. The project involved studying existing infrastructure, learning how system calls are routed through the kernel, and eventually writing a missing backend for an existing API. To start with, statvfs is a POSIX system call that retrieves information about a mounted file system. When invoked, it fills a struct statvfs with statistics such as total blocks, free blocks, block size, and so on. This information can be extremely useful to applications that need to monitor storage usage, enforce quotas, or make decisions based on available space. The struct statvfs , as defined by POSIX, contains several important fields. Some of the key fields include: f_bsize : The file system block size. All data i...