Older blog entries for cmc (starting at number 9)

So it's been about a year since I've made a diary entry. And nothing momentous has happened. I'm making a post to keep whoever might actually care updated, though: I'm working on the FAQ now. You know, that big messy thing that has a bunch of silly questions and silly answers. Well, my plan is more or less to separate it into a million tiny little files just like they did with the FreeBSD Handbook, but first I want to make it all look professional. So I've got my work cut out for me. Expect to see a roadmap document (written, of course, in the DocBook SGML DTD) in a few days.

Nothing particularly interesting other than the fact that I haven't made a journal entry here in about 3 weeks or so. Fixed a small bug in fdesc. Still don't like the sentence-break rules for mdoc manual pages. That's about it. Carry on.

At long last, I've committed my changes to the fdesc file system. Not much else to say about it.

Yesterday I finished my implementation of basename(3) and dirname(3) for FreeBSD, compatible with XPG 4.2. They match 1:1 with test results all the specified behavior with HP-UX 10.20's implementation. The code is being reviewed now and hopefully it can go in at some point this week.

I've committed the first step to adapting the new fdesc code and eventually making it the replacement for our existing static /dev/fd nodes. This commit involved modifying our MAKEDEV script to create /dev/stdin, /dev/stdout, and /dev/stderr as symbolic links to fd/[0-2] (they used to be simply duplicate nodes).

Haven't posted much of a diary for a couple weeks now.

My old 15" ProView monitor finally died on me after a couple hours of odd spasms it had, so until I can get a new one, I'm using my older 14" MTR monitor that has a bad VGA connector (just touch it and the whole screen tints your choice of cyan, yellow or magenta).

I've made a couple small updates to my fdesc patch, which is finally getting reviewed so I hope to actually commit it soon.

I've finally updated my fdesc patches to include proper renumbering and `.' and `..' directory entries. I've also put up documentation on what I've done so far with it, which is available from http://www.FreeBSD.org/~chris/fdesc/--the patch is, of course, still available from http://www.FreeBSD.org/~chris/fdesc.patch.

I've just completed a small modification to the patch for fdesc that inlined the fdesc_attr() function into the fdesc_getattr() function since that's now the only use. The main benefit of this is that originally the code that grabbed attributes for stat(2) was in there, and it was not passed the vnode passed originally to fdesc_getattr().

Now open sockets and pipes are properly given inode numbers based on the number assigned to them by fdesc_lookup, which is unique for each file descriptor (it is FD_DESC+fileno). The patch is looking pretty good and I believe I've addressed all of the issues I can remember right now.

The patch is available here and will be until it is committed.

I've changed the design of fdesc to be mounted on /dev/fd instead of being a union mount on /dev. Since we already have the nodes that fdesc duplicates (std{in,out,err} and tty), there's no reason to bloat and complicate the code by reproducing them. The code itself looks clean, but there's still the issue of making a unique inode number for each file. This puts the code in a generally much more readable state as well.

Since I have not really made any journal entries, I believe I should go ahead and describe what my current project is. At this point, I am working on repairing FreeBSD's fdesc file system.

What is fdesc? Fdesc is a file system which basically gives you information in file system form about what files (i.e. sockets, pipes, etc.) you have open. Since devfs likely won't be available for a while, I decided I'd make this something to work on. Currently the FS data such as the date, owner and permissions in fdesc ``as-is'' is set inaccurately (or to zero).

Currently, FreeBSD uses a directory, /dev/fd, which is basically full of a bunch of device nodes that really tell you absolutely nothing about your open files. However, with what magic I'm working with at this point:

$ ls -l /dev/fd 3>/dev/tcp/ | tee /dev/null
total 0
crw-------  1 chris  tty      5,   3 Mar 29 06:14 0
prw-rw-rw-  1 chris  chris         0 Mar 29 06:14 1
crw-------  1 chris  tty      5,   3 Mar 29 06:14 2
srw-rw-rw-  1 chris  chris         0 Mar 29 06:14 3
dr--r--r--  2 root   wheel       512 Mar 27 06:03 4
dr--r--r--  2 root   wheel       512 Mar 27 06:03 5

Note: The /dev/tcp/addr/port-no is a feature of the Korn shell and is in no way related to my fdesc work (other than being an awfully convenient way to make a socket in the shell).

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!