[RFC] Kernel and initramfs plans

Alexander E. Patrakov patrakov at ums.usu.ru
Sat Mar 3 22:54:09 PST 2007


Hello,

a bug in the LiveCD has been reported by Mark J. Butsch. The bug is that the 
kernel doesn't boot on his laptop. It has been traced to several drivers for 
ISA-based SCSI cards (such as ultrastor). The bad code (after some 
unifdefing) is:

/* ??? A probe of address 0x310 screws up NE2000 cards */
static const unsigned short ultrastor_ports_14f[] = {
   0x330, 0x340, /*0x310,*/ 0x230, 0x240, 0x210, 0x130, 0x140,
};

...

     for (i = 0; i < ARRAY_SIZE(ultrastor_ports_14f); i++) {
       if(!request_region(ultrastor_ports_14f[i], 0x0c, "ultrastor"))
             continue;
         config.port_address = ultrastor_ports_14f[i];
         in_byte = inb(U14F_PRODUCT_ID(config.port_address));
         if (in_byte != US14F_PRODUCT_ID_0) {
             release_region(config.port_address, 0x0c);
             continue;
         in_byte = inb(U14F_PRODUCT_ID(config.port_address) + 1);
         /* Only upper nibble is significant for Product ID 1 */
         if ((in_byte & 0xF0) != US14F_PRODUCT_ID_1) {
             release_region(config.port_address, 0x0c);
             continue;
         }
         version_byte = in_byte;
         break;
     }

     if (i == ARRAY_SIZE(ultrastor_ports_14f)) {
     /* all ports probed already released - we can just go straight out */
         return FALSE;
     }

i.e. the driver detects its device by reading from ports where it may be. 
This upsets other hardware. That's why other distributions use fully modular 
kernels and load only the needed drivers, as opposed to our semi-non-modular 
LiveCD kernel.

We have two options:

1) Disable all ISA drivers, because other busses provide safe means for 
device probing. This is simple, but will upset people who need these drivers.

2) Follow the other distributions and load the needed drivers (and only 
them) from initramfs with the help of udev. This requires a full redesign of 
the initramfs and dropping the C-based /init binary.

What should be done?

-- 
Alexander E. Patrakov



More information about the livecd mailing list