Live ISO, VFS, and mount points

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
startrail
Posts: 12
Joined: Tue Jan 05, 2016 9:10 am

Live ISO, VFS, and mount points

Post by startrail »

I am booting from an ISO for my OSdev and I've implemented the Joliet ISO filesystem.
Since the block device shows up as CD-ROM, the root filesystem also becomes read-only by my design.

I also don't have a separate VFS. I just select the appropriate FS as / and let each FS implementation switch to another FS whenever a mount point is encountered during path traversal.

Now, when I want to mount other filesystems at some mount point say /fs/<GUID>, I'm unable to create the directory /fs.
I was thinking of adding a flag isVirtual to my makeDirectory function which will essentially mean this is a memory-only directory entry and must not be committed to the underlying device. But that seems hackish to me.

I have 2 questions.
1. Is there a better way to create "virtual" directories?
2. How does Live Ubuntu ISO or any other live distro handle this? Assuming the same CD-ROM constraints.
klange
Member
Member
Posts: 679
Joined: Wed Mar 30, 2011 12:31 am
Libera.chat IRC: klange
Discord: klange

Re: Live ISO, VFS, and mount points

Post by klange »

startrail wrote:Is there a better way to create "virtual" directories?
Typically, you'd simply already have these directories present (but empty) on the read-only filesystem, so that they can be used as mount points for writable filesystems later.
startrail wrote:How does Live Ubuntu ISO or any other live distro handle this? Assuming the same CD-ROM constraints.
A Linux live CD will typically use an overlay, putting an in-memory writable filesystem atop read-only data from a squashfs image on the CD.

Further, a Linux live CD may support an additional overlay system called casper, which allows changes to be written to (and read back from) a persistent storage device like a USB stick.
User avatar
AndrewAPrice
Member
Member
Posts: 2298
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Live ISO, VFS, and mount points

Post by AndrewAPrice »

Make empty placeholder directories on your disk drive if needed. Failing that, go with having an overlay.

I got around it by ditching the Unix hierarchy and not having anything mounted at /. My root directories are all virtual (mount points, shortcuts to installed applications, etc.)
My OS is Perception.
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: Live ISO, VFS, and mount points

Post by MollenOS »

I get around this by having a root fs mounted at '/' that is it's own filesystem, but a in-memory filesystem. It implements the same interface as a regular filesystem, except it has no backing device.

Then I just mount new filesystems under /storage/<dev>/<part>/.... and see if the the partition has a mount-point preferred by it's GUID and remount it under /... whatever.
Post Reply