Category Archives: Linux

Fuji DPC-R1 is an Alauda!

I have been making some fast progress with the Alauda driver project.

I discovered that the Fuji DPC-R1 is also an Alauda device, so my driver should result in this device being supported by Linux, as well as the Olympus MAUSB-10 which I have in my posession.

I’ve gone over several logs of sniffed data and documented what I think it’s doing on the new sourceforge project page: control commands and bulk commands.

The first thing I want to achieve is the reading of my XD media cards. The Alauda only provides raw access to the media, so I basically have to interpret XD in software. This is made difficult because XD is closed-spec and it doesn’t look like anybody has done it in software before (well, not open-source!), but fortunately it is similar to SmartMedia (the SDDR09 Linux driver handles “raw SM” in software, and this is proving useful to look at). I’ve published what I think might be something vaguely like the XD Media specification.

Once I’ve figured out a few more details about XD media, I should be able to get reading working relatively easily. I’ve got the driver foundations in place already.

I’m hoping that I’ll hear from some other MAUSB-10/DPC-R1 users soon to get additional testing when I actually have some code which does something useful.

Alauda MAUSB-10

Got my hands on an Olympus MAUSB-10:

It’s a USB media card reader (2 slots, SmartMedia and XD-Media). It uses a vendor-specific interface and protocol, and is currently unsupported by Linux.

I’m going to be slowly developing a driver for this device. The Windows driver shows that the driver is actually for an “Alauda Enumerator” chip, maybe manufactured by RATOC? I’m going to be a copycat and call my driver Alauda.

I’ve fired off an email to Olympus requesting technical documentation for the device, but I’m doubtful that I’ll get anything – I’ll probably have to reverse engineer it from scratch.

Some techy info, the device seems to use a combined Control/Bulk transport, where bulk is used for data transfer and control is used for everything else (get media status, etc). Commands seem to be transmitted via bulk (after control setup) and hopefully they are something standardised e.g. SCSI/ATA, but I haven’t had time to investigate this just yet.

If anyone else owns one of these and would be interested in development/testing, please email me.

I will upload sniffed logs from the Windows driver and an initial protocol analysis sometime soon.

GWN Kernel Feedback

In this week’s Gentoo newsletter we included a request for feedback on possibly stopping development of gentoo-sources-2.4 and removing it from the tree.

John M has already written about the new plan of action in response to this feedback, but as we have recieved a fair quantity of interesting feedback, I thought it might be worth sharing some of it.

Most of the mails are from people who apparently misread the article, thinking that we are dropping Linux 2.4 completely. People were very keen to remind us of certain software and hardware which doesn’t work on 2.6.

One user thought he was doomed to 2.4 simply because his hardware is unsupported in any kernel, however Promise do provide 2.4-only drivers on their websites. Fortunately, all that is needed is a small patch to get this working on recent 2.6 kernels, so Linux should support Promise TX4200 SATA controllers very soon.

Some users reported that they are stuck to 2.4 because of their wireless cards – support is not available in 2.6, and the vendors insist on producing drivers for 2.4 only.

We suspect that the other alien hardware incompatibilities that were reported to us are already supported in 2.6, but we have yet to recieve the information to confirm this.

A few users reminded us that our OpenAFS ebuilds are so outdated that they don’t run on 2.6 at all. Fortunately, Seemant assures us that he’s been fuelling his production line and a new OpenAFS package maintainer should be ready for public consumption sometime soon.

We recieved a couple of more interesting mails, for example this guy, who ‘gets’ how Gentoo works:

I migrated our desktops and servers from 2.4 to 2.6 a number of months ago, so I encourage discontinuation of 2.4. The more people on 2.6 the easier it will be to maintain.

Notice in the above email he referred to “our desktops“. Many of the emails were written in this tone – from a corporate environment. People saying “we use”, “we migrated”, “…a big concern for us”, etc. Doesn’t anyone use Gentoo just because its fun anymore? :)

Another user pointed out that Gentoo rocks because it’s very easy to still be using a 2.4 kernel without also having to run packages that are a year out of date.

Thats about all so far. Thanks for all the feedback, we’ll probably get something in next weeks newsletter to conclude.

Linux 2.6.12

