Skip to contentSkip to conversation

disasm/compile doesn't work

DISCUSSION Bob Lees 3 participants 4 messages Oct 14, 2002 – Oct 15, 2002 2 messages not in the archive ACPI

lore
Share & tools
lore

Bob Lees

author
#0 lore raw

Hi

This may have been asked/aired before, in which case I apologise. However here goes.

I have sort of successfully disassembled/decompiled the dsdt from my evo 800c,
using both pacpidump and iasl. They both produce the same outcome. By
"sort of" I mean that I cannot disassemble and immdeiately recompile without errors. Some of them are basic to the compaq dsdt in that it references *PNP???? rather than PNP????. That is easy to fix. The other problem is that objects are disassembed which have no definition. This is much harder as it is not clear how these undefined objects should be defined. Is this a common problem and does a reasonable fix exist? and if so help!

For the present I have commented out the offending references, but this means that I have no fan control!! which may not be good in the long term:)

Regards

Bob

Signature · 12 lines
Bob Lees
Diamond Consulting Services Ltd
Aylesbury, Bucks, HP17 8UG
Phone: +44 (0) 1296 747667
Fax: +44 (0) 1296 747557
email: bob-l+PWtdWbHAsG2Il/[email protected]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
#2 lore raw

Re: new n800v dsdt successfully disassembled, patched and installed (WAS: disasm/compile doesn't work)

In reply to a message not in the archive

Hi Bob,

I've been playing with ACPI over the last week or so with my Compaq Evo N800v which is very similar to your N800c (in fact, the compaq website seems to only differentiate them by maximum processor speed, max hdd and screen type... http://www.compaq.com/products/notebooks/index.html)

With some help from this group (and that email you wrote earlier), I've successfully disassembled and tweaked my dsdt. I now have battery status (which was my goal), but haven't mucked around with the other aspects of ACPI (fan, processor speed etc).

The details of what I did to make it work:

1) 2.4.19 patched to 2.4.20pre8

2) applied acpi-20021002 2.4.20pre8 patch from
http://sourceforge.net/projects/acpi (direct download link is
http://prdownloads.sourceforge.net/acpi/acpi-20021002-2.4.20-pre8.diff.gz?download)

3) downloaded the iasl release from intel's site at
http://developer.intel.com/technology/iapc/acpi/ with the direct download link being
http://developer.intel.com/technology/iapc/acpi/downloads/iasl-linux-20021002.tar.gz

4) disassembled my dsdt by:

a) copying /proc/acpi/dsdt to a local file (dsdt.raw)
b) running "iasl -d dsdt.raw" (this gives you the dsdt.dsl file you tweak
below)

5) Tweaked the dsl file by doing the following:

a) removed all "*" characters from the object names
b) added external declarations for all missing objects
c) commented out the alias line which complained about the missing link
d) changed the store line which referenced the above alias line to use the
fully qualified path (I did try using the fqp on the alias, but no joy)
e) changed the references from C11C to BAT1 and C11B to BAT2

6) Recompiled my dsdt with "iasl -tc -p new dsdt.dsl" to give me new.hex which is a C formatted representation of the compiled dsl (I ignored the two warnings).

7) Copied new.hex to drivers/acpi/tables/compaq_evo_n800v.h under my kernel source tree.

8) Edited drivers/acpi/tables/tbgetall.c as follows:

a) Included the new dsdt header
b) Declared and set new ACPI_POINTER to hold a physical address rather than
the logical so I could pass it to acpi_tb_get_secondary_table()
c) Changed the call to acpi_tb_get_secondary_table() to use the new dsdt

9) Configured the kernel with Power Management and all ACPI (except toshiba) options selected. Screen shots included in tarball mentioned below.

10) Rebuilt the kernel, crossed my fingers and jumped around for joy when I can now do:

