Tuesday June 28, 2005
Casper Dik's WeblogCasper Dik's Weblog First Installment (of frkit) I've teased people before about the nifty hacks I've been doing for my Ferrari 3400 laptop. The hacks I did and the tool I wrote to make the distribution easier were so well liked that there was this "meme" propagating that whenever we got even cooler laptops, I should get the first one. And so it happened, I literally got the first Ferrari 4000 shipped to Sun. Now, this is a whole different beast than the Ferrari 3400 and I haven't yet gotten quite to the same comfort level yet. I've long promised to make all of the neat stuff available, but legalities are the difficult part of such a venture. But now with OpenSolaris and a supported license scheme (plus management buy-in), I now feel comfortable to release the stuff which I wrote or was derived from source now available under the CDDL) The first installment includes my single CPU "PowerNow!(tm)" driver and my battery driver and utility. What the heck, let's throw in the mdb scripts which enable the additional keys on the Acer keyboards (mail, www, P1, P2, audio control). Some of these appear standard controls and may work for internet keyboards as well. The tar.gz files all come with an install script which will take care of all the details of the installation; the battery driver requires ACPICA; that is only included in Solaris Nevada (11) build 14 and later. I'll see what I can do about the GNOME battery utility we've done as well; oh, sorry for the somewhat lacking documentation. Update: I've added acpipowertool, a small graphic battery meter by Matt Simmons, and fixed some installation issues for root user's without "nm" in $PATH. Update2: (2005/7/31) Ive upgraded powernow so it works for more systems and to better integrate powernowadm with SMF; apcidrv is also updated to do a little bit more of thermal zone handling. acpidrv only works for Solaris express build 14 and later; powernow should work with Solaris 10 GA also.
Update3: frkit is for some time now available as runnable script at www.opensolaris.org in the (2005-06-28 08:26:54.0) Permalink Comments [26] Peter Harvey's story reminds me of the unforeseen consequences of creating the ucred in Solaris 10. The ucred was motivated by two factors: the introduction of privileges and a way to propagate information about process credentials through the system in userland. Before Solaris 10, we had several mechanisms, some internal, some public, all propagating a subset of that information. in sys/door.h:
in sys/tl.h:
in rpc/svc.h:
and in the project I missed this one in sys/stropts.h:
There was also the need to be able to enquire about other processes and perhaps network connections and packets; a getpeereid interface was requested. Now, what information should such an interface return? Network interfaces often only allow you to shape requests as a blob of bytes. And that blob needs to have a predictable maximum size too. As you can see from the above examples, even declaring a number of filler elements is not sufficient; none of the above structures which include a filler have space for the full complement of 16 groups, let alone Pete's proposed 65536 maximum number of groups. The most natural way of implementing a blob which such restrictions is using an opaque data structure with accessor functions (in <ucred.h>):
The ucred_t itself is defined in sys/ucred.h,
a header which isn't installed on the system because programs are not supposed to use it; it is a private interface between
the kernel and the library. By now you may be asking yourself where you get creds; well, here are some examples in the OpenSolaris source code: nscd getting a door cred, rpcbind getting an rpc caller credential and the use of the TL option by RPC. And your typical use of the function in an inetd started daemon:
And a slightly bigger example where we use XPG4 recvmsg to receive a UCRED control messages:
But thinking back of Pete's problem, we see a problem when increasing max groups, even worse, this libnsl private datastructure is abused and multiple copies exist which need to be kept in sync (so parts of the system broke when I changed it in this one place). The bug is an illustration why cut & paste programming doesn't work and why even when you share a private defintion, you must use a proper header file. I filed the bug as soon as I did the quick fix for the Solaris Express respin, the bug is 4994017. Technorati Tag: OpenSolaris Technorati Tag: Solaris (2005-06-14 08:11:18.0) Permalink Comments [0] |
Calendar
RSS Feeds
All /General /OpenSolaris /Solaris SearchLinks
NavigationReferersToday's Page Hits: 25 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||