Memory

A Shared Memory File System (part 3)

A Shared Memory File System (part 3)

In previous blog posts, I have presented the idea of a shared memory file system, that is FAT based. The FAT consists of a Boot Block and a Disk Block Table. I will finish up this discussion when I describe:

  • Directory Blocks.
  • Extending a FAT in place.
  • File Locking.

Shared Memory File System Directory Blocks

So if a disk block is used, then it is either a directory or a file. So how do we know if a disk block is a directory or a file? We use the next to last most significant bit in the disk block number as a directory flag.

A Shared Memory File System (part 2)

A Shared Memory File System (part 2)

Last time I presented the idea of a memory file system that is FAT based. I would now like to describe the design of our FAT.

Memory File System & The Boot Block

Any decent memory file system starts with a Boot Block. This is the first disk block on the file system partition. The Boot Block contains the file system data structure. And here is what it looks like:

Memory Allocation Quandary

Memory Allocation Quandary

Memory Allocation (and subsequent deallocation) is central to process management.  It is a very powerful mechanism.  But great power also comes with a cost.  Memory Allocation is easily abused and the results can be catastrophic. For the C programming language, Memory Allocation is performed by malloc() and free().

Processes are allowed to call malloc() and free() how often and when ever they choose. However, there are some dangers to avoid.