* [Patch] DSDT in initrd
@ 2003-05-05 20:48 Markus Gaugusch
[not found] ` <Pine.LNX.4.53.0305052221420.8540-qopfHk9/S+VQK2oVCIMtW7NldLUNz+W/@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Markus Gaugusch @ 2003-05-05 20:48 UTC (permalink / raw)
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1262 bytes --]
Hi,
I've implemented my patch to put the DSDT into the initial ramdisk.
It uses the same approach as bootsplash: just use the raw initrd data.
A "magic" signature ("INITRDDSDT123DSDT123") seperates the normal initrd
content from the DSDT. To use it, apply my patch (it's against 2.4.21-rc1
+ acpi-20030424) and do the following:
1.) enable CONFIG_BLK_DEV_INITRD and CONFIG_ACPI_INITRD
2.) recompile
3.) Create the initrd (or modify an existing)
echo "INITRDDSDT123DSDT123" >> /boot/initrd.dsdt
cat DSDT.aml >> /boot/initrd.dsdt
If you don't have an initrd yet, don't worry. Just perform the steps
above and everything will be fine. Don't forget to update your bootloader
(lilo needs this, grub not).
Then reboot.
The message "Looking for DSDT in initrd... found!" should be in your dmesg
after next boot. (for some reason <6> is before "found", but I'm sure
that someone will be able to give me the right pointers to fix that).
This is my first kernel patch, please be gentle :)
But I would really appreciate, if it was applied to official ACPI.
kind regards
Markus Gaugusch
--
__________________ /"\
Markus Gaugusch \ / ASCII Ribbon Campaign
markus-z+rTbpWsRgbk7+2FdBfRIA@public.gmane.org X Against HTML Mail
/ \
[-- Attachment #2: Type: TEXT/PLAIN, Size: 2849 bytes --]
--- linux.orig/drivers/acpi/osl.c 2003-05-05 18:00:25.000000000 +0200
+++ linux/drivers/acpi/osl.c 2003-05-05 21:59:19.000000000 +0200
@@ -33,6 +33,10 @@
#include <linux/interrupt.h>
#include <linux/kmod.h>
#include <linux/delay.h>
+#ifdef CONFIG_ACPI_INITRD
+#include <linux/init.h>
+#include <linux/vmalloc.h>
+#endif
#include <asm/io.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi.h>
@@ -222,14 +226,52 @@
return AE_OK;
}
+
+#ifdef CONFIG_ACPI_INITRD
+unsigned char signature[] = "INITRDDSDT123DSDT123";
+
+unsigned char* get_dsdt_from_initrd(unsigned char *start, unsigned char *end)
+{
+ unsigned char *data;
+
+ if (start == NULL)
+ return NULL;
+ printk(KERN_INFO "Looking for DSDT in initrd ...");
+ for (data=start; data < end ; ++data) {
+ if (!memcmp(data, signature, sizeof(signature)-1)) {
+ printk(KERN_INFO " found!");
+ return data+sizeof(signature);
+ }
+ }
+ printk(KERN_INFO " not found!");
+
+ return NULL;
+}
+#endif
+
acpi_status
acpi_os_table_override (struct acpi_table_header *existing_table,
struct acpi_table_header **new_table)
{
+#ifdef CONFIG_ACPI_INITRD
+ extern unsigned long initrd_start, initrd_end;
+ unsigned char* new_dsdt=NULL;
+
+#endif
if (!existing_table || !new_table)
return AE_BAD_PARAMETER;
+#ifdef CONFIG_ACPI_INITRD
+ if (strncmp(existing_table->signature, "DSDT", 4) == 0 &&
+ (new_dsdt=get_dsdt_from_initrd((unsigned char*)initrd_start,
+ (unsigned char*)initrd_end)) != NULL)
+ *new_table = (struct acpi_table_header*)new_dsdt;
+ else
+ *new_table = NULL;
+#else
*new_table = NULL;
+#endif
+
return AE_OK;
}
--- linux.orig/drivers/acpi/Config.in 2003-05-05 18:44:41.000000000 +0200
+++ linux/drivers/acpi/Config.in 2003-05-05 20:19:06.000000000 +0200
@@ -12,6 +12,10 @@
bool 'CPU Enumeration Only' CONFIG_ACPI_HT_ONLY
fi
+ if [ "$CONFIG_BLK_DEV_INITRD" = "y" ]; then
+ bool 'Read DSDT from initrd' CONFIG_ACPI_INITRD
+ fi
+
if [ "$CONFIG_ACPI_HT_ONLY" = "y" ]; then
define_bool CONFIG_ACPI_BOOT y
else
--- linux.orig/Documentation/Configure.help 2003-05-05 19:51:09.000000000 +0200
+++ linux/Documentation/Configure.help 2003-05-05 20:18:56.000000000 +0200
@@ -18602,6 +18602,13 @@
handles PnP messages. All ACPI devices use its services, so using
them requires saying Y here.
+ACPI DSDT in initrd
+CONFIG_ACPI_INITRD
+ The DSDT (Differentiated System Description Table) often needs to be
+ overridden because of a broken BIOS implementation. If you want to put
+ the overriden DSDT into the initrd, see http://gaugusch.at/kernel.shtml
+ for more info. If unsure, say N here.
+
ACPI System Driver
CONFIG_ACPI_SYS
This driver will enable your system to shut down using ACPI, and
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Patch] DSDT in initrd
[not found] ` <Pine.LNX.4.53.0305052221420.8540-qopfHk9/S+VQK2oVCIMtW7NldLUNz+W/@public.gmane.org>
@ 2003-05-06 10:09 ` Sebastian Henschel
0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Henschel @ 2003-05-06 10:09 UTC (permalink / raw)
To: Markus Gaugusch; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]
hi markus...
Received at 2003-05-06 / 09:02 by Markus Gaugusch:
> I've implemented my patch to put the DSDT into the initial ramdisk.
> It uses the same approach as bootsplash: just use the raw initrd data.
hey, it seems to work here. my ac_adapter is back with my custom DSDT
from the initrd. :) thank you very much.
> 1.) enable CONFIG_BLK_DEV_INITRD and CONFIG_ACPI_INITRD
perhaps you should also say that the ramdisk support has to be
included statically (CONFIG_BLK_DEV_RAM=y). i had it as a module and was
looking for these options to no avail. :)
> Then reboot.
> The message "Looking for DSDT in initrd... found!" should be in your dmesg
> after next boot. (for some reason <6> is before "found", but I'm sure
> that someone will be able to give me the right pointers to fix that).
i do not know much about printk, but possibly, KERN_INFO (<6>) is only
parsed when it is at the beginning of a line. so your "found" or "not
found" statements would also be printed out with KERN_INFO as subsequent
calls of printk without a newline, although the do not start with
KERN_INFO. just a wild guess. :)
cheers,
sebastian
--
::: sebastian henschel
::: kodeaffe
::: lynx -source http://www.kodeaffe.de/shensche.pub | gpg --import
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-05-06 10:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-05 20:48 [Patch] DSDT in initrd Markus Gaugusch
[not found] ` <Pine.LNX.4.53.0305052221420.8540-qopfHk9/S+VQK2oVCIMtW7NldLUNz+W/@public.gmane.org>
2003-05-06 10:09 ` Sebastian Henschel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox