-2

I am using Xfce Ubuntu and building on GCC 10.2. I want to use FAT filesystem or EXT2 filesystem for my hobbyist operating system. I want a specific instruction and specific code for this question, and I am using C to develop my OS. I I want to list directories, make files, read files, and more in the OS. In addition, one is making an 32 bit Protected OS and I use my own kernel, which is not based on Linux or such. Means that I don't have any additional drivers or such. Please help me: how to can I use a filesystem in C (or C++, but I like C more than it) for my own OS?

Jihwan Ahn
  • 51
  • 1
  • 6

1 Answers1

4

How to implement a file system for operating system development

You first need to read a text book about operating systems.

You don't use a file system, you implement yours. For inspiration, look into Ext2, VFAT, XFS. Study their source code inside the Linux kernel source.

Of course, you'll need some compiler, so port GCC (as a cross-compiler) to your OS.

See also OSDEV and Linux From Scratch

Budget several years of full time development efforts.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547