OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:45 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Live ISO, VFS, and mount points
PostPosted: Wed Mar 15, 2023 6:29 pm 
Offline

Joined: Tue Jan 05, 2016 9:10 am
Posts: 12
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.


Top
 Profile  
 
 Post subject: Re: Live ISO, VFS, and mount points
PostPosted: Wed Mar 15, 2023 6:55 pm 
Offline
Member
Member

Joined: Wed Mar 30, 2011 12:31 am
Posts: 676
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.

_________________
toaruos on github | toaruos.org | gitlab | twitter | bim - a text editor


Top
 Profile  
 
 Post subject: Re: Live ISO, VFS, and mount points
PostPosted: Wed Mar 15, 2023 10:52 pm 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2293
Location: USA (and Australia)
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.


Top
 Profile  
 
 Post subject: Re: Live ISO, VFS, and mount points
PostPosted: Fri Mar 17, 2023 4:49 am 
Offline
Member
Member

Joined: Wed Oct 26, 2011 12:00 pm
Posts: 202
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.

_________________
mollenos | gracht (protocol library) | vioarr (window-manager) | bake (package manager)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group