Date: Fri, 14 Nov 1997 15:45:32 -0800 (PST) From: Steven Kehlet <kehlet@dt.wdc.com> To: hackers@freebsd.org Subject: Re: diskless freebsd, can't mount local msdos disk (fwd) Message-ID: <Pine.NEB.3.96.971114073829.29672A-100000@daemon.dt.wdc.com>
next in thread | raw e-mail | index | archive | help
Hi, I have some more information about the problem I've been having mounting local disks while booting diskless. I've been trying to trace through the kernel code, and it looks to me like the code that checks all the slices on each local disk isn't called if mounting root over NFS (nfs_mountroot()). I was trying to tackle this problem by going through the code both starting both from "the top" (main() in kern/init_main.c) and from "the bottom" (check_port() in i386/isa/diskslice_machdep.c--where the slices are detected and displayed with "boot -v"), but it got a little complicated and I could never quite meet up ;-). Hats off to the folks who understand this code better... I hope to join you someday.. ;-) I'm thinking the folks who wrote the nfs_mountroot() stuff figured since you're booting diskless, you wouldn't want to access any local hard drives. Hopefully I could just pop in the code that initializes local drives into the nfs_mountroot() stuff... and it will all just work perfectly the first time... ;-) Thanks for taking the time to think about this and to give me any suggestions if you can. Steve Here's the tail of dmesg (boot -v) for a non-diskless machine (not mine). Note the disks and slices are detected and displayed: BIOS Geometries: 0:026a7f3f 0..618=619 cylinders, 0..127=128 heads, 1..63=63 sectors 0 accounted for Device configuration finished. Considering FFS root f/s. configure() finished. bpf: tun0 attached bpf: tun1 attached bpf: lo0 attached ccd0: Concatenated disk driver IP packet filtering initialized, divert disabled, unlimited logging > wd0s1: type 0x6, start 3967488, end = 4999679, size 1032192 > wd0s1: C/H/S end 618/127/63 (4991615) != end 4999679: invalid > wd0s2: type 0xa5, start 1, end = 2322431, size 2322431 : OK > wd0s3: type 0x4d, start 2322432, end = 3967487, size 1645056 : OK > sd0s1: type 0xa5, start 261990, end = 4446800, size 4184811 : OK > sd0s2: type 0x6, start 1, end = 261989, size 261989 : OK > sd1s1: type 0xa5, start 1, end = 4446800, size 4446800 : OK Here's the tail of my diskless dmesg. No disks or slices: BIOS Geometries: 0:03117f3f 0..785=786 cylinders, 0..127=128 heads, 1..63=63 sectors 0 accounted for Device configuration finished. Considering BOOTP NFS root f/s. configure() finished. bpf: lo0 attached bootpc_init: using network interface 'vx0' Bootpc testing starting bootpc hw address is 0:60:8:32:cb:96 My ip address is 172.31.10.16 Server ip address is 172.31.2.30 Gateway ip address is 0.0.0.0 Server name is bootes boot file is /kernel Subnet mask is 255.255.0.0 Router is 172.31.1.254 rootfs is 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird Hostname is mockingbird swapfs is 172.31.6.4:/diskless/FreeBSD/swapfs md_lookup_swap: Swap size is 65536 KB NFS SWAP: 172.31.6.4:/diskless/FreeBSD/swapfs NFS ROOT: 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird Note there's no listing of each drive and each slice. Also, the OS doesn't give me an accurate "fdisk" reading (of course, since it never initialized the disk): # fdisk fdisk: Can't get disk parameters on /dev/rwd0; supplying dummy ones ******* Working on device /dev/rwd0 ******* parameters extracted from in-core disklabel are: cylinders=1 heads=1 sectors/track=1 (1 blks/cyl) parameters to be used for BIOS calculations are: cylinders=1 heads=1 sectors/track=1 (1 blks/cyl) fdisk: Invalid fdisk partition table found Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 0 is: <UNUSED> The data for partition 1 is: <UNUSED> The data for partition 2 is: <UNUSED> The data for partition 3 is: sysid 165,(FreeBSD/NetBSD/386BSD) start 1, size 0 (0 Meg), flag 80 beg: cyl 1/ sector 1/ head 0; end: cyl 0/ sector 0/ head 0 And also, a hexdump doesn't find anything (again, of course): # hd -v /dev/rwd0 # Thanks... Steve On Thu, 13 Nov 1997, Brian Campbell wrote: > Date: Thu, 13 Nov 1997 20:41:50 -0500 > From: Brian Campbell <brianc@pobox.com> > To: Steven Kehlet <kehlet@dt.wdc.com> > Subject: Re: diskless freebsd, can't mount local msdos disk > > On Thu, Nov 13, 1997 at 05:12:17PM -0800, Steven Kehlet wrote: > > Thanks for replying. I tried booting with -v (I've included it all). > > Do you see anything wrong? For one thing, I don't see it detecting > > any slices... > > No ... can't see anything "wrong". But I think there's some stuff > missing at the end. Perhaps your boot messages are too long to be > "remembered" by dmesg. > > I've included the tail of my dmesg after yours. The last several > lines indicate the drives and the parititions on them. > > In any event, even if your dmesg doesn't show you want you want, > fdisk (as suggested by someone else) will. For me (where my DOS > partition is wd0s1) `fdisk wd0` gives: > > ******* Working on device /dev/rwd0 ******* > parameters extracted from in-core disklabel are: > cylinders=620 heads=128 sectors/track=63 (8064 blks/cyl) > > parameters to be used for BIOS calculations are: > cylinders=620 heads=128 sectors/track=63 (8064 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 6,(Primary 'big' DOS (> 32MB)) > start 3967488, size 1032192 (504 Meg), flag 0 > beg: cyl 492/ sector 1/ head 0; > end: cyl 618/ sector 63/ head 127 > The data for partition 2 is: > sysid 165,(FreeBSD/NetBSD/386BSD) > start 1, size 2322431 (1133 Meg), flag 80 > beg: cyl 0/ sector 2/ head 0; > end: cyl 287/ sector 63/ head 127 > The data for partition 3 is: > sysid 77,(unknown) > start 2322432, size 1645056 (803 Meg), flag 0 > beg: cyl 288/ sector 1/ head 0; > end: cyl 491/ sector 63/ head 127 > The data for partition 4 is: > <UNUSED> > > > mockingbird:/home/kehlet-> dmesg > > Copyright (c) 1992-1997 FreeBSD Inc. > > Copyright (c) 1982, 1986, 1989, 1991, 1993 > > The Regents of the University of California. All rights > > reserved. > > > > FreeBSD 2.2.5-RELEASE #0: Thu Nov 13 14:26:21 PST 1997 > > kehlet@daemon:/usr/src/sys.2.2.5/compile/DISKLESS > > Calibrating clock(s) ... i586 clock: 166378926 Hz, i8254 clock: > > 1193436 Hz > > CLK_USE_I8254_CALIBRATION not specified - using default frequency > > CLK_USE_I586_CALIBRATION not specified - using old calibration method > > CPU: Pentium (166.34-MHz 586-class CPU) > > Origin = "GenuineIntel" Id = 0x52c Stepping=12 > > Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8> > > real memory = 33554432 (32768K bytes) > > Physical memory chunk(s): > > 0x00001000 - 0x0009efff, 647168 bytes (158 pages) > > 0x00209000 - 0x01ffdfff, 31412224 bytes (7669 pages) > > avail memory = 30547968 (29832K bytes) > > pcibus_setup(1): mode 1 addr port (0x0cf8) is 0x80000058 > > pcibus_setup(1a): mode1res=0x80000000 (0x80000000) > > pcibus_check: device 0 is there (id=71008086) > > Probing for devices on PCI bus 0: > > configuration mode 1 allows 32 devices. > > chip0 <generic PCI bridge (vendor=8086 device=7100 subclass=0)> rev 1 > > on pci0:0 > > chip1 <generic PCI bridge (vendor=8086 device=7110 subclass=1)> rev 1 > > on pci0:7:0 > > pci0:7:1: Intel Corporation, device=0x7111, class=storage (ide) [no > > driver assigned] > > map(20): io(fc90) > > pci0:7:2: Intel Corporation, device=0x7112, class=0x0c, subclass=0x03 > > int d irq 11 [no driver assigned] > > map(20): io(fca0) > > chip2 <generic PCI bridge (vendor=8086 device=7113 subclass=128)> rev > > 1 on pci0:7:3 > > vga0 <VGA-compatible display device> rev 154 int a irq ?? on pci0:8 > > vx0 <3COM 3C905 Fast Etherlink XL PCI> rev 0 int a irq 5 on pci0:13 > > mapreg[10] type=1 addr=0000fcc0 size=0040. > > mii[*mii*]: disable 'auto select' with DOS util! address > > 00:60:08:32:cb:96 > > bpf: vx0 attached > > vga1 <VGA-compatible display device> rev 1 int a irq 9 on pci0:14 > > mapreg[10] type=0 addr=fedfc000 size=4000. > > mapreg[14] type=0 addr=fe000000 size=800000. > > pci0: uses 8404992 bytes of memory from fe000000 upto fedfffff. > > pci0: uses 64 bytes of I/O space from fcc0 upto fcff. > > Probing for devices on the ISA bus: > > sc0: the current keyboard controller command byte 0047 > > kbdio: DIAGNOSE status:0055 > > kbdio: TEST_KBD_PORT status:0000 > > kbdio: RESET_KBD return code:00fa > > kbdio: RESET_KBD status:00aa > > sc0 at 0x60-0x6f irq 1 on motherboard > > sc0: BIOS video mode:3 > > sc0: VGA registers upon power-up > > 50 18 10 00 10 00 03 00 02 67 60 4f 50 83 55 81 > > bf 1f 00 4f 0d 0e 00 00 03 70 9c 8e 8f 28 1f 96 > > b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c > > 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff > > sc0: video mode:24 > > sc0: VGA registers for mode:24 > > 50 18 10 00 10 00 03 00 02 67 60 4f 50 83 55 81 > > bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 > > b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c > > 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff > > sc0: VGA color <16 virtual consoles, flags=0x0> > > ed0 not found at 0x300 > > sio0 at 0x3f8-0x3ff irq 4 on isa > > sio0: type 16550A > > sio1 not found at 0x2f8 > > lpt0 at 0x378-0x37f irq 7 on isa > > lpt0: Interrupt-driven port > > lp0: TCP/IP capable interface > > bpf: lp0 attached > > psm0: current command byte:0047 > > kbdio: TEST_AUX_PORT status:0000 > > kbdio: RESET_AUX return code:00fa > > kbdio: RESET_AUX status:00aa > > kbdio: RESET_AUX ID:0000 > > psm0: status after reset 00 02 64 > > psm: status 00 00 64 (get_mouse_buttons) > > psm0: status 00 02 64 > > psm0 at 0x60-0x64 irq 12 on motherboard > > psm0: device ID 0, 2 buttons > > fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa > > fdc0: FIFO enabled, 8 bytes threshold > > fd0: 1.44MB 3.5in > > wdc0 at 0x1f0-0x1f7 irq 14 on isa > > wdc0: unit 0 (wd0): <WDC AC33200L> > > wd0: 3098MB (6346368 sectors), 6296 cyls, 16 heads, 63 S/T, 512 B/S > > ep0 not found at 0x300 > > npx0 on motherboard > > npx0: INT 16 interface > > imasks: bio c0004040, tty c0031092, net c0020020 > > BIOS Geometries: > > 0:03117f3f 0..785=786 cylinders, 0..127=128 heads, 1..63=63 sectors > > 0 accounted for > > Device configuration finished. > > Considering BOOTP NFS root f/s. > > configure() finished. > > bpf: lo0 attached > > bootpc_init: using network interface 'vx0' > > Bootpc testing starting > > bootpc hw address is 0:60:8:32:cb:96 > > My ip address is 172.31.10.16 > > Server ip address is 172.31.2.30 > > Gateway ip address is 0.0.0.0 > > Server name is bootes > > boot file is /kernel > > Subnet mask is 255.255.0.0 > > Router is 172.31.1.254 > > rootfs is 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird > > Hostname is mockingbird > > swapfs is 172.31.6.4:/diskless/FreeBSD/swapfs > > md_lookup_swap: Swap size is 65536 KB > > NFS SWAP: 172.31.6.4:/diskless/FreeBSD/swapfs > > NFS ROOT: 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird > > > > > > On Thu, 13 Nov 1997, Brian Campbell wrote: > > > On Thu, Nov 13, 1997 at 02:50:17PM -0800, Steven Kehlet wrote: > > > > I'm booting FreeBSD 2.2.5 diskless with the kernel's BOOTP features. > > > > It detects the local hardware just fine (e.g. ethernet (obviously), > > > > hard drive, floppy, etc), but if I try to mount the local msdos disk > > > > like I would on a non-diskless station, it doesn't work. Floppy > > > > operations (mounting, hexdumping, fdwriting) seem to work, however. > > > > Anyone know what's wrong, or have any suggestions what I could do? If > > > > I can give any more information, please let me know. > > > > > > > > wdc0 at 0x1f0-0x1f7 irq 14 on isa > > > > wdc0: unit 0 (wd0): <WDC AC33200L> > > > > wd0: 3098MB (6346368 sectors), 6296 cyls, 16 heads, 63 S/T, 512 B/S > > > > > > > > # foreach i (1 2 3 4) > > > > ? mount_msdos /dev/wd0s$i /mnt > > > > ? end > > > > mount_msdos: /dev/wd0s1: Invalid argument > > > > mount_msdos: /dev/wd0s2: Invalid argument > > > > mount_msdos: /dev/wd0s3: Invalid argument > > > > mount_msdos: /dev/wd0s4: Invalid argument > > > > > > If you boot -v it'll tell you what types the detected partitions > > > on wd0 are ... > > > > > > Your DOS partition(s) will likely be type 0x6 > > psm0: status after reset 00 02 64 > psm: status d0 03 c8 (get_mouse_buttons) > psm0: status 00 02 64 > psm0 at 0x60-0x64 irq 12 on motherboard > psm0: device ID 0, 3 buttons > fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa > fdc0: FIFO enabled, 8 bytes threshold > fd0: 1.44MB 3.5in > wdc0 at 0x1f0-0x1f7 irq 14 flags 0xa0ffa0ff on isa > wdc0: unit 0 (wd0): <WDC AC32500H>, DMA, 32-bit, multi-block-16 > wd0: 2441MB (4999680 sectors), 4960 cyls, 16 heads, 63 S/T, 512 B/S > wd0: ATA INQUIRE valid = 0003, dmamword = 0407, apio = 0003, udma = 0000 > wdc1 at 0x170-0x177 irq 15 flags 0xa0ffa0ff on isa > wdc1: unit 0 (atapi): <NEC CD-ROM DRIVE:282/3.04>, removable, dma, iordy > wcd0: 1376Kb/sec, 128Kb cache, audio play, 256 volume levels, ejectable tray > wcd0: medium type unknown, unlocked > npx0 on motherboard > npx0: INT 16 interface > sb0 at 0x220 irq 5 drq 1 on isa > sb0: <SoundBlaster 16 4.13> > sbxvi0 at 0x220 drq 5 on isa > sbxvi0: <SoundBlaster 16 4.13> > sbmidi0 at 0x300 on isa > <SoundBlaster MPU-401> > opl0 at 0x388 on isa > opl0: <Yamaha OPL-3 FM> > gus0 at 0x240 irq 7 drq 7 flags 0x3 on isa > gus0: <Gravis UltraSound MAX (1024k)> > gus0: <GUS MAX (CS4231)> > mpu0 at 0x330 irq 9 drq 0 on isa > mpu0: <MPU-401 MIDI Interface 1.5B> > apm0 on isa > apm: found APM BIOS version 1.1 > imasks: bio c000c840, tty c003101a, net c0020000 > BIOS Geometries: > 0:026a7f3f 0..618=619 cylinders, 0..127=128 heads, 1..63=63 sectors > 0 accounted for > Device configuration finished. > Considering FFS root f/s. > configure() finished. > bpf: tun0 attached > bpf: tun1 attached > bpf: lo0 attached > ccd0: Concatenated disk driver > IP packet filtering initialized, divert disabled, unlimited logging > wd0s1: type 0x6, start 3967488, end = 4999679, size 1032192 > wd0s1: C/H/S end 618/127/63 (4991615) != end 4999679: invalid > wd0s2: type 0xa5, start 1, end = 2322431, size 2322431 : OK > wd0s3: type 0x4d, start 2322432, end = 3967487, size 1645056 : OK > sd0s1: type 0xa5, start 261990, end = 4446800, size 4184811 : OK > sd0s2: type 0x6, start 1, end = 261989, size 261989 : OK > sd1s1: type 0xa5, start 1, end = 4446800, size 4446800 : OK > Full dmesg: > > mockingbird:/home/kehlet-> dmesg > > Copyright (c) 1992-1997 FreeBSD Inc. > > Copyright (c) 1982, 1986, 1989, 1991, 1993 > > The Regents of the University of California. All rights > > reserved. > > > > FreeBSD 2.2.5-RELEASE #0: Thu Nov 13 14:26:21 PST 1997 > > kehlet@daemon:/usr/src/sys.2.2.5/compile/DISKLESS > > Calibrating clock(s) ... i586 clock: 166378926 Hz, i8254 clock: > > 1193436 Hz > > CLK_USE_I8254_CALIBRATION not specified - using default frequency > > CLK_USE_I586_CALIBRATION not specified - using old calibration method > > CPU: Pentium (166.34-MHz 586-class CPU) > > Origin = "GenuineIntel" Id = 0x52c Stepping=12 > > Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8> > > real memory = 33554432 (32768K bytes) > > Physical memory chunk(s): > > 0x00001000 - 0x0009efff, 647168 bytes (158 pages) > > 0x00209000 - 0x01ffdfff, 31412224 bytes (7669 pages) > > avail memory = 30547968 (29832K bytes) > > pcibus_setup(1): mode 1 addr port (0x0cf8) is 0x80000058 > > pcibus_setup(1a): mode1res=0x80000000 (0x80000000) > > pcibus_check: device 0 is there (id=71008086) > > Probing for devices on PCI bus 0: > > configuration mode 1 allows 32 devices. > > chip0 <generic PCI bridge (vendor=8086 device=7100 subclass=0)> rev 1 > > on pci0:0 > > chip1 <generic PCI bridge (vendor=8086 device=7110 subclass=1)> rev 1 > > on pci0:7:0 > > pci0:7:1: Intel Corporation, device=0x7111, class=storage (ide) [no > > driver assigned] > > map(20): io(fc90) > > pci0:7:2: Intel Corporation, device=0x7112, class=0x0c, subclass=0x03 > > int d irq 11 [no driver assigned] > > map(20): io(fca0) > > chip2 <generic PCI bridge (vendor=8086 device=7113 subclass=128)> rev > > 1 on pci0:7:3 > > vga0 <VGA-compatible display device> rev 154 int a irq ?? on pci0:8 > > vx0 <3COM 3C905 Fast Etherlink XL PCI> rev 0 int a irq 5 on pci0:13 > > mapreg[10] type=1 addr=0000fcc0 size=0040. > > mii[*mii*]: disable 'auto select' with DOS util! address > > 00:60:08:32:cb:96 > > bpf: vx0 attached > > vga1 <VGA-compatible display device> rev 1 int a irq 9 on pci0:14 > > mapreg[10] type=0 addr=fedfc000 size=4000. > > mapreg[14] type=0 addr=fe000000 size=800000. > > pci0: uses 8404992 bytes of memory from fe000000 upto fedfffff. > > pci0: uses 64 bytes of I/O space from fcc0 upto fcff. > > Probing for devices on the ISA bus: > > sc0: the current keyboard controller command byte 0047 > > kbdio: DIAGNOSE status:0055 > > kbdio: TEST_KBD_PORT status:0000 > > kbdio: RESET_KBD return code:00fa > > kbdio: RESET_KBD status:00aa > > sc0 at 0x60-0x6f irq 1 on motherboard > > sc0: BIOS video mode:3 > > sc0: VGA registers upon power-up > > 50 18 10 00 10 00 03 00 02 67 60 4f 50 83 55 81 > > bf 1f 00 4f 0d 0e 00 00 03 70 9c 8e 8f 28 1f 96 > > b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c > > 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff > > sc0: video mode:24 > > sc0: VGA registers for mode:24 > > 50 18 10 00 10 00 03 00 02 67 60 4f 50 83 55 81 > > bf 1f 00 4f 0d 0e 00 00 00 00 9c 8e 8f 28 1f 96 > > b9 a3 ff 00 01 02 03 04 05 14 07 38 39 3a 3b 3c > > 3d 3e 3f 0c 00 0f 08 00 00 00 00 00 10 0e 00 ff > > sc0: VGA color <16 virtual consoles, flags=0x0> > > ed0 not found at 0x300 > > sio0 at 0x3f8-0x3ff irq 4 on isa > > sio0: type 16550A > > sio1 not found at 0x2f8 > > lpt0 at 0x378-0x37f irq 7 on isa > > lpt0: Interrupt-driven port > > lp0: TCP/IP capable interface > > bpf: lp0 attached > > psm0: current command byte:0047 > > kbdio: TEST_AUX_PORT status:0000 > > kbdio: RESET_AUX return code:00fa > > kbdio: RESET_AUX status:00aa > > kbdio: RESET_AUX ID:0000 > > psm0: status after reset 00 02 64 > > psm: status 00 00 64 (get_mouse_buttons) > > psm0: status 00 02 64 > > psm0 at 0x60-0x64 irq 12 on motherboard > > psm0: device ID 0, 2 buttons > > fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa > > fdc0: FIFO enabled, 8 bytes threshold > > fd0: 1.44MB 3.5in > > wdc0 at 0x1f0-0x1f7 irq 14 on isa > > wdc0: unit 0 (wd0): <WDC AC33200L> > > wd0: 3098MB (6346368 sectors), 6296 cyls, 16 heads, 63 S/T, 512 B/S > > ep0 not found at 0x300 > > npx0 on motherboard > > npx0: INT 16 interface > > imasks: bio c0004040, tty c0031092, net c0020020 > > BIOS Geometries: > > 0:03117f3f 0..785=786 cylinders, 0..127=128 heads, 1..63=63 sectors > > 0 accounted for > > Device configuration finished. > > Considering BOOTP NFS root f/s. > > configure() finished. > > bpf: lo0 attached > > bootpc_init: using network interface 'vx0' > > Bootpc testing starting > > bootpc hw address is 0:60:8:32:cb:96 > > My ip address is 172.31.10.16 > > Server ip address is 172.31.2.30 > > Gateway ip address is 0.0.0.0 > > Server name is bootes > > boot file is /kernel > > Subnet mask is 255.255.0.0 > > Router is 172.31.1.254 > > rootfs is 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird > > Hostname is mockingbird > > swapfs is 172.31.6.4:/diskless/FreeBSD/swapfs > > md_lookup_swap: Swap size is 65536 KB > > NFS SWAP: 172.31.6.4:/diskless/FreeBSD/swapfs > > NFS ROOT: 172.31.6.4:/diskless/FreeBSD/rootfs/mockingbird > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96.971114073829.29672A-100000>