Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
91 user(s) are online (58 user(s) are browsing Forums)

Members: 0
Guests: 91

more...

Headlines

 
  Register To Post  

How to make a file system device?
Quite a regular
Quite a regular


See User information
How do one make a file system that the system can read from like a disk? I'm thinking virtual disk/diskimage.device/ramdisk/smbfs kind of thing here.

I have no idea about devices on AmigaOS, it has always been a mystery, but I have a special thing I want to make and I have come to the conclusion that a file system emulation device thing is the best solution to be able to make the data universely accessible.

Where do I start?
How do I make a "DEV:" that can be mounted?
Will it have to be a block device (preferably not) or can I make it more highlevel dir/filename access to it?

I'm not sure if will make the backend a completely custom thing (image file or something) or if it will actually access files on a real existing partition.

But where/how do I start?

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: How to make a file system device?
Amigans Defender
Amigans Defender


See User information
There are three approaches, and it really depends on what you want to do.

The "easy" way is to write a handler. This does not require a .device and it can act like a single virtual disk (see for example my webdav-handler). Handlers can be simple non-filesystem style too, if you don't need a WB mounted volume.

The more involved way is to write a .device/filesystem combo (for example, diskimage.device), where the .device gives low-level access to the physical (or virtual) disk and the filesystem handles the contents (filesystems and handlers are very similar to write)

The third way is what smbfs does, although I have no idea how that works.

In any case it sounds like you'll need to get overly familiar with the AmigaDOS packet specification.

Go to top
Re: How to make a file system device?
Just can't stay away
Just can't stay away


See User information
Have a look at XAD_fs.lha The source is available but not in the archive (only the src drawer icon)

Quote:
/* Copyright (c) 2010-2012 Fredrik Wikstrom. All rights reserved.
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions
** are met:
**
** 1. Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
**
** 2. Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.



XAD_fs allows you to mount any archive supported by XAD as a dos device. I use it to make AISS a device instead of an assign which replaces 6000+ files with one lha file.

The source should have all you need to get you started at least.

Amiga user since 1985
AOS4, A-EON, IBrowse & Alinea Betatester

Ps. I hate the new amigans website. <shudder>
Go to top
Re: How to make a file system device?
Just can't stay away
Just can't stay away


See User information
@Severin

Must have forgot to enable recursive mode with lha (-r option).

In any case a full 7z archive including source is available here (also some other filesystems):
http://www.a500.org/downloads/filesystems/index.xhtml


Edited by salass00 on 2012/11/24 19:24:37
Go to top
Re: How to make a file system device?
Quite a regular
Quite a regular


See User information
Thanks all.
I think a handler might be enough for my needs, as long as it allows to mount a volume on WB, and allows me to process all file/data content going though it by DOS access, I mean managing file names is not enough, I need to stream process the data.

Where can I find info on AmigaDOS packets? Do I still need to buy an ancient (paper) book (that can't be searched or copy'n'pasted from) for a lot of money to be able to develop for AmigaOS?

I'll have a look at the XAD source for starters.

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: How to make a file system device?
Amigans Defender
Amigans Defender


See User information
A handler can do what you want, it (optionally) sucks in data from one end and hands it over to DOS out the other, so you can do as much processing as you like.

I like the AmigaMail vol 2 section on DOS packets, although the information is now present scattered throughout the Autodocs. Other swear by a book (The Amiga Guru or something), but I've never seen that and AFAIK it is long out of print.

My webdav-handler source is here: http://openamiga.org/?function=viewproject&projectid=63 (click on the SVN link near the bottom of the page to browse through)

Also search for empty-handler, it's a very simple handler implementation with source which will give you the basics. FTPMount is another example.

Consider whether you really need it accessible as a WB browsable volume, if you can get away with command-line access and arbitrary file/path naming it makes the whole thing a lot simpler.

Go to top
Re: How to make a file system device?
Quite a regular
Quite a regular


See User information
@Chris

Thanks.
By not being WB browsable, I assume you mean it won't support directory scanning (Examine/ExAll/ExNext)? But it will have to support those functions to be useful for me, otherwise I'd need to keep a separate list of the items in this device which is quite undesirable.

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: How to make a file system device?
Amigans Defender
Amigans Defender


See User information
Quote:
By not being WB browsable, I assume you mean it won't support directory scanning (Examine/ExAll/ExNext)?


Amongst other things, such as anything to do with directory locking, yes.

If you need it to work like a full filesystem volume then there are a lot of packets you need to support. If you don't, then you can get away with (at a minimum) Open, Read, Close. If you need Examine, then you have to support locking. If you're willing to forego compatiblity, you might be able to get away with implementing only the DosPkt64 examine-esque packets, which OS4.1 should use even for old-style Examine calls. The old Examine packets are a PITA to implement so worth avoiding.

Go to top
Re: How to make a file system device?
Quite a regular
Quite a regular


See User information
Sounds like I may need a bit more than examples to get through this. But I can start with Open/Read/Write/Close.

Would it make it easier if I could let the dir scanning calls through directly to another device underneat? This thing is actually going to be like a layer ontop of another volume or directory, like an assign, but able to process the I/O.

But I guess I can go with only the 64-bit OS4 calls for starters.

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: How to make a file system device?
Quite a regular
Quite a regular


See User information
I couldn't seem to get to any sources.

@salass00

There didn't seem to be any sources in that xad_fs.7z archive.

@Chris

There is no SVN link on that page it seems. Maybe one needs an account?

Software developer for Amiga OS3 and OS4.
Develops for OnyxSoft and the Amiga using E and C and occasionally C++
Go to top
Re: How to make a file system device?
Amigans Defender
Amigans Defender


See User information
@Denill

Oh yes, looks like you need to be logged in and a member of the project. I can send it to you privately.

Go to top
Re: How to make a file system device?
Just can't stay away
Just can't stay away


See User information
@Deniil

Quote:

@salass00

There didn't seem to be any sources in that xad_fs.7z archive.


I just downloaded and checked on my ubuntu machine:
http://www.a500.org/downloads/filesystems/xad_fs.7z

It contains the C source files for XADFS and the Makefile I used to compile them in the src directory inside the archive.

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project