Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jun 1996 19:41:23 +0900
From:      hosokawa@mt.cs.keio.ac.jp (HOSOKAWA Tatsumi)
To:        msmith@atrad.adelaide.edu.au
Cc:        hardware@FreeBSD.org, mobile@FreeBSD.org, hosokawa@mt.cs.keio.ac.jp
Subject:   Re: Laptop hardware FOUND
Message-ID:  <199606021041.TAA03106@frig.mt.cs.keio.ac.jp>
In-Reply-To: Your message of Sun, 2 Jun 1996 19:40:50 %2B0930 (CST). <199606021010.TAA27202@genesis.atrad.adelaide.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
>> Ok.  Please patch your apm.c sources so that the APM_DSVALUE_BUG
>> code uses apm_bios_work not apm_bioswork, and and M_DEVBUF not M_DEVBUG,
>> as otherwise it won't compile 8)

This typo has been fixed by our latest pccard package :-).

>> With APM_DEBUG, FORCE_APM10, APM_DSVALUE_BUG and APM_BROKEN_STATCLOCK,
>> now reads 'Data 0xf084d000'.  'apm' still causes a trap 12 at
>> 0x48:c43e with fva 0xfd45.
>> 
>> Next? 8)

I have no idea :-).

Trap 12 of 386 architecture is "stack fault".  This probably means
that intersegment call/return to APM BIOS or internal procedure of APM
BIOS causes stack overflow or underflow.

But I think that intersegment call/return (yes, I wrote it) is not
guilty because this is machine-independent operation, and the trap
happens at 0x48:c43e.

0x48 means that segment index is 0x9 and priv. level is zero.
Hmm... Index 0x9????  Index 0x9 is 16bit APM API segment. 32bit API
segment is 0x8.  Why?

Target of the APM driver is set at apm_addr in apm.c.  I believe that
apm_addr is set to 0x40:(sc->cs_entry) at apmattach(), but the trap
happens at 0x48:xxxx???

        apm_addr.segment = GSEL(GAPMCODE32_SEL, SEL_KPL);
        apm_addr.offset  = sc->cs_entry;


GAPMCODE32_SEL is 8 and SEL_KPL is 0, and GSEL is 

#define GSEL(s,r)       (((s)<<3) | r)                  /* a global selector */

(in machine/segments.h) so, GSEL(GAPMCODE32_SEL, SEL_KPL) should be
0x40....

I'm confused now.... (but it should not be the problem because probe
message says that the 16bit API address is same as the 32bit API
address.  In such case, APM is written in machine opecodes that do not
changes their behavior whether CPU is in 32bit mode or 16bit mode.)

--
	HOSOKAWA, Tatsumi              E-mail: hosokawa@mt.cs.keio.ac.jp
	  WWW homepage: http://www.mt.cs.keio.ac.jp/person/hosokawa.html
	Department of Computer Science, Keio University, Yokohama, Japan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606021041.TAA03106>