OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 19, 2024 12:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 77 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: FUSE filesystem?
PostPosted: Tue Nov 09, 2021 10:19 am 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. My name is Zane. I'm developing a system called Cotton Candy OS. I'm trying to add a FUSE filesystem, but i don't know how to implement the fuse protocol. My OS is based on this tutorial: https://github.com/cfenollosa/os-tutorial. I have been researching for about a month now. If someone could help me that would be great.
P.S. I also need disk read/write


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Tue Nov 09, 2021 11:53 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
zap8600 wrote:
I'm trying to add a FUSE filesystem, but i don't know how to implement the fuse protocol.

Are you trying to implement a library that provides the libfuse API, or are you trying to implement the FUSE kernel API so you can port libfuse to your OS?

zap8600 wrote:
My OS is based on this tutorial:

Be careful, most OS development tutorials are written by beginners, and beginners make mistakes.

zap8600 wrote:
P.S. I also need disk read/write

You can always start with a virtual disk in memory, if you don't want to write device drivers yet. You'll probably need a VFS at some point, too.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 11:20 am 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. Thanks for replying. I'm guessing that I would've been trying to implement the FUSE kernel API because I wanted it to write to the filesystem. Now as I think about it, that doesn't make much sense. I have been aware about the tutorial. If I were to add a VFS, would I need some disk r/w drivers? If so, then could I get a tutorial or something similar about adding one? That would be much appreciated.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 12:00 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
zap8600 wrote:
If I were to add a VFS, would I need some disk r/w drivers?

You wouldn't need them, but you would probably want them. (Unless your goal is to write an OS that exclusively uses network filesystems or something like that.)

zap8600 wrote:
If so, then could I get a tutorial or something similar about adding one?

There are no tutorials for most things in OS development. We do have a lot of information about different types of storage hardware, though. Whatever hardware you chose to support first, you'll probably need to enumerate PCI to find it, so that's a good starting point.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 12:33 pm 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. Thanks for responding. I don't really plan on using network filesystems. The first device I will probably support would be either the easiest or a USB. The reason why I would pick a USB is because I don't really find a lot of people wanting to use it. Sure, some people will want to check it out, but I don't thinks they would actually use it. I might need information on HDDs so that I can emulate my OS in QEMU because I only have a Raspberry Pi to run my code on. I would much appreciate information about devices, inodes (for the VFS), and devices. That would be much appreciated.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 12:51 pm 
Offline
Member
Member
User avatar

Joined: Fri Sep 03, 2021 5:20 pm
Posts: 91
zap8600 wrote:
Hi. Thanks for responding. I don't really plan on using network filesystems. The first device I will probably support would be either the easiest or a USB. The reason why I would pick a USB is because I don't really find a lot of people wanting to use it. Sure, some people will want to check it out, but I don't thinks they would actually use it. I might need information on HDDs so that I can emulate my OS in QEMU because I only have a Raspberry Pi to run my code on. I would much appreciate information about devices, inodes (for the VFS), and devices. That would be much appreciated.


Because supporting a USB drive would imply working USB drivers and the disk access layer on top of that, maybe start with a regular and easily emulated drive like a SATA drive to mature your disk access skills and code before doing something that has more layers and, consequentially, greater probability of introducing bugs and other mistakes? Just a suggestion.

_________________
Writing a bootloader in under 15 minutes: https://www.youtube.com/watch?v=0E0FKjvTA0M


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 1:58 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
zap8600 wrote:
The first device I will probably support would be either the easiest or a USB.

The easiest to get working well enough that you can read and write the disk would be PCI IDE. If you want something you can quickly put together to use in QEMU, that's the way to go. (It gets less easy when you start looking at things like DMA or detecting whether a drive is attached.)

I wouldn't recommend starting with USB. I mean, you definitely could if you want to, but it's a lot more work when you have to figure out how to write a driver along the way.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 2:34 pm 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. Thanks for all your help! Sorry if I don't understand all of the information. I am in middle school, and my programming is far more advanced than what my school teaches. I'll probably need some help, as my C skills aren't that great. Thanks for all the help!


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Wed Nov 10, 2021 5:46 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
Quote:
I'll probably need some help, as my C skills aren't that great

I would recommend getting the book "C Programming" by Sams Teach Yourself. Excellent book that describes C. If you're looking for somewhat of a challenge, you can also pick up Brian Kerninghan and Dennis Ritchie's 1989 C book.

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 9:22 am 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. I have been reading the OSDev Wiki page on PCI IDE Controllers, and while reading through it, I noticed a couple of things. First, it requires an IRQ. My OS currently only has 2 IRQs; the timer (IRQ0) and the keyboard (IRQ1). Second, the code is a little different on this. If I could get some help, that would be much appreciated.
P.S If you need to look at my code, you can look at the tutorial I linked in my first post.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 9:38 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
zap8600 wrote:
First, it requires an IRQ.

It doesn't require an IRQ. It's a good idea to use an IRQ, but you can poll the drive status if you don't want to use the IRQ. The wiki page you're looking at might assume you're already familiar with legacy IDE. Take a look at other pages in this category. (This is one part of the wiki that could really use some reorganization, but unfortunately that takes time I don't have.)

zap8600 wrote:
Second, the code is a little different on this.

What do you mean?


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 9:53 am 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. Thanks for the response. What I meant was that some of the functions (such as outb an inb) are coded differently than mine.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 10:13 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5069
The code on the wiki is only an example. You're not supposed to copy it into your kernel, you're supposed to read it to understand how you could write your own code.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 12:15 pm 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. That is what I've been doing. I just thought that since my code is different, I would have to take what I understand and change it a lot.


Top
 Profile  
 
 Post subject: Re: FUSE filesystem?
PostPosted: Thu Nov 11, 2021 3:04 pm 
Offline
Member
Member

Joined: Tue Nov 02, 2021 11:26 am
Posts: 195
Hi. So back to what I made this forum for...

Now that I've thought about it more, I think I have an idea on making my own filesystem. What I originally wanted to do was implement the FUSE protocol into my kernel so that I could create inodes for files and directories on the disk and read, create, write, and etc. without needing to write really advanced code. Now I see that it's more complicated than I thought. What I could do is make a disk image, make a FUSE driver, open the image with the driver, make a file, close the image, and open the image in a hex editor. Then I could look at the file and, if I ever get disk access working, implement my own way to read files. If there is a way to make files with inodes without needing disk access, I would like to know. That would be much appreciated.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 77 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 5 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