Since there’s the usual chorus of “whats new?” I thought it might be worth posting some things which I’ve observed since 2.6.11:

  • My driver is finally included!
  • Intel HD audio driver
  • ALSA now uses dmix (software mixing) by default even if you have not configured it
  • ALPS touchpad (included on many laptops) driver rework
  • Multipath device mapper
  • Improved SATA support
  • The firewire subsystem finally saw some action
  • Plenty of new hardware support, lots of things that I missed
  • Lots of bug fixes and internal improvements

The first gentoo-sources-2.6.12 release has been added to the tree and features the new inotify (0.23-13) as well as the new fbsplash (0.9.2-r3). Since we moved our patches into Gentoo’s shiny new Subversion server the website generation is broken but this will be updated soon. Also note that your custom udev rules might be broken until you upgrade to udev-058.

The definitive guide to CD writing on recent 2.6 kernels

Despite the fact it happened a few months ago, I still see people claiming that it is impossible to write CD’s with recent 2.6 kernels due to the internal changes. This is not true!

The first thing to check is that you aren’t using SCSI emulation. You don’t need this in Linux 2.6 – its ugly, and apparently doesn’t work. Disable SCSI emulation and use the new ATAPI features to burn “directly” (no extra configuration options needed other than general ATAPI cdrom support).

Next up, check you are running the latest version of cdrtools/cdrecord, even if this means going into the testing/unstable tree. The latest at the moment is cdrtools-2.01.01_alpha01-r1. The same applies for any other cd recording software you might be using.

It’s also important that you are running the latest stable kernel. This is currently 2.6.11. If you aren’t running this, then you are in no position to complain that things don’t work or file bugs.

A few months ago, the kernel code changed to restrict the commands which can be sent to CD writers. The restriction only allows commands that are related to CD reading and writing. The commands are listed in a table. At first, the table was too small, but thanks to user feedback I helped expand it to cover all commands needed for CD writing.

It seems that many users keep advocating a patch which completely bypasses the command table – and this patch is still included in some patchsets! This is no longer needed! If it does make a difference, then its a bug in either your CD writing software or the kernel command table is missing a valid command entry. If this is the case, send me an email, and I’ll fix things up with minimum effort involved. I’ve done this a few times before and I’m happy to do it again.

Another kernel change made at the same point in time resulted in the ability to write CD’s being restricted to users with write access to the CDROM device. That makes sense, right? (Previously you just needed read access.)

So the first thing to do is check that you have write access to your CDROM node. Assuming your CDROM drive is /dev/hdc, run the following:

# [ -w /dev/hdc ] && echo "OK" || echo "Fix up your permissions"

If you see a message telling you to fix up your permissions, the usual procedure is to use ls to see which group owns the node (usually cdrw or cdrom), add yourself to that group, and then try again. This requires that the group has access to write to the node too.

Moving on. Some software used to advise that you set the suid bit on your cdrecord binary. This means that cdrecord will always run with root priveleges, even if you execute it from a standard user account. Some kernel memory management changes broke cdrecord’s ability to run as root for a while. Even though it’s fixed now, it’s worth turning this off for the security implications alone:

# chmod -s /usr/bin/cdrecord

Note that xcdroast does weird things with suid bits too. For the purpose of testing, I suggest you keep away from xcdroast.

In terms of software usage, people seem to be historically used to running commands like cdrecord dev=ATAPI:0,0,0. An alternative method is cdrecord dev=/dev/hdc. There’s been an eternal debate as to which way should be encouraged – the cdrecord author doesn’t like the dev=/dev/hdc method, as you can probably gather from the warnings that appear. Right now, all you want to do is write CD’s, so no matter what you think, you need to use the dev=/dev/hdc method. Also, do avoid the dev=ATA:x,y,z notation too.

Another possible problem is that your CD writing software is opening up the CD node as read-only. The kernel will reject any write commands sent to it. The software needs to be modified to open the CD node as read-write. I fixed up some of the software such as dvd+rw-tools and cdrwtool a while back – but if there is any more problematic software, please let me know. (This is why its essential that you are running the latest versions of the software in question)

Finally, burn as your standard user account, not as root.

Hopefully this clears some things up. If you do experience problems after following the above precisely, please file a bug.

gentoo-dev-sources-2.6.11-r1 is ready to rock

With help from Kirk Reiser of the Speakup project, we’ve got speakup working with 2.6.11 which means that our 2005.0 LiveCD’s will now be based on the just-released 2.6.11 kernel. This means we’ll have bang-up-to-date support for the latest hardware. I also patched in the new SysKonnect gigabit ethernet driver (I was wrong in my last post, this was never sent to Linus) as I know a few people have asked for it.

