public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [Patch] DSDT in initrd v0.2
@ 2003-05-08 10:11 Breathnach, Proinnsias (Dublin)
  0 siblings, 0 replies; 7+ messages in thread
From: Breathnach, Proinnsias (Dublin) @ 2003-05-08 10:11 UTC (permalink / raw)
  To: 'Markus Gaugusch'; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> ----Original Message-----
> On May 8, Breathnach, Proinnsias (Dublin) <breatpro-Lp/cVzEoVybn/p8AFm7ortBPR1lH4CV8@public.gmane.org>
> wrote:
> > Markus,
> > Does any of this make sense ?
> I think that the initrd only contains the most necessary things, e.g. not
> dsdt's for 1000 different models, but only for the one PC that needs it.
> 
	<snip>

> The initrd is also usually rebuilt for each machine after installation,
> containing only the required drivers for the current machine and nothing
> more. Same with the DSDT, it would just be appended to the just-created
> initrd.
Both valid points ... I think that it's fair to say that if the machine is
going to have a DSDT appended, it'll be done at initrd re-generation time
...

P



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Patch] DSDT in initrd v0.2
@ 2003-05-06 12:51 Markus Gaugusch
       [not found] ` <Pine.LNX.4.53.0305061444120.1274-qopfHk9/S+VQK2oVCIMtW7NldLUNz+W/@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Markus Gaugusch @ 2003-05-06 12:51 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: TEXT/PLAIN, Size: 490 bytes --]

* Fixed: don't scan beyond end of initrd
* printk output fixed
* Feature: Get DSDT from initrd without signature, if it starts with
  "DSDT". This way one can just copy the DSDT.aml file and use it as
  initrd

The patch is against 2.4.21-rc1+latest ACPI, please reverse the old patch
if you used it.

Markus
-- 
__________________    /"\
Markus Gaugusch       \ /    ASCII Ribbon Campaign
markus-z+rTbpWsRgbk7+2FdBfRIA@public.gmane.org     X     Against HTML Mail
                      / \

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3037 bytes --]

--- linux.orig/drivers/acpi/osl.c	2003-05-05 18:00:25.000000000 +0200
+++ linux/drivers/acpi/osl.c	2003-05-06 13:51:06.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,57 @@
 	return AE_OK;
 }
 
+
+#ifdef CONFIG_ACPI_INITRD
+
+unsigned char* get_dsdt_from_initrd(unsigned char *start, unsigned char *end)
+{
+	unsigned char *data;
+	unsigned char signature[] = "INITRDDSDT123DSDT123";
+
+	if (start == NULL)
+		return NULL;
+	printk(KERN_INFO "Looking for DSDT in initrd ...");
+	if (!memcmp(signature+6, start, 4)) {
+		printk(" found at beginning!\n");
+		return start;
+	}
+	end-=sizeof(signature)+1; /* don't scan above end */
+	for (data=start; data < end ; ++data) {
+		if (!memcmp(data, signature, sizeof(signature)-1)) {
+			printk(" found (at offset %u)!\n", data+sizeof(signature)-start);
+			return data+sizeof(signature);
+		}
+	}
+	printk(" not found!\n");
+
+	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] 7+ messages in thread

end of thread, other threads:[~2003-05-08 21:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <A3C83F41488BD61195C3000802252FC135C3A8@dubim07742.ie.ml.com>
     [not found] ` <A3C83F41488BD61195C3000802252FC135C3A8-SI4JNLCqwGbcq19Bq1crS1aTQe2KTcn/@public.gmane.org>
2003-05-08 10:02   ` [Patch] DSDT in initrd v0.2 Markus Gaugusch
2003-05-08 12:11     ` Derek Broughton
2003-05-08 10:11 Breathnach, Proinnsias (Dublin)
  -- strict thread matches above, loose matches on Subject: below --
2003-05-06 12:51 Markus Gaugusch
     [not found] ` <Pine.LNX.4.53.0305061444120.1274-qopfHk9/S+VQK2oVCIMtW7NldLUNz+W/@public.gmane.org>
2003-05-06 17:56   ` Gunter Ohrner
     [not found]     ` <200305061957.00037-GfAVBl5OxjxchHfdsNF8vBvVK+yQ3ZXh@public.gmane.org>
2003-05-07  9:44       ` Markus Gaugusch
2003-05-08 21:24   ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox