Re: Laptops (APM) & 0040 crashes

Stephen.Rothwell@canb.auug.org.au
Tue, 10 Feb 1998 09:33:16 +1100


Hi Pavel,

Pavel Machek <pavel@elf.ucw.cz> writes:
>
> Did you make sure that GDT is not overfilled? (I.e. 12+NUM_TASKS being
> more than you can fit in GDT?)

No, but it used to be 11+NUM_TASKS*2 when APM was enabled, and an even number
of entries will fit in the GDT, so this does not introduce a new problem.
The GDT will hold a total of 8196 entries which means that NUM_TASKS must be
less than or equal to 4092.

> > What I should have said is that M$ and Intel have made up another
> > standard for power management. APM is still used by everyone,
> > but ACPI(?) is on the horizon.
>
> ACPI is not as broken as names of its creators would suggest.

I don't know, I haven't even looked.

> > + /*
> > + * Set up a segment that references the real mode segment 0x40
> > + * that extends up to the end of page zero (that we have reserved).
> > + * This is for buggy BIOS's that refer to (real mode) segment 0x40
> > + * even though they are called in protected mode.
> > + */
> > + set_base(gdt[APM_40 >> 3],
> > + 0xc0000000 + ((unsigned long)0x40 << 4));
> > + set_limit(gdt[APM_40 >> 3], 4096 - (0x40 << 4));
>
> NIce. It might be nice to do this only iff certain config option
> (CONFIG_I_PROMISE_I_WILL_NOT_BUY_NOTEBUG_WITH_BROKEN_BIOS_AGAIN), so
> that users are aware of problem and so there is still light pressure
> to manufacturers to fix their code.

Thanks - I actually did this here (rather than hardcoding it in the GDT
because I couldn't remember the format of a GDT entry :-). I thought
about catching the first trap and checking there if it was caused by
an access to segment 0x40 from the APM code segments, but it was too
hard for a simple fix. Feel free to extend thie patch ...

> Also, 2.1.X patch might be nice: this is not likely to be adopted in
> 2.0.X, but IMO it could well go into 2.1.86 [Well- if it works. Did it
> actually help somebody so far?]

I don't run 2.1 yet and am not sure of the memory management cahnges.
Again if anyone knows how, please port this.

I have had no positive responses yet.

Cheers,
Stephen

--
Stephen Rothwell                    Stephen.Rothwell@canb.auug.org.au
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu