public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Overriding DSDT Tables with external files - 2 Methods
@ 2002-09-05 18:57 John M Trostel
       [not found] ` <1031252226.3011.76.camel-gH4hS+xkl8U@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: John M Trostel @ 2002-09-05 18:57 UTC (permalink / raw)
  To: ACPI-list

There seem to be 2 closely related methods of overriding the DSDT in a
BIOS with your own files.

My question is... Do they both work? If they do both work, is one
prefered over the other?

***********************************
Method 1 (from http://www.cpqlinux.com/acpi-howto.html and others)

1. get the dsdt.hex file

2. cp -a dsdt.hex to drivers/acpi/tables/acpi_dsdt.c

3. apply  the following patch

--- linux/drivers/acpi/osl.c    Sat Jul 13 16:16:25 2002
+++ linux-2.4.18-xfs-acpi/drivers/acpi/osl.c    Sat Jul 13 14:33:09 2002
@@ -70,6 +70,7 @@
 static OSD_HANDLER acpi_irq_handler = NULL;
 static void *acpi_irq_context = NULL;

+extern unsigned char AmlCode[];

 acpi_status
 acpi_os_initialize(void)
@@ -221,7 +222,10 @@
        if (!existing_table || !new_table)
                return AE_BAD_PARAMETER;

-       *new_table = NULL;
+       if (strncmp(existing_table->signature, "DSDT", 4) == 0)
+               *new_table = (acpi_table_header*)AmlCode;
+       else
+               *new_table = NULL;
        return AE_OK;
 }


***********************************
Method 2 (from Christophe Boyanique) :

1. get the dsdt.hex file

2. copy that file into drivers/acpi

3. patch drivers/acpi/osl.c as follows:

diff -urP drivers/acpi/osl.c /usr/src/linux/drivers/acpi/osl.c
 --- drivers/acpi/osl.c  Mon Jul 29 23:30:42 2002
 +++ /usr/src/linux/drivers/acpi/osl.c   Sat Jul 27 18:32:34 2002
 @@ -71,6 +71,9 @@
  static void *acpi_irq_context = NULL;
 
 
 +#include "dsdt.hex"
 +acpi_table_header *myDST = (acpi_table_header *) AmlCode;
 +
  acpi_status
  acpi_os_initialize(void)
  {
 @@ -221,7 +224,10 @@
         if (!existing_table || !new_table)
                 return AE_BAD_PARAMETER;
 
 -       *new_table = NULL;
 +       if (!strncmp(existing_table->signature, DSDT_SIG, 4))
 +               *new_table = myDST;
 +       else
 +               *new_table = NULL;
         return AE_OK;
  }


-- 
John M. Trostel
Senior Software Engineer
Quantum Corp.
john.trostel-+vhbC7un7QRBDgjK7y7TUQ@public.gmane.org



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Overriding DSDT Tables with external files - 2 Methods
       [not found] ` <1031252226.3011.76.camel-gH4hS+xkl8U@public.gmane.org>
@ 2002-09-06  5:46   ` Sérgio Monteiro Basto
       [not found]     ` <1031291181.3918.12.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Sérgio Monteiro Basto @ 2002-09-06  5:46 UTC (permalink / raw)
  To: John M Trostel; +Cc: ACPI-list

I prefer the method 1 because with gcc of RedHat doesn't include .hex
files 