No bug reports for 2.6.11 yet, this is shaping up very well :)

Linux 2.6.11

Linux 2.6.11 was released today. Seems like another high quality release incremental from the last one. Many people seem interested in “whats new in this release” and I rarely see any short summaries, so here’s mine:
(I’ve probably missed some important things, this is just what I have observed)

  • Support for SysKonnect Gigabit Ethernet
  • Lots more SATA device support
  • Support for more Promise ATA controllers
  • libata (the SATA driver set) now supports ATAPI (CD/DVD) devices out-of-the-box
  • Support for various components of Intel’s new ICH7 chipset
  • Big direct rendering rework (splitting core from personality)
  • Updated Usermode Linux support – hopefully no more external patches necessary
  • 4 level page tables – memory management improvements
  • Optimization for pipes
  • Kernel userspace events (kevent) – something I need to investigate more, but it allows the kernel to communicate with userspace better
  • Many other fixes, new features, and enhancements (full changelog). If you are having any trouble with your current kernel or have hardware which is unsupported, you should definately upgrade before filing bugs

gentoo-dev-sources-2.6.11 is in portage and any early testing would be appreciated. We are considering using this kernel to power our 2005.0 LiveCD’s, and assuming there are no major bugs early on, our only showstopper is Speakup – it seems that the large amount of changes since 2.6.10 have stopped this patch from applying, compiling, or functionally working. Fortunately one of the main developers, Kirk Reiser, is very responsive and is already on the case :)

Speaking of software releases, Beagle 0.0.7 came out yesterday. As you can see in the release announcement, I’ve been fairly successful at learning C#/Mono and contributing to the software. The core developers have been very helpful and have even granted me access to commit to the GNOME CVS repository, where the beagle sources are managed!
I have more Beagle contributions planned but uni and other work is eating all of my time right now :(

And a quick update on the Planet Gentoo situation. Ramereth says he is almost ready to set it up on the Gentoo infrastructure, hopefully we will get most of the way there tomorrow. Thanks Lance!

Linux support for USBAT02 storage devices

A couple of nights ago I (finally) submitted a driver that I’ve been developing on-and-off over the last 8 months.

I got interested when a Gentoo user on the forums created a thread, detailing the problem that he couldn’t use his compact flash reader. I gathered some info and did a bit of Googling: He owned a non-standard device unsupported by Linux.

I found a website on SourceForge, a project where previously, a Linux 2.4 driver had been developed. This was incomplete, but apparently worked for those users.

I did a quick port of their patch to 2.6 (maybe my first piece of “real” kernel hacking..), and after a bit more discussion on the forums, it was working!

A month or so later, I decided to return to this, with the aim of developing the driver into the quality such that it could be submitted for inclusion in the Linux kernel.

I introduced myself on their mailing list. The maintainer of the website fed me some information: he told me where I can get the manufacturers tech documents about the device, and he also persuaded some other people who had contacted him privately abou 2.6 support to join the mailing list and aid development of a 2.6 driver. It turns out that the original developer (Thomas Kreiling) who performed the amazing task of writing a partial driver without the specs, is not active.

Here begins the slow process of slowly developing the work I had already done, solving a few problems and cleaning up the code, using the knowledge I had gained out of interpreting the device specs. Without actually owning the device, development was quite slow.

After a few months of sporadic development, I eventually bought one of these devices from ebay, which allowed me to make a release which pretty much solved all problems, and added features such as the ability to hotswap media. After releasing this, and solving new problems experienced by my 10-or-so testers, I was able to finalize a release and send some final patches to the Linux USB developers.

The code is now pending review, but will hopefully be included in Linux 2.6.12. It adds support for eleven old, but fairly common, compactflash readers.

It’s been an amazing experience. Starting with almost zero kernel experience, I now have a fairly sound knowledge of USB, ATA, and SCSI, plus the relevant Linux-specifics. It’s also made me realise just how well the “open development” model works : the testers on the mailing list were always cooperative and enthusiastic about the development, and very fast to test new releases, even though they were not interested in coding themselves and at the end of the day just wanted to be able to use their hardware. This support was very encouraging and motivated me to see it through to the end.

For anyone interested, the project page can be found here: http://usbat2.sourceforge.net/

I have uploaded the final patches (against 2.6.10) here:
usbat_01_unification.patch
usbat_02_usbat02.patch
usbat_03_flash.patch