[pritchma@seth:pritchma]$ uname -a
Linux seth.modus.com.au 2.4.20-pre8 #10 Mon Oct 14 14:39:22 EST 2002 i686 
unknown
[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/info
present:                 yes
design capacity:         4179 mAh
last full capacity:      4179 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 418 mAh
design capacity low:     0 mAh
capacity granularity 1:  100 mAh
capacity granularity 2:  100 mAh
model number:            Primary
serial number:           3
battery type:            4E4F494C
OEM info:                 COMPAQ
[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/state
present:                 yes
capacity state:          ok
charging state:          unknown
present rate:            0 mA
remaining capacity:      4179 mAh
present voltage:         16615 mV

Pull out the power:

[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            1400 mA
remaining capacity:      4179 mAh
present voltage:         16296 mV

Looks good to me.

I've uploaded a tarball to
http://www.modus.com.au/scratch/compaq_n800v_acpi.tar.bz2

It contains:

* my original, changed and a diff of the disassembled dsdt
* my original, changed and a diff of tbgetall.c
* two screenshots of the kernel options I used

Now for the disclaimer :) I knew nothing about ACPI a week ago, and mucked around with this until it worked. The above may be everything you need to know, or not...but I do hope it sorts your problem out.

I'm now off to work out why kacpi and akpi both hang at startup...or write my own battery monitor!

Cheers

Mark Pritchard

Quoted 15 lines · Bob Lees

Hi

This may have been asked/aired before, in which case I apologise. However here goes.

I have sort of successfully disassembled/decompiled the dsdt from my evo 800c, using both pacpidump and iasl. They both produce the same outcome. By "sort of" I mean that I cannot disassemble and immdeiately recompile without errors. Some of them are basic to the compaq dsdt in that it references *PNP???? rather than PNP????. That is easy to fix. The other problem is that objects are disassembed which have no definition. This is much harder as it is not clear how these undefined objects should be defined. Is this a common problem and does a reasonable fix exist? and if so help!

Quoted 6 lines

For the present I have commented out the offending references, but this means that I have no fan control!! which may not be good in the long term:)

Regards

Bob

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#5 lore raw
In reply to a message not in the archive
Quoted 9 lines · Bob Lees

Hi

This may have been asked/aired before, in which case I apologise. However here goes.

I have sort of successfully disassembled/decompiled the dsdt from my evo 800c,
using both pacpidump and iasl. They both produce the same outcome. By
"sort of" I mean that I cannot disassemble and immdeiately recompile without errors. Some of them are basic to the compaq dsdt in that it references

It is the expected behaviour, I guess. Or you didn't have to fix your DSDT :))

Quoted 5 lines

*PNP???? rather than PNP????. That is easy to fix. The other problem is that objects are disassembed which have no definition. This is much harder as it is not clear how these undefined objects should be defined. Is this a common problem and does a reasonable fix exist? and if so help!

Most of the time, it is a Scope() issue. Try to see if you have something like Scope(_SB) in the middle, then replace by Scope(\_SB).

Of course, this is only a 'most of the time' statement...

Signature · 9 lines
Ducrot Bruno
http://www.poupinou.org        Page profaissionelle
http://toto.tu-me-saoules.com  Haume page


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
author
#4 lore raw

Re: new n800v dsdt successfully disassembled, patched and installed (WAS: disasm/compile doesn't work)

In reply to a message not in the archive

Hi Mark

Thanks for the response. I think the 800c, 800v and presario 2800 series are all the same in this area. It was the external definitions which I was missing. I now have fan control working - yea!

I also have akpi monitoring the battery and ac state. It needed some changes to the makefile to get it made, I was using akpi-0.3.2.

I still have to figure out how I broke processor performance. Working on this. I have changed a number of the C??? referernces to the correct device, eg FAN1 etc. This isn't complete yet.

When the new table is loaded I get a number of errors, which I am still trying to track down. eg
evrgnini-0243: *** Error: Could not install Pci_config handler for PCI0, AE_ALREADY_EXISTS
where PCI0 is C03C in your version
and
dsopcode-0497 [19] Ds_init_buffer_field : Field size 1184 exceeds Buffer siz e 1088 (bits)
psparse-1155: *** Error: Method execution failed, AE_AML_BUFFER_LIMIT

Have you seen anything like this?

Regards

Bob

Quoted 143 lines · Mark Pritchard

Hi Bob,

I've been playing with ACPI over the last week or so with my Compaq Evo N800v which is very similar to your N800c (in fact, the compaq website seems to only differentiate them by maximum processor speed, max hdd and screen type... http://www.compaq.com/products/notebooks/index.html)

With some help from this group (and that email you wrote earlier), I've successfully disassembled and tweaked my dsdt. I now have battery status (which was my goal), but haven't mucked around with the other aspects of ACPI (fan, processor speed etc).

The details of what I did to make it work:

1) 2.4.19 patched to 2.4.20pre8

2) applied acpi-20021002 2.4.20pre8 patch from
http://sourceforge.net/projects/acpi (direct download link is
http://prdownloads.sourceforge.net/acpi/acpi-20021002-2.4.20-pre8.diff.gz?d
ownload)

