Bug 5140 - very early kernel panic (bios32 detection) on some Compaq Prolinea
Summary: very early kernel panic (bios32 detection) on some Compaq Prolinea
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: msmith
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1997-11-24 20:20 UTC by Joel Faedi
Modified: 1998-01-01 13:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Faedi 1997-11-24 20:20:00 UTC
On Compaq Prolinea with Pentium CPU (Prolinea 575/590/5133/5150, I have
only these models), all kernels will panic. The problem is due to due
to a call at "bios32_SDCI" address. This addess is given bios_sigsearch
function in bios.c (see fix) after a cast in bios32_SDheader structure
and on Compaq Prolinea, this value is too big (perhaps coded diffently).

Fix: 

Fix bios32_init function in /usr/src/sys/i386/i386/bios.c: very value of
sdh->entry, I think in should be less than BIOS max address:

	/* get a virtual pointer to the structure */
	sdh = (struct bios32_SDheader *)BIOS_PADDRTOVADDR(sigaddr);
	for (cv = (u_int8_t *)sdh, ck = 0, i = 0; i < (sdh->len * 16); i++) {
	    ck += cv[i];
	}
	/* If checksum is OK, enable use of the entrypoint */
	if (ck == 0 && sdh->entry < (BIOS_START + BIOS_SIZE)) { <<<<-
	    bios32_SDCI = (caddr_t)BIOS_PADDRTOVADDR(sdh->entry);
How-To-Repeat: Boot 3.0-971123-SNAP (or some more older versions) from boot floppy,
kernel will panic very quickly.
Comment 1 msmith freebsd_committer freebsd_triage 1998-01-01 13:27:11 UTC
State Changed
From-To: open->closed

Suggested range check implemented. 


Comment 2 msmith freebsd_committer freebsd_triage 1998-01-01 13:27:11 UTC
Responsible Changed
From-To: freebsd-bugs->msmith

My code.