Subject: Re: Boot drive [was Re: Multiboot support for review]
To: None <tech-kern@netbsd.org>
From: George Georgalis <george@galis.org>
List: tech-kern
Date: 02/04/2006 15:30:59
On Wed, Feb 01, 2006 at 09:41:06AM +0100, Julio M. Merino Vidal wrote:
>Changed the subject because this has nothing to do with Multiboot.
>
>El 01/02/2006, a las 6:00, George Georgalis escribi?:
>
>>
>>Problem:
>>init numbers drives in this order: pci SATA, onboard SATA, onboard  
>>PATA
>>(I'm not blaming init, it may be a wacko bios providing the devices
>>in the wrong order, but I've not been able to try in other hardware)
>[...]
>
>I don't know what PATA is, but anyway...

regular old IDE drives, parallel ATA

>init(8) does not number drives.  It is the kernel who initializes the
>drivers and, depending on the order in which that happens and the
>number of drives, they will get some identifiers or others.

I take your word on that.

>I *think* wedges are a solution to this problem but I do not know
>anything about them.

Here is something on them
http://mail-index.netbsd.org/tech-kern/2004/09/22/0009.html
but I'm looking for a stable solution


>Another solution is to rebuild a custom kernel and change its
>configuration to force the detection of drives in a specific order.
>E.g., instead of saying:
>
>wd* at atabus?
>wd* at umass?
>
>You'd say:
>
>wd0 at atabus?
>wd1 at atabus?
>wd2 at umass?
>wd3 at umass?
>
>so that wd0 and wd1 were always the drives attached to atabus and
>wd2 and wd3 those attached to usb.  Similarly to what you are doing
>in openbsd with config -e.

>Then you can also change the 'config netbsd root on ? type ?' to
>hardcode where the root partition is: 'config netbsd root on wd0a type
>ffs'.

Okay, but all the drives are on "atabus?" so I guess I need:

atabus0 at viaide0 channel 0
atabus1 at viaide0 channel 1
atabus2 at viaide1 channel 0 
atabus3 at viaide1 channel 1 
atabus4 at satalink0 channel 0
atabus5 at satalink0 channel 1
atabus6 at satalink1 channel 0
atabus7 at satalink1 channel 1

Why this is not the default ordering escapes me.
the actual order is

wd0 -> satalink0 channel 0  (bios hd1)
wd1 -> satalink0 channel 1  (bios hd2)
wd2 -> satalink1 channel 0  (bios hd3)
wd3 -> viaide0 channel 0    (bios hd0)
cd0 -> viaide1 channel 0

On the way here, I found if I use "boot hd1a:netbsd" I could boot
into the "satalink0 channel 0" install and change the "viaide0
channel 0" fstab (to a wd3a root) - then boot hd0a:netbsd into
wd3 on ide interface - easiest.

BUT, one big fault here is no /dev/wd4 or higher. I didn't try to
mknod because I figure that's only the first reason not to have hd4
or higher.

So I don't really see a straight forward solution, will think
about 1/2 of a raid 1 for each drive...

// George


NetBSD 3.0 (GENERIC) #0: Mon Dec 19 01:04:02 UTC 2005
	builds@works.netbsd.org:/home/builds/ab/netbsd-3-0-RELEASE/i386/200512182024Z-obj/home/builds/ab/netbsd-3-0-RELEASE/src/sys/arch/i386/compile/GENERIC
total memory = 1007 MB
avail memory = 978 MB
BIOS32 rev. 0 found at 0xfbaa0
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: AMD Athlon XP 3000+ (686-class), 2166.66 MHz, id 0x6a0
cpu0: features c3c3fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR>
cpu0: features c3c3fbff<PGE,MCA,CMOV,PAT,PSE36,MMXX,MMX>
cpu0: features c3c3fbff<FXSR,SSE,3DNOW2,3DNOW>
cpu0: "AMD Athlon(tm) XP 3000+"
cpu0: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu0: L2 cache 512 KB 64B/line 16-way
cpu0: ITLB 16 4 KB entries fully associative, 8 4 MB entries fully associative
cpu0: DTLB 32 4 KB entries fully associative, 8 4 MB entries 4-way
cpu0: 8 page colors
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies VT8378 Apollo KM400 CPU to PCI Bridge (rev. 0x00)
agp0 at pchb0: aperture at 0xe0000000, size 0xf900000
ppb0 at pci0 dev 1 function 0: VIA Technologies VT8377CE CPU-AGP Bridge (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: VIA Technologies VT8378 KM400 UniChrome Integrated Graphics (rev. 0x01)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
satalink0 at pci0 dev 6 function 0
satalink0: Silicon Image SATALink 3112 (rev. 0x02)
satalink0: SATALink BA5 register space disabled
satalink0: bus-master DMA support present
satalink0: primary channel wired to native-PCI mode
satalink0: using irq 11 for native-PCI interrupt
atabus0 at satalink0 channel 0
satalink0: secondary channel wired to native-PCI mode
atabus1 at satalink0 channel 1
wm0 at pci0 dev 7 function 0: Intel i82540EM 1000BASE-T Ethernet, rev. 2
wm0: interrupting at irq 12
wm0: 32-bit 33MHz PCI bus
wm0: 64 word (6 address bits) MicroWire EEPROM
wm0: Ethernet address 00:07:e9:09:22:d0
makphy0 at wm0 phy 1: Marvell 88E1011 Gigabit PHY, rev. 3
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
viaide0 at pci0 dev 15 function 0
viaide0: VIA Technologies VT8237 SATA Controller (rev. 0x80)
viaide0: bus-master DMA support present
viaide0: primary channel wired to native-PCI mode
viaide0: using irq 11 for native-PCI interrupt
atabus2 at viaide0 channel 0
viaide0: secondary channel wired to native-PCI mode
atabus3 at viaide0 channel 1
viaide1 at pci0 dev 15 function 1
viaide1: VIA Technologies VT8237 ATA133 controller
viaide1: bus-master DMA support present
viaide1: primary channel configured to compatibility mode
viaide1: primary channel interrupting at irq 14
atabus4 at viaide1 channel 0
viaide1: secondary channel configured to compatibility mode
viaide1: secondary channel interrupting at irq 15
atabus5 at viaide1 channel 1
uhci0 at pci0 dev 16 function 0: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci0: interrupting at irq 10
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 16 function 1: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci1: interrupting at irq 10
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 16 function 2: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci2: interrupting at irq 11
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 16 function 3: VIA Technologies VT83C572 USB Controller (rev. 0x81)
uhci3: interrupting at irq 11
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: VIA Technologies UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 16 function 4: VIA Technologies VT8237 EHCI USB Controller (rev. 0x86)
ehci0: interrupting at irq 12
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2 uhci3
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: VIA Technologie EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub4: single transaction translator
uhub4: 8 ports with 8 removable, self powered
pcib0 at pci0 dev 17 function 0
pcib0: VIA Technologies VT8237 (Apollo KT600) PCI-ISA Bridge (rev. 0x00)
auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
auvia0: interrupting at irq 12
auvia0: ac97: VIA Technologies unknown (0x56494170) codec; headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
auvia0: ac97: ext id 9c3<AC97_23,LDAC,SDAC,CDAC,DRA,VRA>
audio0 at auvia0: full duplex, mmap, independent
vr0 at pci0 dev 18 function 0: VIA VT6102 (Rhine II) 10/100 Ethernet
vr0: interrupting at irq 10
vr0: Ethernet address: 00:11:09:c8:5c:73
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface
ukphy0: OUI 0x0002c6, model 0x0032, rev. 10
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at pcib0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
isapnp0: no ISA Plug 'n Play devices found
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
Kernelized RAIDframe activated
satalink0: port 0: device present, speed: 1.5Gb/s
wd0 at atabus0 drive 0satalink0: port 1: device present, speed: 1.5Gb/s
: <ST3200822AS>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 186 GB, 387621 cyl, 16 head, 63 sec, 512 bytes/sect x 390721968 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(satalink0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
wd1 at atabus1 drive 0: <ST3200822AS>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 186 GB, 387621 cyl, 16 head, 63 sec, 512 bytes/sect x 390721968 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd1(satalink0:1:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
wd2 at atabus2 drive 0: <ST3400832AS>
wd2: drive supports 16-sector PIO transfers, LBA48 addressing
wd2: 372 GB, 775221 cyl, 16 head, 63 sec, 512 bytes/sect x 781422768 sectors
wd2: 32-bit data port
wd2: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd2(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using DMA)
wd3 at atabus4 drive 0: <ST38421A>
wd3: drive supports 16-sector PIO transfers, LBA addressing
wd3: 8056 MB, 16368 cyl, 16 head, 63 sec, 512 bytes/sect x 16498944 sectors
wd3: 32-bit data port
wd3: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
wd3(viaide1:0:0): using PIO mode 4, Ultra-DMA mode 4 (Ultra/66) (using DMA)
atapibus0 at atabus5: 2 targets
cd0 at atapibus0 drive 0: <HL-DT-STDVD-ROM GDR8163B, , 0L23> cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
cd0(viaide1:1:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
boot device: wd3
root on wd3a dumps on wd3b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
uid 777, pid 24062, command cvs, on /tmp: out of inodes
uid 777, pid 17569, command cvs, on /tmp: out of inodes
uid 777, pid 20670, command cvs, on /tmp: out of inodes


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:george@galis.org