3) downloaded the iasl release from intel's site at
http://developer.intel.com/technology/iapc/acpi/ with the direct download link being
http://developer.intel.com/technology/iapc/acpi/downloads/iasl-linux-200210
02.tar.gz

4) disassembled my dsdt by:

a) copying /proc/acpi/dsdt to a local file (dsdt.raw)
b) running "iasl -d dsdt.raw" (this gives you the dsdt.dsl file you tweak
below)

5) Tweaked the dsl file by doing the following:

a) removed all "*" characters from the object names
b) added external declarations for all missing objects
c) commented out the alias line which complained about the missing link
d) changed the store line which referenced the above alias line to use the
fully qualified path (I did try using the fqp on the alias, but no joy)
e) changed the references from C11C to BAT1 and C11B to BAT2

6) Recompiled my dsdt with "iasl -tc -p new dsdt.dsl" to give me new.hex which is a C formatted representation of the compiled dsl (I ignored the two warnings).

7) Copied new.hex to drivers/acpi/tables/compaq_evo_n800v.h under my kernel source tree.

8) Edited drivers/acpi/tables/tbgetall.c as follows:

a) Included the new dsdt header
b) Declared and set new ACPI_POINTER to hold a physical address rather
than the logical so I could pass it to acpi_tb_get_secondary_table()
c) Changed the call to acpi_tb_get_secondary_table() to use the new dsdt

9) Configured the kernel with Power Management and all ACPI (except toshiba) options selected. Screen shots included in tarball mentioned below.

10) Rebuilt the kernel, crossed my fingers and jumped around for joy when I can now do:

[pritchma@seth:pritchma]$ uname -a
Linux seth.modus.com.au 2.4.20-pre8 #10 Mon Oct 14 14:39:22 EST 2002 i686
unknown
[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/info
present:                 yes
design capacity:         4179 mAh
last full capacity:      4179 mAh
battery technology:      rechargeable
design voltage:          14800 mV
design capacity warning: 418 mAh
design capacity low:     0 mAh
capacity granularity 1:  100 mAh
capacity granularity 2:  100 mAh
model number:            Primary
serial number:           3
battery type:            4E4F494C
OEM info:                 COMPAQ
[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/state
present:                 yes
capacity state:          ok
charging state:          unknown
present rate:            0 mA
remaining capacity:      4179 mAh
present voltage:         16615 mV

Pull out the power:

[pritchma@seth:pritchma]$ cat /proc/acpi/battery/BAT1/state
present:                 yes
capacity state:          ok
charging state:          discharging
present rate:            1400 mA
remaining capacity:      4179 mAh
present voltage:         16296 mV

Looks good to me.

I've uploaded a tarball to
http://www.modus.com.au/scratch/compaq_n800v_acpi.tar.bz2

It contains:

* my original, changed and a diff of the disassembled dsdt
* my original, changed and a diff of tbgetall.c
* two screenshots of the kernel options I used

Now for the disclaimer :) I knew nothing about ACPI a week ago, and mucked around with this until it worked. The above may be everything you need to know, or not...but I do hope it sorts your problem out.

I'm now off to work out why kacpi and akpi both hang at startup...or write my own battery monitor!

Cheers

Mark Pritchard

Quoted 22 lines · Bob Lees

Hi

This may have been asked/aired before, in which case I apologise. However here goes.

I have sort of successfully disassembled/decompiled the dsdt from my evo 800c, using both pacpidump and iasl. They both produce the same outcome. By "sort of" I mean that I cannot disassemble and immdeiately recompile without errors. Some of them are basic to the compaq dsdt in that it references *PNP???? rather than PNP????. That is easy to fix. The other problem is that objects are disassembed which have no definition. This is much harder as it is not clear how these undefined objects should be defined. Is this a common problem and does a reasonable fix exist? and if so help!

For the present I have commented out the offending references, but this means that I have no fan control!! which may not be good in the long term:)

Regards

Bob

Signature · 12 lines
Bob Lees
Diamond Consulting Services Ltd
Aylesbury, Bucks, HP17 8UG
Phone: +44 (0) 1296 747667
Fax: +44 (0) 1296 747557
email: bob-l+PWtdWbHAsG2Il/[email protected]


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf