From owner-freebsd-current Fri Jan 15 20:25:45 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA00281 for freebsd-current-outgoing; Fri, 15 Jan 1999 20:25:45 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from send103.yahoomail.com (send103.yahoomail.com [205.180.60.92]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id UAA00266 for ; Fri, 15 Jan 1999 20:25:44 -0800 (PST) (envelope-from ixkatl@yahoo.com) Message-ID: <19990116042746.27277.rocketmail@send103.yahoomail.com> Received: from [207.172.145.77] by send103.yahoomail.com; Fri, 15 Jan 1999 20:27:46 PST Date: Fri, 15 Jan 1999 20:27:46 -0800 (PST) From: Andrew Sherrod Subject: Disk Geometry Patch. Could someone test this on -current. To: current@FreeBSD.ORG MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1918502651-916460866=:23202" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --0-1918502651-916460866=:23202 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I have found several people using IDE disks on newer Award BIOSes have trouble getting the boot-time probes and installation routines to recognize the correct disk geometry. If anyone is running 3.0 (or 2.2.x) on a machine with Award BIOS using IDE drives with LBA turned off in the kernel configuration, and if you have trouble getting dmesg/boot probes to recognize the proper disk size, could you test the attached patch for me? I would also like to find testers with ANY BIOS that reports a disk size too small. I think my patch will correct most problems with IDE geometry showing as smaller than it actually is. (I don't make any claims about geometries being reported as too large, or SCSI disks...) Thanks to anyone who can help. Andrew Sherrod P.S. I know this is not a really big problem, but it always seemed a bit insulting that FreeBSD had to rely on DOS boot sectors to get the correct disk geometry. I would rather that we could identify the correct geometry without having to rely on another OS. And, face it, for newbies and those not terribly computer literate, getting the right geometry during installation is a very nice feature. It is rather disheartening for a new-comer to find out that their new operating system can't even identify the correct disk geometry. _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com --0-1918502651-916460866=:23202 Content-Type: text/plain; name="mail.txt" Content-Description: mail.txt Content-Disposition: inline; filename="mail.txt" ------------------------------------------------- PR: i386/9431 ------------------------------------------------- ------------------------------------------------- Patch for 2.2.8 (May also workfor 2.2.6/2.2.7) ------------------------------------------------- *** wd.c.2_2_8 Wed Jan 13 21:07:30 1999 --- wd.c.original.2_2_8 Wed Jan 13 21:08:24 1999 *************** *** 113,122 **** #define WDOPT_FORCEHD(x) (((x)&0x0f00)>>8) #define WDOPT_MULTIMASK 0x00ff - /* This bit mask is used to determine if the drive supports LBA addressing. */ - - #define WDCAP_LBA 0x02 - /* * This biotab field doubles as a field for the physical unit number on * the controller. --- 113,118 ---- *************** *** 1731,1745 **** du->dk_dd.d_nsectors = wp->wdp_sectors; du->dk_dd.d_secpercyl = du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! ! /* Check for BIOS LBA flag. This should allow kernel to determine ! actual disk geometry for diffiuclt BIOSes. ! This will likely only be of use during initial installation, or ! perhaps when configuring a new drive. Otherwise, the disk geometry ! should already be known. -A. Sherrod 01/13/1999*/ ! ! if ( ( (wp->wdp_capability&WDCAP_LBA) || ! (wp->wdp_cylinders == 16383 ) ) && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = --- 1727,1733 ---- du->dk_dd.d_nsectors = wp->wdp_sectors; du->dk_dd.d_secpercyl = du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! if (wp->wdp_cylinders == 16383 && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = ------------------------------------------------- Patch for 3.0 ------------------------------------------------- *** wd.c.3_0 Wed Jan 13 12:07:46 1999 --- wd.c.original.3_0 Wed Jan 13 11:17:54 1999 *************** *** 130,140 **** */ #define id_physid id_scsiid - /* This bitmask is used to determine if the BIOS flags showing LBA support - are active or inactive */ - - #define WDCAP_LBA 0x02 - /* * Drive states. Used to initialize drive. */ --- 130,135 ---- *************** *** 1954,1973 **** du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! ! /* If BIOS specifies LBA mode is supported, but LBA flags ! are not set, check if wdp_lbasize is larger than ! CHS size. If so, use the lba_size. ! This should fix problems with certain BIOSes (e.g. Award) ! which do not report the correct size when using only ! CHS calculations. ! This will not force the use of LBA mode. It is only ! used to determine disk geometry. ! ! -A. Sherrod 01/13/1999 */ ! ! if ( ( (wp->wdp_capabilities & WDCAP_LBA) || ! (wp->wdp_cylinders == 16383) ) && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = --- 1949,1955 ---- du->dk_dd.d_ntracks * du->dk_dd.d_nsectors; du->dk_dd.d_secperunit = du->dk_dd.d_secpercyl * du->dk_dd.d_ncylinders; ! if (wp->wdp_cylinders == 16383 && du->dk_dd.d_secperunit < wp->wdp_lbasize) { du->dk_dd.d_secperunit = wp->wdp_lbasize; du->dk_dd.d_ncylinders = ------------------------------------------------- dmesg from 2.2.8 system before patch ------------------------------------------------- Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 2.2.8-RELEASE #6: Wed Jan 13 21:11:20 EST 1999 root@HAL9000.yaldabaoth.com:/usr/src/sys/compile/HAL CPU: AMD-K6(tm) 3D processor (350.80-MHz 586-class CPU) Origin = "AuthenticAMD" Id = 0x580 Stepping=0 Features=0x8001bf real memory = 201326592 (196608K bytes) avail memory = 194924544 (190356K bytes) Probing for devices on PCI bus 0: chip0 rev 4 on pci0:0:0 chip1 rev 0 on pci0:1:0 chip2 rev 65 on pci0:7:0 pci0:7:1: VIA Technologies, device=0x0571, class=storage (ide) [no driver assigned] chip3 rev 16 on pci0:7:3 xl0 <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 48 int a irq 11 on pci0:10:0 xl0: Ethernet address: 00:10:5a:20:9b:68 xl0: autoneg not complete, no carrier (forcing half-duplex, 10Mbps) Probing for devices on PCI bus 1: Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color <16 virtual consoles, flags=0x0> sio0: configured irq 4 not in bitmap of probed irqs 0 sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 8250 sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 16550A lpt0 at 0x378-0x37f irq 7 on isa lpt0: Interrupt-driven port lp0: TCP/IP capable interface psm0 at 0x60-0x64 irq 12 on motherboard psm0: model Generic PS/2 mouse, device ID 0 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): wd0: 8063MB (16514064 sectors), 16383 cyls, 16 heads, 63 S/T, 512 B/S wdc0: unit 1 (wd1): wd1: 2014MB (4124736 sectors), 4092 cyls, 16 heads, 63 S/T, 512 B/S wdc1 at 0x170-0x177 irq 15 on isa wdc1: unit 0 (wd2): wd2: 1888MB (3866940 sectors), 4092 cyls, 15 heads, 63 S/T, 512 B/S wdc1: unit 1 (atapi): , removable, intr, dma, iordis wcd0: 5512KB/sec, 256KB cache, audio play, 255 volume levels, ejectable tray wcd0: no disc inside, unlocked mcd0 not found at 0x300 npx0 flags 0x1 on motherboard npx0: INT 16 interface ------------------------------------------------- dmesg from 2.2.8 system after patch ------------------------------------------------- Copyright (c) 1992-1998 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 2.2.8-RELEASE #7: Wed Jan 13 21:26:09 EST 1999 root@HAL9000.yaldabaoth.com:/usr/src/sys/compile/HAL CPU: AMD-K6(tm) 3D processor (350.80-MHz 586-class CPU) Origin = "AuthenticAMD" Id = 0x580 Stepping=0 Features=0x8001bf real memory = 201326592 (196608K bytes) avail memory = 194924544 (190356K bytes) Probing for devices on PCI bus 0: chip0 rev 4 on pci0:0:0 chip1 rev 0 on pci0:1:0 chip2 rev 65 on pci0:7:0 pci0:7:1: VIA Technologies, device=0x0571, class=storage (ide) [no driver assigned] chip3 rev 16 on pci0:7:3 xl0 <3Com 3c905B Fast Etherlink XL 10/100BaseTX> rev 48 int a irq 11 on pci0:10:0 xl0: Ethernet address: 00:10:5a:20:9b:68 xl0: autoneg not complete, no carrier (forcing half-duplex, 10Mbps) Probing for devices on PCI bus 1: Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color <16 virtual consoles, flags=0x0> sio0: configured irq 4 not in bitmap of probed irqs 0 sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 8250 sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 16550A lpt0 at 0x378-0x37f irq 7 on isa lpt0: Interrupt-driven port lp0: TCP/IP capable interface psm0 at 0x60-0x64 irq 12 on motherboard psm0: model Generic PS/2 mouse, device ID 0 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): wd0: 8063MB (16514064 sectors), 16383 cyls, 16 heads, 63 S/T, 512 B/S wdc0: unit 1 (wd1): wd1: 3020MB (6185088 sectors), 6136 cyls, 16 heads, 63 S/T, 512 B/S wdc1 at 0x170-0x177 irq 15 on isa wdc1: unit 0 (wd2): wd2: 4120MB (8439184 sectors), 8930 cyls, 15 heads, 63 S/T, 512 B/S wdc1: unit 1 (atapi): , removable, intr, dma, iordis wcd0: 5512KB/sec, 256KB cache, audio play, 255 volume levels, ejectable tray wcd0: no disc inside, unlocked mcd0 not found at 0x300 npx0 flags 0x1 on motherboard npx0: INT 16 interface --0-1918502651-916460866=:23202-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message