Stickynotes are cute and would be easy to implement, but here is my real Genode wishlist:
Email client - I would be happy with anything IRC client - I love communicating with IRC chat, and the folks at #genode are very helpful :) RSS Reader - I have my most important news sent to me via RSS, and it seems most Genodians like RSS as well Native Firefox - this is but a dream Office Suite - I hear LibreOffice is being ported to Genode?? Cool stuff indeed VPN - Wireguard/OpenVPN GUI audio player
With all of this, I would be able to switch to Genode without needing to virtualize anything. I would be as happy as a clam
Thank you for contributing to this topic Joel, seems to me we need this.
The topic of native (non virtualized) applications is very dear to me, so can't resist adding my two cents:
Stickynotes are cute and would be easy to implement, but here is my real Genode wishlist:
Right on. Even more so than you suspect:
Some windows with a yellow background and editable text are very easy to do (in their early, simplier feature set at least), provided a bit of help from the SDK. No need to bring the extremely powerful and extensive Qt framework in the mix IMHO, using Qt would be like killing a fly with a sledgehammer.
Indeed with the API I'm used to (and for which I would like to see an improved, cleaned up, better variant in Genode) it would be a matter of minutes for an experienced dev to put things together and start compiling and testing. The code is simple enough that it could be the subject of a "tutorial", to introduce people to the API:
The tutorial could go something like..
- Introduction: explain what we're going to learn, program, why, how
- Learn the bare minimum about the "window" class (which in my 'previous' culture is called BWindow). Explain in a couple lines the BWindow ctor with its few params, then mention calling BWindow.Show() to display the window in the framebuffer (which in the case of Genode, belongs to Nitpicker).
- Learn the bare minimum about the "view" class (BView in old parlance). Incl. The SetViewColor() method, to set the background color (to e.g. pastel yellow), the DrawString() method to draw text etc.
- storage: load/save the text (I don't feel qualified to talk about Genode's persistency mechanisms yet)
- putting it all together: instantiate a window, a view, call win.AddChild(view), and lastly..
- text editing: I'll go on a limb and claim this is "left as an exercise to the reader".
- give a short "if you want to learn more, go read up here and here" paragraph
How far are we from making such a tutorial, making it very easy to develop (e.g. small) GUI applications for Genode ?
Discuss :-) (I want to say "not very far", but want to hear from others)
Email client - I would be happy with anything
IRC client - I love communicating with IRC chat, and the folks at #genode are very helpful :)
RSS Reader - I have my most important news sent to me via RSS, and it seems most Genodians like RSS as well
Native Firefox - this is but a dream
Office Suite - I hear LibreOffice is being ported to Genode?? Cool stuff indeed
VPN - Wireguard/OpenVPN
GUI audio player
Somewhat related to item #1: class BMailMessage is part of the code base that Genode got "for free" with the haiku-on-genode port.. Contrarily to other parts that were not easy/possible to adapt to Genode (audio/video code ..etc). In theory, that opens the door to the "mail_daemon" POP3/IMAP daemon, and the "Mail" application. (in practice, didn't yet attempt to compile Mail for Genode, might be missing something). Gotta dig up some screenshots somewhere to illustrate...
Might not be the best example though -- in this case, we're talking of a not really "native" app, strictly speaking, since it comes from a 'foreign' OS and runs with a (sizeable) compatibility layer.
The sticky notes example is a better one since the implementation that would come naturally for it would be a truly native implementation..
Anyway point being, three or four of the above would be doable quickly, one way or another, if the stars align.
**
Some additional (sticky? *g*) notes regarding this topic...
Basically, to make the above stuff happen, a few things would help on your end..
* offer bounties (not necessarily the most critical aspect: a surprising number of people can work "pro bono", for the good of the community, including of course among genodians, or for small/symbolic amounts, even 1 or 2 digits)
* offer to test everything and anything that contributes to the above, coming from devs, and give structured feedback
* if you're a developer, even with little availability, offer to get started on a simple project (sticky notes?) yourself, so long as another dev(s) accepts being your sherpa/mentor, guiding your steps.
With all of this, I would be able to switch to Genode without needing to virtualize anything. I would be as happy as a clam
_______________________________________________
+1 !
Cedric (available on-list and off-list to further discuss this)
p.s. - @john: will respond soon about that "HoG screenshots" thing, thanks!
Correction: "Mail" is probably a quite bad example, as it relies heavily on extended attributes. There are probably many candidates all over the difficulty spectrum (from easy to hard) that would make more sense to port. Unless someone came up with a hack to wrap xattr's into something else, ouch.
Cedric
On 3/31/19 4:08 PM, ttcoder@netcourrier.com wrote:
Correction: "Mail" is probably a quite bad example, as it relies heavily on extended attributes. There are probably many candidates all over the difficulty spectrum (from easy to hard) that would make more sense to port. Unless someone came up with a hack to wrap xattr's into something else, ouch.
File systems code is not among my areas of expertise, but I wonder how hard it would be to port the BFS code to Genode.
Does the Genode VFS system currently support extended attributes?
Do you know what kind of dependencies the BFS code has?
-- John J. Karcher devuser@alternateapproach.com
On 31.03.2019 23:08, ttcoder@netcourrier.com wrote:
Correction: "Mail" is probably a quite bad example, as it relies heavily on extended attributes. There are probably many candidates all over the difficulty spectrum (from easy to hard) that would make more sense to port. Unless someone came up with a hack to wrap xattr's into something else, ouch.
Cedric
xattrs? So, Haiku uses Linux terminology? OS/2 calls them "EA's". What are extended attributes needed for in Mail applications? Indexing? Storing keywords? OS/2 mostly uses EA's to store object properties for desktop objects, and also to emulate POSIX file attributes. And also icons, keywords for search, tokenized images (i.e., bytecode) for scripts written in REXX language etc. In OS/2, EA's are limited in size to at least, 64 KB. With JFS, they theoretically could be larger, but for compatibility with older HPFS file system, the limit is set to 64 KB. IIRC, in ext2fs, max. extended attribute size is only 4 KB, which could be too little for some purposes. In Sculpt, ext2 is used as current file system, so, its limits apply. (this is for Linux ext2 driver, not sure about a NetBSD driver in rump kernel). On other file sysytems, EA support may be missing, but it can be emulated. For example, on FAT, OS/2 uses a file called "ea data. sf" in the root directory, which contains EA's of all files on the partition in special format. All file metainfo is accessed from a directory entry (on FAT), or its inode on most other file systems. So, on FAT, a directory entry contains a 16-bit handle to an EA stored in "ea data. sf" file. Though, in FAT32 direntry, the two bytes used to reference a EA, are reused for high word of first cluster number of the file. So, for implementation of EA's in FAT32, two bits of another reserved byte of a direntry is reused. (one bit means "this file has EA's", another means "the EA's are critical", i.e., they are mandatory to be existed when opening the file). So, EA's on FAT32 are laying around near the file itself, in the same directory, in a hidden file. The disadvantage is that EA files are laying around everywhere, like a trash. So, if a file system doesn't support EA's, they can be emulated like this.
If I correctly understood, there is no EA/xattr support in Genode VFS, so far. But for my project (which is "OS/2 personality" on top of Genode), I plan to make a server (like Genode's VFS server) supporting OS/2-like IFS (Installable File Systems), like plugins. They, of course, support EA's. But then only OS/2 applications will be able to take advantage of using EA's. Serving OS/2 file systems to Genode applications is planned too. You can go similar way.
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users
Hello Valery,
thanks for the background info about extended attributes.
mandatory to be existed when opening the file). So, EA's on FAT32 are laying around near the file itself, in the same directory, in a hidden file. The disadvantage is that EA files are laying around everywhere, like a trash. So, if a file system doesn't support EA's, they can be emulated like this.
I admittedly have not much clue about file systems. To me as a user, features like this (this also goes for the strange "resource forks" of old Mac OS) look like glorified directories. They seem to be just more complicated, less transparent, and cause friction when moving data across file systems. Given my poor background, please take the following with a grain of salt.
I wonder, in situations where meta data has to contain a lot of domain knowledge, wouldn't sqlite be a good way to organize it?
In situations where meta data are simple annotations to files (like storing the icon for a file), why can't both the file and the meta data go to into a directory? This is the way Risc OS (and also today's Mac OS, AFAIK) deal with the situation.
Hence, there is currently no plan to extend Genode's file-system session with extended attributes.
Valery's remark about an emulation scheme looks good to bridge the gap. This way, such a feature can be implemented within the libc where the libc would rely on some conventions. E.g., when asked for the extended attributes for a certain 'file', the libc may - under the hood - read the meta data from a file called '.xa/file'. Yes, this would spill the '.xa' directories here and there but it leaves the complexity out of base mechanisms like the VFS or the file-system session.
Cheers Norman
Norman Feske wrote:
Hello Valery,
thanks for the background info about extended attributes.
mandatory to be existed when opening the file). So, EA's on FAT32 are laying around near the file itself, in the same directory, in a hidden file. The disadvantage is that EA files are laying around everywhere, like a trash. So, if a file system doesn't support EA's, they can be emulated like this.
I admittedly have not much clue about file systems. To me as a user, features like this (this also goes for the strange "resource forks" of old Mac OS) look like glorified directories. They seem to be just more complicated, less transparent, and cause friction when moving data across file systems. Given my poor background, please take the following with a grain of salt.
Yes, also WinNT goes even further: it supports files having multiple streams of data. Resource fork from MacOS or EA can be implemented as streams too. Only Resource fork stores multiple metainfo in one stream, and EA's can be implemented both ways: as a single stream, or multiple streams.
I wonder, in situations where meta data has to contain a lot of domain knowledge, wouldn't sqlite be a good way to organize it?
Probably yes, though, sqlite files are just tables with fixed number of fields. Storing EA in SQLite or any other relational database should require a data schema with multiple tables, which may be too complex, because a file can have any number of EA's, whereas a table contains a fixed number of fields. So, it may require a complicated data schema.
In situations where meta data are simple annotations to files (like storing the icon for a file), why can't both the file and the meta data go to into a directory? This is the way Risc OS (and also today's Mac OS, AFAIK) deal with the situation.
They could be not simple annotations/text data, but they also could be any small binary data attached to a file (icons being a good example).
Directory could be too small to fit all EA's. Usually, if EA's are small enough, file systems like HPFS or JFS can store them in inode/fnode inline. But if they are not fit into inode, they are put into separate streams of sectors. Directory usually only contains a reference to EA's (a first sector/block/cluster number of EA stream, or a handle to a particular EA, or just some bits which denote that EA is present.). Not sure about RISCOS, but AFAIK, MacOS uses a separate stream of data to store its resource forks. Directories ideally should only contain a mapping between inode number and a file name. All standard metadata goes into an inode. But if it's not fit into inode, it goes into separate stream. Inode size is usually limited.
Hence, there is currently no plan to extend Genode's file-system session with extended attributes.
Yes, I of course, understand the wish to keep the interfaces and architecture simpler.
Valery's remark about an emulation scheme looks good to bridge the gap. This way, such a feature can be implemented within the libc where the libc would rely on some conventions. E.g., when asked for the extended attributes for a certain 'file', the libc may - under the hood - read the meta data from a file called '.xa/file'. Yes, this would spill the '.xa' directories here and there but it leaves the complexity out of base mechanisms like the VFS or the file-system session.
Yes, the EA/xattr store can be moved to a separate subdirectories of each current subdirectory (like in svn working copies.). This seems to be a better idea than to have EA's laying around along with their files. So, they will not pollute the usual disk contents. Yes, it looks be possible to have EA support on a libc level. Usually, EA's are returned along with standard file metainfo when setting or retrieving FileInfo/PathInfo or searching files. So, e.g., a file search retrieves a set of records, per each file. These records may contain a standard metainfo (inode contents), as well as EA contents. Also, when opening files, "open" syscall could create EA's for that file. Pointer to EA data is specified as a separate syscall parameter. Though, the open/fopen calls don't contain such parameters, but a native syscall does. Creating a FS-independent wrapper on libc level looks possible, though I fear that it could be inefficient and slow. In a file search example, if a FS returned a set of records containing file metadata, then libc wrapper should process this set of records, and add EA data to each record. This looks to be working, but it could be slow. Usually, a FS does the same with a single step: usually both, metadata contained in inode, and EA's, a returned at once. For speeding things up, the FS doesn't check each file for EA presence, instead, a flag is used, which specifies, whether file has EA's. If not, the EA lookup is just omitted.
WBR, valery
Cheers Norman
I suppose we could use this mechanism, which we already use for ioctl, for several other file attributes as well, e.g. timestamps. We could put it all under a directory named .attrs-(filename).
As for performance, the filesystem drivers could implement attribute access as separate files while still using attrs/xattrs as the underlying storage mechanism. The main issue with this is when attributes are copied before the files. However, if we make the attributes transparent in libc, this shouldn't be much of an issue, especially if we guarantee that the attributes come after the files in the dirent listing. Overall, I think this could be a relatively clean way to implement both regular and extended attributes. Any other thoughts on this?
On Tue, Apr 2, 2019, 7:54 AM Valery V. Sedletski via users < users@lists.genode.org> wrote:
Norman Feske wrote:
Hello Valery,
thanks for the background info about extended attributes.
mandatory to be existed when opening the file). So, EA's on FAT32 are laying around near the file itself, in the same directory, in a hidden file. The disadvantage is that EA files are laying around everywhere, like a trash. So, if a file system doesn't support EA's, they can be emulated like this.
I admittedly have not much clue about file systems. To me as a user, features like this (this also goes for the strange "resource forks" of old Mac OS) look like glorified directories. They seem to be just more complicated, less transparent, and cause friction when moving data across file systems. Given my poor background, please take the following with a grain of salt.
Yes, also WinNT goes even further: it supports files having multiple streams of data. Resource fork from MacOS or EA can be implemented as streams too. Only Resource fork stores multiple metainfo in one stream, and EA's can be implemented both ways: as a single stream, or multiple streams.
I wonder, in situations where meta data has to contain a lot of domain knowledge, wouldn't sqlite be a good way to organize it?
Probably yes, though, sqlite files are just tables with fixed number of fields. Storing EA in SQLite or any other relational database should require a data schema with multiple tables, which may be too complex, because a file can have any number of EA's, whereas a table contains a fixed number of fields. So, it may require a complicated data schema.
In situations where meta data are simple annotations to files (like storing the icon for a file), why can't both the file and the meta data go to into a directory? This is the way Risc OS (and also today's Mac OS, AFAIK) deal with the situation.
They could be not simple annotations/text data, but they also could be any small binary data attached to a file (icons being a good example).
Directory could be too small to fit all EA's. Usually, if EA's are small enough, file systems like HPFS or JFS can store them in inode/fnode inline. But if they are not fit into inode, they are put into separate streams of sectors. Directory usually only contains a reference to EA's (a first sector/block/cluster number of EA stream, or a handle to a particular EA, or just some bits which denote that EA is present.). Not sure about RISCOS, but AFAIK, MacOS uses a separate stream of data to store its resource forks. Directories ideally should only contain a mapping between inode number and a file name. All standard metadata goes into an inode. But if it's not fit into inode, it goes into separate stream. Inode size is usually limited.
Hence, there is currently no plan to extend Genode's file-system session with extended attributes.
Yes, I of course, understand the wish to keep the interfaces and architecture simpler.
Valery's remark about an emulation scheme looks good to bridge the gap. This way, such a feature can be implemented within the libc where the libc would rely on some conventions. E.g., when asked for the extended attributes for a certain 'file', the libc may - under the hood - read the meta data from a file called '.xa/file'. Yes, this would spill the '.xa' directories here and there but it leaves the complexity out of base mechanisms like the VFS or the file-system session.
Yes, the EA/xattr store can be moved to a separate subdirectories of each current subdirectory (like in svn working copies.). This seems to be a better idea than to have EA's laying around along with their files. So, they will not pollute the usual disk contents. Yes, it looks be possible to have EA support on a libc level. Usually, EA's are returned along with standard file metainfo when setting or retrieving FileInfo/PathInfo or searching files. So, e.g., a file search retrieves a set of records, per each file. These records may contain a standard metainfo (inode contents), as well as EA contents. Also, when opening files, "open" syscall could create EA's for that file. Pointer to EA data is specified as a separate syscall parameter. Though, the open/fopen calls don't contain such parameters, but a native syscall does. Creating a FS-independent wrapper on libc level looks possible, though I fear that it could be inefficient and slow. In a file search example, if a FS returned a set of records containing file metadata, then libc wrapper should process this set of records, and add EA data to each record. This looks to be working, but it could be slow. Usually, a FS does the same with a single step: usually both, metadata contained in inode, and EA's, a returned at once. For speeding things up, the FS doesn't check each file for EA presence, instead, a flag is used, which specifies, whether file has EA's. If not, the EA lookup is just omitted.
WBR, valery
Cheers Norman
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users
Nobody III wrote:
I suppose we could use this mechanism, which we already use for ioctl, for several other file attributes as well, e.g. timestamps.
Implement getting or setting the extended attributes via an ioctl? Seems to be a logical approach. But then this should be done in libc implementation of the "ioctl" function. So, some part of "ioctl" code is implemented in each FS driver, and some part of implementation resides in libc itself. So, this is done without calling the part that resides in the FS driver, if FS doesn't support EA's, so they are then emulated in the libc itself (maybe, with a special libc plugin). But apart from setting/getting EA values, EA's are also returned by file searching syscalls. On libc level it is done by readdir/glob functions. So the libc plugin for EA support should also hook on readdir() function. But standard readdir() doesn't seems to support EA's. Unfortunately, I'm not aware how EA access is usually done via libc in Linux or Haiku. In OS/2 the common practice seems to be using required API's/syscalls directly, without libc. There should be two cases 1) FS doesn't support EA's, so they are emulated with hooking into functions like ioctl or readdir (or extended readdir version) 2) FS supports EA's. Then the libc plugin should call the code in the FS driver immediately.
We could put it all under a directory named .attrs-(filename).
Yes, but it's better to do like Norman suggested, i.e., one subdir with files in it. Each file stores EA's of a single file in parent directory. EA's are usually stored as a single stream of data. Storing EA's of each file in separate subdir should require many dirs, which will pollute the current directory the same way as EA files (as I described for FAT32 case).
As for performance, the filesystem drivers could implement attribute access as separate files while still using attrs/xattrs as the underlying storage mechanism.
Usually EA's are returned along with other file metainfo as one structure of data, containing all the metainfo. There could be just one EA returned in this structure, or a list of EA's at once. So if use "ioctl" for returning such info, it, probably should return all metadata as one structure with multiple fields, not just a single attribute or extended attribute.
The main issue with this is when attributes are copied before the files. However, if we make the attributes transparent in libc, this shouldn't be much of an issue, especially if we guarantee that the attributes come after the files in the dirent listing. Overall, I think this could be a relatively clean way to implement both regular and extended attributes. Any other thoughts on this?
I don't see a big issue in that is EA file stored in a direntry before file itself, or after it. Of course, it should be easier to find EA's right after the file itself, but this relies on the FS implementation. I.e., we'll need to rewrite each FS so that it will store the EA files that way. But I think, it's a bad idea to rewrite every single FS. If we want to create a EA emulation layer on top of each FS, it should not rely on special way of implementing each FS. And there should be emulation only in case the FS does not support EA's. If it does support them, then emulation should be switched off.
On Tue, Apr 2, 2019, 7:54 AM Valery V. Sedletski via users <users@lists.genode.org mailto:users@lists.genode.org> wrote:
Norman Feske wrote: > Hello Valery, > > thanks for the background info about extended attributes. > >> mandatory to be existed when opening the file). So, EA's on FAT32 are >> laying around near the file itself, in the same directory, in a hidden >> file. The disadvantage is that EA files are laying around everywhere, >> like a trash. So, if a file system doesn't support EA's, they can be >> emulated like this. > I admittedly have not much clue about file systems. To me as a user, > features like this (this also goes for the strange "resource forks" of > old Mac OS) look like glorified directories. They seem to be just more > complicated, less transparent, and cause friction when moving data > across file systems. Given my poor background, please take the following > with a grain of salt. Yes, also WinNT goes even further: it supports files having multiple streams of data. Resource fork from MacOS or EA can be implemented as streams too. Only Resource fork stores multiple metainfo in one stream, and EA's can be implemented both ways: as a single stream, or multiple streams. > I wonder, in situations where meta data has to contain a lot of domain > knowledge, wouldn't sqlite be a good way to organize it? Probably yes, though, sqlite files are just tables with fixed number of fields. Storing EA in SQLite or any other relational database should require a data schema with multiple tables, which may be too complex, because a file can have any number of EA's, whereas a table contains a fixed number of fields. So, it may require a complicated data schema. > In situations where meta data are simple annotations to files (like > storing the icon for a file), why can't both the file and the meta data > go to into a directory? This is the way Risc OS (and also today's Mac > OS, AFAIK) deal with the situation. They could be not simple annotations/text data, but they also could be any small binary data attached to a file (icons being a good example). Directory could be too small to fit all EA's. Usually, if EA's are small enough, file systems like HPFS or JFS can store them in inode/fnode inline. But if they are not fit into inode, they are put into separate streams of sectors. Directory usually only contains a reference to EA's (a first sector/block/cluster number of EA stream, or a handle to a particular EA, or just some bits which denote that EA is present.). Not sure about RISCOS, but AFAIK, MacOS uses a separate stream of data to store its resource forks. Directories ideally should only contain a mapping between inode number and a file name. All standard metadata goes into an inode. But if it's not fit into inode, it goes into separate stream. Inode size is usually limited. > Hence, there is currently no plan to extend Genode's file-system session > with extended attributes. Yes, I of course, understand the wish to keep the interfaces and architecture simpler. > Valery's remark about an emulation scheme looks good to bridge the gap. > This way, such a feature can be implemented within the libc where the > libc would rely on some conventions. E.g., when asked for the extended > attributes for a certain 'file', the libc may - under the hood - read > the meta data from a file called '.xa/file'. Yes, this would spill the > '.xa' directories here and there but it leaves the complexity out of > base mechanisms like the VFS or the file-system session. Yes, the EA/xattr store can be moved to a separate subdirectories of each current subdirectory (like in svn working copies.). This seems to be a better idea than to have EA's laying around along with their files. So, they will not pollute the usual disk contents. Yes, it looks be possible to have EA support on a libc level. Usually, EA's are returned along with standard file metainfo when setting or retrieving FileInfo/PathInfo or searching files. So, e.g., a file search retrieves a set of records, per each file. These records may contain a standard metainfo (inode contents), as well as EA contents. Also, when opening files, "open" syscall could create EA's for that file. Pointer to EA data is specified as a separate syscall parameter. Though, the open/fopen calls don't contain such parameters, but a native syscall does. Creating a FS-independent wrapper on libc level looks possible, though I fear that it could be inefficient and slow. In a file search example, if a FS returned a set of records containing file metadata, then libc wrapper should process this set of records, and add EA data to each record. This looks to be working, but it could be slow. Usually, a FS does the same with a single step: usually both, metadata contained in inode, and EA's, a returned at once. For speeding things up, the FS doesn't check each file for EA presence, instead, a flag is used, which specifies, whether file has EA's. If not, the EA lookup is just omitted. WBR, valery > Cheers > Norman _______________________________________________ Genode users mailing list users@lists.genode.org <mailto:users@lists.genode.org> https://lists.genode.org/listinfo/users
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users