Posts

Developing a User Allocator-Deallocator Plugin for IMFS in RTEMS

In this blog, I share my experience developing a user-defined allocator-deallocator plugin for the IMFS filesystem in the RTEMS real-time operating system. This plugin enables custom memory management strategies, addressing limitations in the default RTEMS heap. Below, I outline the key components, implementation details, and lessons learned. Why a User Allocator-Deallocator Plugin? The RTEMS kernel typically relies on malloc and free for memory allocation and deallocation. However, the default heap can face issues like heap overflow, which can compromise system reliability in resource-constrained environments. The user allocator-deallocator plugin allows developers to define custom memory management strategies, reducing dependency on the RTEMS heap and mitigating risks like fragmentation or overflow. The plugin integrates with the IMFS (In-Memory File System) by providing custom functions for allocation, deallocation, and querying free space. These are critical for operations li...

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...

My GSoC Adventure: Boosting RTEMS with IMFS Enhancements

About Me Hi, I'm Bhavya Shah, a computer science student at COEP. I have a strong foundation in Operating Systems, Computer Networks, DBMS, DSA. I’m passionate about systems and their potential to improve lives through technology. Why Open Source? My interest in real-world system development led me to contribute to open-source projects. This passion brought me to Google Summer of Code (GSoC), where I chose to work on RTEMS, a real-time operating system (RTOS). What is RTEMS? RTEMS, or Real-Time Executive for Multiprocessor Systems, is an open-source RTOS designed for embedded systems. It supports various architectures like ARM, PowerPC, and SPARC. RTEMS powers critical applications in space flight, medical devices, and networking, including the Mars Curiosity Rover, due to its reliable real-time performance. Understanding IMFS The In-Memory File System (IMFS) is RTEMS’s default root filesystem, operating entirely in RAM, making it ideal for embedded systems with limited storage. It...