mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Hiroshi Miura <miura@da-cha.org>
Cc: sfr@canb.auug.org.au, linux-kernel@vger.kernel.org
Subject: Re: APM work around for bad bios.
Date: Mon, 21 Oct 2002 11:08:20 +0200	[thread overview]
Message-ID: <20021021090819.GA2876@elf.ucw.cz> (raw)
In-Reply-To: <20021017172155.BCA3F11782A@triton2>

Hi!

> I use CASIO CASSIOPEIA FIVA 101 and 103. (http://www.da-cha.org/fiva/fiva.html)
> this use Cyrix MediaGX and Award BIOS.
> This APM BIOS report broken value for dseg_len.
> it asumes granularity is 1.
> 
> I made a work around for this situation.
> 
>   *  if (cseg_len < bios.offset) BIOS report BAD len value.
>      -- segment length must be always larger than code offset
> 
>   *  if (dseg_len <= 0x40 ) BIOS asumes granularity =1.
>      -- 0x40 * 4kB = 64kB, my pc reports 0x40.
> 
> 
> diff -urB -x .config -x '*.[oasS]' -x '*.in' -x '*.rej' -x '*.orig' linux-2.5.43-orig/arch/i386/kernel/apm.c linux-2.5.43/arch/i386/kernel/apm.c
> --- linux-2.5.43-orig/arch/i386/kernel/apm.c	2002-10-12 13:21:05.000000000 +0900
> +++ linux-2.5.43/arch/i386/kernel/apm.c	2002-10-14 21:36:14.000000000 +0900
> @@ -1980,6 +2141,14 @@
>  				(apm_info.bios.cseg_16_len - 1) & 0xffff);
>  			_set_limit((char *)&cpu_gdt_table[i][APM_DS >> 3],
>  				(apm_info.bios.dseg_len - 1) & 0xffff);
> +		      /* workaround for broken BIOSes */
> +	                if (apm_info.bios.cseg_len <= apm_info.bios.offset)
> +        	                _set_limit((char *)&cpu_gdt_table[i][APM_CS >> 3], 64 * 1024 -1);

Maybe add printk KERN_WARNING "apm: broken bios -- code segment too
short, assuming 64k"

> +                       if (apm_info.bios.dseg_len <= 0x40) { /* 0x40 * 4kB == 64kB */
> +                        	/* for the BIOS that assumes granularity = 1 */
> +                        	cpu_gdt_table[i][APM_DS >> 3].b |= 0x800000;
> +                        	printk(KERN_NOTICE "apm: we set the
> granularity of dseg.\n");

Maybe better KERN_WARNING "apm: broken bios -- assuming granularity 1
on dseg"
										Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

      reply	other threads:[~2002-10-26 10:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-17 17:21 Hiroshi Miura
2002-10-21  9:08 ` Pavel Machek [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021021090819.GA2876@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miura@da-cha.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome