More on hotplug issue w/HAL

David Zeuthen david at fubar.dk
Fri Jan 9 03:28:55 EET 2004


On Fri, 2004-01-09 at 02:08, Matthew Mastracci wrote:
> On Thu, 2004-01-08 at 16:31, David Zeuthen wrote:
> > On Thu, 2004-01-08 at 02:37, Matthew Mastracci wrote:
> > > > Disregarding media detection for a while, does all your devices show up
> > > > with the latest CVS version?
> > > 
> > > Works perfectly.  Tested startup and hotplug.  My card reader appears as
> > > a multi-LUN SCSI device w/multiple SCSI interfaces, as expected.  See
> > > attached screenshot for gorgeous details.  ;)
> > > 
> > 
> > Rock. I suppose media detection doesn't work yet, no?
> 
> Not yet - where might I find the code to do this?  To be more specific,
> it *does* work on hotplug or initial scan - it's just when the media
> itself is removed or inserted (versus removing or inserting the CF
> reader itself on the USB bus), nothing changes in HAL.
> 
> I've been playing around with SCSI device detection.  The easiest way to
> do it seems to be just open()ing the root block device (note that
> open()ing the partitions may still succeed if the media was removed
> without umount-ing).  If you've got floppy code working, you're probably
> already doing this.
> 

This is currently discussed on linux-hotplug and lkml. One possible is
solution is to get Linux 2.6 to generate hotplug add/remove on media
change which would make it work easily with HAL. 

If this doesn't happen we will have to poll on *all* the devices (udev
would also have to create *all* the possible nodes for partitions e.g.
/udev/sda1 through /udev/sda15). To poll we would use open("/udev/sda?",
O_RDONLY|O_NONBLOCK). This would work today.

> BTW - I've noticed that the floppy drive doesn't appear anywhere within
> sysfs.  I'm guessing that this is a kernel issue - there doesn't seem to
> be a device class for it at all!  
> 
> This brings me to a different point - should there be a few virtual
> device nodes *above* the current devices in HAL today?  The current HAL
> architecture is very PCI-centric.  I would imagine tree below to be the
> ideal:
> 
> + Non-System Items
>    + ???  Are there any ???
> + System Devices
>    + Legacy Serial Ports
>       + Serial Port
>       + Serial Port
>    + Legacy Parallel Ports
>       + Parallel Port
>       + Parallel Port
>    + Floppy Drive Controller
>       + Floppy Drive
>    + I2C Bus
>       + Some monitoring device
>    + PCI Bus
>       + On-board PCI Device 1
>       + On-board PCI Device 2
>       + On-board PCI Device 3
>       + AGP Bridge
>           + Superfast Video Card
>       + External PCI Bridge
>           + PCI Card 1
>           + PCI Card 2
>           + PCI Card 3
> 
> Unfortunately, it looks like there are a few device classes that are
> missing bus entries in sysfs (ie: missing kernel support).  For example,
> none of the legacy floppy/serial/parallel ports appear in there.  I
> suppose that someone just needs to do the grunt work of writing the
> sysfs classes.  :)

You're right. A lot of different devices are missing, basically HAL only
support a subset of what's in sysfs today - as time progress more and
more classes and busses will be added to sysfs, and then we can easily
add support in HAL - for instance I know Joe Shaw is working on adding
Firewire support to HAL. 

Cheers,
David







More information about the xdg mailing list