On Thu, 2002-09-05 at 14:57, John M Trostel wrote:
> There seem to be 2 closely related methods of overriding the DSDT in a
> BIOS with your own files.
> 
> My question is... Do they both work? If they do both work, is one
> prefered over the other?
> 
> ***********************************
> Method 1 (from http://www.cpqlinux.com/acpi-howto.html and others)
> 
> 1. get the dsdt.hex file
> 
> 2. cp -a dsdt.hex to drivers/acpi/tables/acpi_dsdt.c
> 
> 3. apply  the following patch
> 
> --- linux/drivers/acpi/osl.c    Sat Jul 13 16:16:25 2002
> +++ linux-2.4.18-xfs-acpi/drivers/acpi/osl.c    Sat Jul 13 14:33:09 2002
> @@ -70,6 +70,7 @@
>  static OSD_HANDLER acpi_irq_handler = NULL;
>  static void *acpi_irq_context = NULL;
> 
> +extern unsigned char AmlCode[];
> 
>  acpi_status
>  acpi_os_initialize(void)
> @@ -221,7 +222,10 @@
>         if (!existing_table || !new_table)
>                 return AE_BAD_PARAMETER;
> 
> -       *new_table = NULL;
> +       if (strncmp(existing_table->signature, "DSDT", 4) == 0)
> +               *new_table = (acpi_table_header*)AmlCode;
> +       else
> +               *new_table = NULL;
>         return AE_OK;
>  }
> 
> 
> ***********************************
> Method 2 (from Christophe Boyanique) :
> 
> 1. get the dsdt.hex file
> 
> 2. copy that file into drivers/acpi
> 
> 3. patch drivers/acpi/osl.c as follows:
> 
> diff -urP drivers/acpi/osl.c /usr/src/linux/drivers/acpi/osl.c
>  --- drivers/acpi/osl.c  Mon Jul 29 23:30:42 2002
>  +++ /usr/src/linux/drivers/acpi/osl.c   Sat Jul 27 18:32:34 2002
>  @@ -71,6 +71,9 @@
>   static void *acpi_irq_context = NULL;
>  
>  
>  +#include "dsdt.hex"
>  +acpi_table_header *myDST = (acpi_table_header *) AmlCode;
>  +
>   acpi_status
>   acpi_os_initialize(void)
>   {
>  @@ -221,7 +224,10 @@
>          if (!existing_table || !new_table)
>                  return AE_BAD_PARAMETER;
>  
>  -       *new_table = NULL;
>  +       if (!strncmp(existing_table->signature, DSDT_SIG, 4))
>  +               *new_table = myDST;
>  +       else
>  +               *new_table = NULL;
>          return AE_OK;
>   }
> 
> 
> -- 
> John M. Trostel
> Senior Software Engineer
> Quantum Corp.
> john.trostel-+vhbC7un7QRBDgjK7y7TUQ@public.gmane.org
> 




-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Overriding DSDT Tables with external files - 2 Methods
       [not found]     ` <1031291181.3918.12.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
@ 2002-09-06 14:02       ` John M Trostel
  0 siblings, 0 replies; 3+ messages in thread
From: John M Trostel @ 2002-09-06 14:02 UTC (permalink / raw)
  To: Sérgio Monteiro Basto; +Cc: ACPI-list

And method #1 was the one I ended up using.  And it works :-)

Thanks to all who made suggestions, I appreciate the help.

On Fri, 2002-09-06 at 01:46, Sérgio Monteiro Basto wrote:
> I prefer the method 1 because with gcc of RedHat doesn't include .hex
> files 
> 
> On Thu, 2002-09-05 at 14:57, John M Trostel wrote:
> > There seem to be 2 closely related methods of overriding the DSDT in a
> > BIOS with your own files.
> > 
> > My question is... Do they both work? If they do both work, is one
> > prefered over the other?
> > 
> > ***********************************
> > Method 1 (from http://www.cpqlinux.com/acpi-howto.html and others)
> > 
> > 1. get the dsdt.hex file
> > 
> > 2. cp -a dsdt.hex to drivers/acpi/tables/acpi_dsdt.c
> > 
> > 3. apply  the following patch
> > 
> > --- linux/drivers/acpi/osl.c    Sat Jul 13 16:16:25 2002
> > +++ linux-2.4.18-xfs-acpi/drivers/acpi/osl.c    Sat Jul 13 14:33:09 2002
> > @@ -70,6 +70,7 @@
> >  static OSD_HANDLER acpi_irq_handler = NULL;
> >  static void *acpi_irq_context = NULL;
> > 
> > +extern unsigned char AmlCode[];
> > 
> >  acpi_status
> >  acpi_os_initialize(void)
> > @@ -221,7 +222,10 @@
> >         if (!existing_table || !new_table)
> >                 return AE_BAD_PARAMETER;
> > 
> > -       *new_table = NULL;
> > +       if (strncmp(existing_table->signature, "DSDT", 4) == 0)
> > +               *new_table = (acpi_table_header*)AmlCode;
> > +       else
> > +               *new_table = NULL;
> >         return AE_OK;
> >  }
> > 
> > 

-- 
John M. Trostel
Senior Software Engineer
Quantum Corp.
john.trostel-+vhbC7un7QRBDgjK7y7TUQ@public.gmane.org



-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-09-06 14:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-05 18:57 Overriding DSDT Tables with external files - 2 Methods John M Trostel
     [not found] ` <1031252226.3011.76.camel-gH4hS+xkl8U@public.gmane.org>
2002-09-06  5:46   ` Sérgio Monteiro Basto
     [not found]     ` <1031291181.3918.12.camel-4/PLUo9XfK/yXfm4dIG/yWZHpeb/A1Y/@public.gmane.org>
2002-09-06 14:02       ` John M Trostel

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