DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th August 2009
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default OpenBSD 4.6 i386 boot hangs with old Gateway system - resolved

This problem is resolved I want to document it.

When booting 4.4, 4.5 and a recent 4.6, lots of boot configuration messages appear
and then the process just stops, hangs, freezes...

To fix the problem while booting I do this:

>boot -c
...
ukc>disable apm
ukc>quit


And to "permanently" fix the problem I alter the /bsd boot file like this:

mv /bsd /bsd.old
config -e -o /bsd /bsd.old
ukc>disable apm
ukc>quit

Here is the dmesg from a successful boot:
Code:
OpenBSD 4.6-current (GENERIC) #105: Mon Aug 10 18:02:36 MDT 2009
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: AMD Athlon(tm) Processor ("AuthenticAMD" 686-class, 512KB L2 cache) 699 MHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR
real mem  = 267874304 (255MB)
avail mem = 250736640 (239MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 12/05/99, BIOS32 rev. 0 @ 0xfdab0, SMBIOS rev. 2.3 @ 0xf0920 (38 entries)
bios0: vendor American Megatrends Inc. version "0AASNP06" date 07/23/1999
bios0: Gateway "
apm at bios0 function 0x15 not configured
acpi0 at bios0: rev 0
acpi0: tables DSDT FACP
acpi0: wakeup devices PS2M(S1) PS2K(S1) PCI0(S1)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (AGPB)
acpicpu0 at acpi0
bios0: ROM list: 0xc0000/0x10000
cpu0 at mainbus0: (uniprocessor)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "AMD 751 System" rev 0x25
amdagp0 at pchb0
agp0 at amdagp0: aperture at 0xf8000000, size 0x4000000
ppb0 at pci0 dev 1 function 0 "AMD 751 PCI-PCI" rev 0x01
pci1 at ppb0 bus 1
vga1 at pci1 dev 5 function 0 "NVIDIA Vanta" rev 0x15
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
pcib0 at pci0 dev 7 function 0 "AMD 756 ISA" rev 0x01
pciide0 at pci0 dev 7 function 1 "AMD 756 IDE" rev 0x07: DMA, channel 0 configured to compatibility, channel 1 configured
 to compatibility
wd0 at pciide0 channel 0 drive 0: <FUJITSU MPD3043AT>
wd0: 16-sector PIO, LBA, 4125MB, 8448300 sectors  
wd1 at pciide0 channel 0 drive 1: <FUJITSU MPF3102AT>
wd1: 16-sector PIO, LBA, 9773MB, 20015856 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
wd1(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <LG, CD-ROM CRD-8483B, 1.02> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
amdpm0 at pci0 dev 7 function 3 "AMD 756 Power" rev 0x03
ohci0 at pci0 dev 7 function 4 "AMD 756 USB Host" rev 0x06: irq 10, version 1.0, legacy support
ral0 at pci0 dev 15 function 0 "Ralink RT2561S" rev 0x00: irq 11, address 00:14:a5:0f:72:34
ral0: MAC/BBP RT2661B, RF RT2527
"Conexant 56k Winmodem" rev 0x08 at pci0 dev 17 function 0 not configured
epic0 at pci0 dev 18 function 0 "SMC 83C170 (EPIC/100)" rev 0x08, SMC9432TX : irq 9, address 00:e0:29:31:9a:5c
qsphy0 at epic0 phy 3: QS6612 10/100 PHY, rev. 1
xl0 at pci0 dev 19 function 0 "3Com 3c905B 100Base-TX" rev 0x30: irq 5, address 00:10:5a:11:16:7e
exphy0 at xl0 phy 24: 3Com internal media interface
eap0 at pci0 dev 20 function 0 "Ensoniq AudioPCI97" rev 0x08: irq 9
ac97: codec id 0x43525913 (Cirrus Logic CS4297A rev 3)
ac97: codec features headphone, 20 bit DAC, 18 bit ADC, Crystal Semi 3D
audio0 at eap0
midi0 at eap0: <AudioPCI MIDI UART>
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi1 at pcppi0: <PC speaker>
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 "AMD OHCI root hub" rev 1.00/1.00 addr 1
biomask f5cd netmask ffed ttymask ffff
mtrr: Pentium Pro MTRR support
uhidev0 at uhub0 port 1 configuration 1 interface 0 "Kensington USB/PS2 Wheel Mouse" rev 1.10/1.01 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 5 buttons, Z dir
wsmouse0 at ums0 mux 0
softraid0 at root
root on wd0a swap on wd0b dump on wd0b

Last edited by comet--berkeley; 15th August 2009 at 04:41 PM. Reason: formatting
Reply With Quote
  #2   (View Single Post)  
Old 15th August 2009
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by comet--berkeley View Post
To fix the problem while booting I do this:

>boot -c
...
ukc>disable apm
ukc>quit


And to "permanently" fix the problem I alter the /bsd boot file like this:

mv /bsd /bsd.old
config -e -o /bsd /bsd.old
ukc>disable apm
ukc>quit
The following may give you an answer explaining why you are having to disable APM:

http://marc.info/?l=openbsd-tech&m=124545473209570&w=2
Reply With Quote
  #3   (View Single Post)  
Old 15th August 2009
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

OpenBSD is actually one of view few systems that even has any decent kind of runtime heuristics for apm+pcibios vs acpi.

It's not really a big deal to disable either or if a problem occurs.. but the developers are trying to make things easier..

Also, am I the only person that doesn't consider his system old? looks rather decent if you ask me.. AMD Athlon systems were much better then the Intel equivalents of the time.

Given the surplus of networking equipment, are you planning on turning this system into a router/firewall?
Reply With Quote
  #4   (View Single Post)  
Old 15th August 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by BSDfan666 View Post
Also, am I the only person that doesn't consider his system old? looks rather decent if you ask me.. AMD Athlon systems were much better then the Intel equivalents of the time.
Vaguely similar to my main box, but a bit faster. Old, in a way yes, but not necessarily bad. A bit pokey at times, but the main bottleneck is low-speed Internet. But it all depends what you want to do with it.
Reply With Quote
  #5   (View Single Post)  
Old 16th August 2009
comet--berkeley comet--berkeley is offline
Real Name: Richard
Package Pilot
 
Join Date: Apr 2009
Location: California
Posts: 163
Default

Apparently there is a spam problem on this board and it will not let me post urls:

"You are only allowed to post URLs once you have at least 5 posts."

So you will have to cut/paste them....

Quote:
Originally Posted by ocicat View Post
The following may give you an answer explaining why you are having to disable APM:

url: marc.info/?l=openbsd-tech&m=124545473209570&w=2
Thank you for the link. The machine was built to use Windows 98 which apparently was the first operating system to use ACPI.

url: en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface

ACPI was designed to replace APM.

url: en.wikipedia.org/wiki/Advanced_Power_Management

Quote:
Originally Posted by BSDfan666 View Post
t's not really a big deal to disable either or if a problem occurs.. but the developers are trying to make things easier..
It was not "intuitively obvious" either. I could find no error messages about APM and discovered the fix by scanning the web with Google and by trial and error.

I started with changing bios settings. That didn't work.

Then I pulled out all of my hardware until I got down to a mother board and a floppy disk drive. That didn't work.

(I tried booting OpenBSD from a floppy because I thought it might be the CDROM drive. And I tried using two different CDROM drives...that didn't work.)

Then I tried older versions of OpenBSD, 4.4 and 4.5. That didn't work.

Finally I discovered the "boot -c" command and tried "disable acpi". That didn't work.

And then I tried "disable apm" and finally success.

Quote:
Originally Posted by BSDfan666 View Post
Also, am I the only person that doesn't consider his system old? looks rather decent if you ask me.. AMD Athlon systems were much better then the Intel equivalents of the time.
Well the system is 10 years old and I agree it is not too bad.

But a typical Athlon desktop system today is a dual core Athlon 2.5 Ghz with 3 Gbytes ram and a 320 Gbyte disk drive.

Quote:
Originally Posted by BSDfan666 View Post
Given the surplus of networking equipment, are you planning on turning this system into a router/firewall?
It doesn't make economic sense, but yes I am turning it into a wireless router just for fun and knowledge.

__________________

Last edited by comet--berkeley; 16th August 2009 at 02:31 PM. Reason: Remembered trying 2 cdrom drives...
Reply With Quote
  #6   (View Single Post)  
Old 19th August 2009
s2scott's Avatar
s2scott s2scott is offline
Package Pilot
 
Join Date: May 2008
Location: Toronto, Ontario Canada
Posts: 198
Default

Quote:
Originally Posted by comet--berkeley View Post
... It doesn't make economic sense, but yes I am turning it into a wireless router just for fun and knowledge.
Ah, but once you glean the power and flexibility of pf(4) firewall facility, you'll find it hard to suffer the consumer retail "stuff."

Welcome aboard,
/S
__________________
Never argue with an idiot. They will bring you down to their level and beat you with experience.
Reply With Quote
  #7   (View Single Post)  
Old 22nd July 2011
Logan Logan is offline
Real Name: Loganaden Velvindron
New User
 
Join Date: Jul 2011
Location: Mauritius
Posts: 3
Default

Hi,

OpenBSD 4.9 is going beta.

Try this diff: It reduces mbuf usage :-)

Index: smc83c170.c
================================================== =================
RCS file: /root/src/sys/dev/ic/smc83c170.c,v
retrieving revision 1.14
diff -u -r1.14 smc83c170.c
--- smc83c170.c 10 Aug 2009 20:29:54 -0000 1.14
+++ smc83c170.c 21 Jul 2011 17:06:49 -0000
@@ -83,6 +83,7 @@

void epic_reset(struct epic_softc *);
void epic_rxdrain(struct epic_softc *);
+void epic_fill_rx_ring(struct epic_softc *);
int epic_add_rxbuf(struct epic_softc *, int);
void epic_read_eeprom(struct epic_softc *, int, int, u_int16_t *);
void epic_set_mchash(struct epic_softc *);
@@ -286,7 +287,7 @@
ifp->if_watchdog = epic_watchdog;
IFQ_SET_MAXLEN(&ifp->if_snd, EPIC_NTXDESC - 1);
IFQ_SET_READY(&ifp->if_snd);
-
+ m_clsetwms(ifp, MCLBYTES, 2, EPIC_NRXDESC - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;

/*
@@ -621,7 +622,7 @@
* Check for receive interrupts.
*/
if (intstat & (INTSTAT_RCC | INTSTAT_RXE | INTSTAT_RQE)) {
- for (i = sc->sc_rxptr;; i = EPIC_NEXTRX(i)) {
+ for (i = sc->sc_rx_cons; sc->sc_rx_cnt > 0; i = EPIC_NEXTRX(i)) {
rxd = EPIC_CDRX(sc, i);
ds = EPIC_DSRX(sc, i);

@@ -637,6 +638,13 @@
break;
}

+ bus_dmamap_sync(sc->sc_dmat, ds->ds_dmamap, 0,
+ ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
+ bus_dmamap_unload(sc->sc_dmat, ds->ds_dmamap);
+
+ m = ds->ds_mbuf;
+ ds->ds_mbuf = NULL;
+ sc->sc_rx_cnt--;
/*
* Make sure the packet arrived intact. If an error
* occurred, update stats and reset the descriptor.
@@ -651,13 +659,10 @@
printf("%s: alignment error\n",
sc->sc_dev.dv_xname);
ifp->if_ierrors++;
- EPIC_INIT_RXDESC(sc, i);
+ m_freem(m);
continue;
}

- bus_dmamap_sync(sc->sc_dmat, ds->ds_dmamap, 0,
- ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
-
/*
* The EPIC includes the CRC with every packet;
* trim it.
@@ -669,51 +674,16 @@
* Runt packet; drop it now.
*/
ifp->if_ierrors++;
- EPIC_INIT_RXDESC(sc, i);
+ m_freem(m);
bus_dmamap_sync(sc->sc_dmat, ds->ds_dmamap, 0,
ds->ds_dmamap->dm_mapsize,
BUS_DMASYNC_PREREAD);
continue;
}

- /*
- * If the packet is small enough to fit in a
- * single header mbuf, allocate one and copy
- * the data into it. This greatly reduces
- * memory consumption when we receive lots
- * of small packets.
- *
- * Otherwise, we add a new buffer to the receive
- * chain. If this fails, we drop the packet and
- * recycle the old buffer.
- */
- if (epic_copy_small != 0 && len <= MHLEN) {
- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
- goto dropit;
- memcpy(mtod(m, caddr_t),
- mtod(ds->ds_mbuf, caddr_t), len);
- EPIC_INIT_RXDESC(sc, i);
- bus_dmamap_sync(sc->sc_dmat, ds->ds_dmamap, 0,
- ds->ds_dmamap->dm_mapsize,
- BUS_DMASYNC_PREREAD);
- } else {
- m = ds->ds_mbuf;
- if (epic_add_rxbuf(sc, i) != 0) {
- dropit:
- ifp->if_ierrors++;
- EPIC_INIT_RXDESC(sc, i);
- bus_dmamap_sync(sc->sc_dmat,
- ds->ds_dmamap, 0,
- ds->ds_dmamap->dm_mapsize,
- BUS_DMASYNC_PREREAD);
- continue;
- }
- }
-
m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len;
-
+ m->m_data += 2;
#if NBPFILTER > 0
/*
* Pass this up to any BPF listeners, but only
@@ -729,20 +699,16 @@
}

/* Update the receive pointer. */
- sc->sc_rxptr = i;
-
+ sc->sc_rx_cons = i;
+ epic_fill_rx_ring(sc);
/*
* Check for receive queue underflow.
*/
if (intstat & INTSTAT_RQE) {
- printf("%s: receiver queue empty\n",
- sc->sc_dev.dv_xname);
/*
* Ring is already built; just restart the
* receiver.
*/
- bus_space_write_4(sc->sc_st, sc->sc_sh, EPIC_PRCDAR,
- EPIC_CDRXADDR(sc, sc->sc_rxptr));
bus_space_write_4(sc->sc_st, sc->sc_sh, EPIC_COMMAND,
COMMAND_RXQUEUED | COMMAND_START_RX);
}
@@ -908,9 +874,8 @@
bus_space_tag_t st = sc->sc_st;
bus_space_handle_t sh = sc->sc_sh;
struct epic_txdesc *txd;
- struct epic_descsoft *ds;
u_int32_t genctl, reg0;
- int i, error = 0;
+ int i;

/*
* Cancel any pending I/O.
@@ -998,24 +963,12 @@
* Initialize the receive descriptor ring.
*/
for (i = 0; i < EPIC_NRXDESC; i++) {
- ds = EPIC_DSRX(sc, i);
- if (ds->ds_mbuf == NULL) {
- if ((error = epic_add_rxbuf(sc, i)) != 0) {
- printf("%s: unable to allocate or map rx "
- "buffer %d error = %d\n",
- sc->sc_dev.dv_xname, i, error);
- /*
- * XXX Should attempt to run with fewer receive
- * XXX buffers instead of just failing.
- */
- epic_rxdrain(sc);
- goto out;
- }
- } else
- EPIC_INIT_RXDESC(sc, i);
+ sc->sc_control_data->ecd_rxdescs[i].er_bufaddr = 0;
+ sc->sc_control_data->ecd_rxdescs[i].er_control = 0;
+ sc->sc_control_data->ecd_rxdescs[i].er_rxstatus = 0;
+ sc->sc_control_data->ecd_rxdescs[i].er_nextdesc = 0;
}
- sc->sc_rxptr = 0;
-
+ epic_fill_rx_ring(sc);
/*
* Initialize the interrupt mask and enable interrupts.
*/
@@ -1028,7 +981,7 @@
bus_space_write_4(st, sh, EPIC_PTCDAR,
EPIC_CDTXADDR(sc, EPIC_NEXTTX(sc->sc_txlast)));
bus_space_write_4(st, sh, EPIC_PRCDAR,
- EPIC_CDRXADDR(sc, sc->sc_rxptr));
+ EPIC_CDRXADDR(sc, sc->sc_rx_prod));

/*
* Set the EPIC in motion.
@@ -1052,10 +1005,7 @@
*/
epic_start(ifp);

- out:
- if (error)
- printf("%s: interface not running\n", sc->sc_dev.dv_xname);
- return (error);
+ return (0);
}

/*
@@ -1075,6 +1025,7 @@
ds->ds_mbuf = NULL;
}
}
+ sc->sc_rx_prod = sc->sc_rx_cons = sc->sc_rx_cnt = 0;
}

/*
@@ -1213,6 +1164,15 @@
#undef EEPROM_WAIT_READY
}

+void
+epic_fill_rx_ring(struct epic_softc *sc)
+{
+ while(sc->sc_rx_cnt < EPIC_NRXDESC) {
+ if(epic_add_rxbuf(sc, sc->sc_rx_prod))
+ break;
+ }
+}
+
/*
* Add a receive buffer to the indicated descriptor.
*/
@@ -1223,23 +1183,14 @@
struct mbuf *m;
int error;

- MGETHDR(m, M_DONTWAIT, MT_DATA);
- if (m == NULL)
+ m = MCLGETI(NULL, M_DONTWAIT, &sc->sc_arpcom.ac_if, MCLBYTES);
+ if (!m)
return (ENOBUFS);
-
- MCLGET(m, M_DONTWAIT);
- if ((m->m_flags & M_EXT) == 0) {
- m_freem(m);
- return (ENOBUFS);
- }
-
- if (ds->ds_mbuf != NULL)
- bus_dmamap_unload(sc->sc_dmat, ds->ds_dmamap);
+ m->m_len = m->m_pkthdr.len = MCLBYTES;

ds->ds_mbuf = m;

- error = bus_dmamap_load(sc->sc_dmat, ds->ds_dmamap,
- m->m_ext.ext_buf, m->m_ext.ext_size, NULL,
+ error = bus_dmamap_load_mbuf(sc->sc_dmat, ds->ds_dmamap, m,
BUS_DMA_READ|BUS_DMA_NOWAIT);
if (error) {
printf("%s: can't load rx DMA map %d, error = %d\n",
@@ -1251,6 +1202,8 @@
ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_PREREAD);

EPIC_INIT_RXDESC(sc, idx);
+ sc->sc_rx_prod = EPIC_NEXTRX(sc->sc_rx_prod);
+ sc->sc_rx_cnt++;

return (0);
}
Index: smc83c170var.h
================================================== =================
RCS file: /root/src/sys/dev/ic/smc83c170var.h,v
retrieving revision 1.3
diff -u -r1.3 smc83c170var.h
--- smc83c170var.h 10 Aug 2009 20:29:54 -0000 1.3
+++ smc83c170var.h 21 Jul 2011 17:06:49 -0000
@@ -128,7 +128,9 @@
int sc_txdirty; /* first dirty TX descriptor */
int sc_txlast; /* last used TX descriptor */

- int sc_rxptr; /* next ready RX descriptor */
+ int sc_rx_cnt;
+ int sc_rx_prod;
+ int sc_rx_cons;

u_int sc_serinst; /* ifmedia instance for serial mode */
};
@@ -167,7 +169,6 @@
* so that the payload after the Ethernet header is aligned \
* to a 4 byte boundary. \
*/ \
- __m->m_data = __m->m_ext.ext_buf + 2; \
__rxd->er_bufaddr = __ds->ds_dmamap->dm_segs[0].ds_addr + 2; \
__rxd->er_control = RXCTL_BUFLENGTH(__m->m_ext.ext_size - 2); \
__rxd->er_rxstatus = ER_RXSTAT_OWNER; \
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
openBSD IPSEC gateway w/WINDOWS XP roadwarrior s2scott OpenBSD Security 7 13th January 2009 11:01 AM
openbsd hangs momentarily at boot bogd OpenBSD General 11 9th January 2009 02:53 PM
I386 ELF32 binary on AMD64 system can't find shared libraries Gemini FreeBSD General 0 9th December 2008 06:49 AM
FreeBSD hangs on boot Bubba_HoTep FreeBSD General 3 29th November 2008 10:25 PM
Allow i386 and amd64 to boot from extended DOS partitions lvlamb OpenBSD General 4 16th July 2008 03:24 PM


All times are GMT. The time now is 07:36 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick