2002-12-03 05:47:24

by Hiroshi Miura

[permalink] [raw]
Subject: [PATCH] 2.5.50 apm.c better printk messages about workaround.

Hello,

I post patch about work around for a broken bios.
Pavel comments and i think it is reasonable and better.

this patch fix printk message in 2.5.50.

--- linux-2.5.50/arch/i386/kernel/apm.c 2002-12-03 07:59:30.000000000 +0900
+++ linux-2.5.50-geode/arch/i386/kernel/apm.c 2002-12-03 14:04:11.000000000 +0900
@@ -2054,12 +2054,14 @@
_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)
+ if (apm_info.bios.cseg_len <= apm_info.bios.offset) {
_set_limit((char *)&cpu_gdt_table[i][APM_CS >> 3], 64 * 1024 -1);
- if (apm_info.bios.dseg_len <= 0x40) { /* 0x40 * 4kB == 64kB */
+ 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");
+ printk(KERN_WARNING "apm: broken bios -- assuming granularity 1 on dseg");
}
}
#endif


--
Hiroshi Miura --- http://www.da-cha.org/
NTTDATA Corp. Marketing & Business Strategy Planning Dept. --- [email protected]
Key fingerprint = 9117 9407 5684 FBF1 4063 15B4 401D D077 04AB 8617
-- My hacking life is happy as the day is long


2002-12-05 04:14:04

by Hiroshi Miura

[permalink] [raw]
Subject: Re: [PATCH] 2.5.50 apm.c better printk messages about workaround.

Sorry,
I mistake in my patch.
I add '\n' now.

> I post patch about work around for a broken bios.
> Pavel comments and i think it is reasonable and better.
>
> this patch fix printk message in 2.5.50.

--- linux-2.5.50/arch/i386/kernel/apm.c 2002-12-03 07:59:30.000000000 +0900
+++ linux-2.5.50-geode/arch/i386/kernel/apm.c 2002-12-03 14:04:11.000000000 +0900
@@ -2054,12 +2054,14 @@
_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)
+ if (apm_info.bios.cseg_len <= apm_info.bios.offset) {
_set_limit((char *)&cpu_gdt_table[i][APM_CS >> 3], 64 * 1024 -1);
- if (apm_info.bios.dseg_len <= 0x40) { /* 0x40 * 4kB == 64kB */
+ printk(KERN_WARNING "apm: broken bios -- code segment too short, assuming 64k.\n");
+ }
+ 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");
+ printk(KERN_WARNING "apm: broken bios -- assuming granularity 1 on dseg.\n");
}
}
#endif


--
Hiroshi Miura --- http://www.da-cha.org/
NTTDATA Corp. Marketing & Business Strategy Planning Dept. --- [email protected]
Key fingerprint = 9117 9407 5684 FBF1 4063 15B4 401D D077 04AB 8617
-- My hacking life is happy as the day is long