Jump to content

Compiling ACPI v2.0 driver for Windows XP SP3 and Windows 2003 SP2 (x32/x64)


Mov AX, 0xDEAD

Recommended Posts

9 minutes ago, Dietmar said:

Here is new link

https://ufile.io/qou218zx

thank you

It's really nice to have this work in Windows XP but an old man like me loves Windows 2000 what can he do now. Is it possible for infuscomus to succeed in running this on my favorite system as per your knowledge ? 

https://forum.eclectic4un.me/viewtopic.php?f=25&t=89

Link to comment
Share on other sites


8 hours ago, Dietmar said:

With the Hack for _ValidateArgTypes  mov edi, 0xC0140008 =>mov edi, 0x00000000 from @Skulltrail

This hack is applicable for compiled acpi.sys by replacing BF 08 00 14 C0 with BF 00 00 00 00

Here we go

https://www.mediafire.com/file/3ei4jek6pq46p0h/ACPI_2.0_07.04.2022_SP1toSP3.7z/file

Link to comment
Share on other sites

9 hours ago, Dietmar said:

PS: On my Asrock z370 k6 I modded the DSDT at the same place via

If (OSYS >= 0x07D6)
    {

So, this HDA device will not work under XP.

But not easy to modd DSDT on newer Bios for XP, hard job.

With the Hack mov edi, 0xC0140008=>mov edi, 0x00000000

from @Skulltrail

at head of _ValidateArgTypes

are there any bad side effects? If not, we can integrate this Hack into new acpi.sys V2.

@Dietmar

1) Keep original DSDT code, if compiled acpi.sys will have generic solution, it helps not only to you,  but to other users too with same DSDT problem

2) If you want again mask errors as "blindman", you really don't need acpi.sys from sources, use existing v6666 binary

Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

Hi !

Solving problem with reading 64bit declared field:
in ReadField() change

Quote

     if (!(pfd->dwFieldFlags & FDF_BUFFER_TYPE) &&
     (pfd->dwNumBits <= sizeof(ULONG)*8))

to

Quote

      if (!(pfd->dwFieldFlags & FDF_BUFFER_TYPE) &&
     (pfd->dwNumBits <= sizeof(ULONG64)*8))      // dwNumBits = 64 for QWORD field

    
WriteField() doesn't have problem with 64bit field, but writes only LOW 4 bytes to 64Bit field(8 bytes)
It must write 0x00000000 to HIGH 4 bytes to remove garbage because field may point to hardware MMIO space or BIOS shared memory.
Remember AMD USB3 driver's bug with PAE ? This is same case when we forget to set/write full 64 address to hardware registers

@Dietmar
Can you repeat debug session with this micropatch and share logfile to confirm solving problem with this DSDT problem code ?

Quote

CreateQWordField (NBUF, \_SB.PCI0.HDAS._Y25._MIN, NBAS)  // _MIN: Minimum Base Address
CreateQWordField (NBUF, \_SB.PCI0.HDAS._Y25._MAX, NMAS)  // _MAX: Maximum Base Address
CreateQWordField (NBUF, \_SB.PCI0.HDAS._Y25._LEN, NLEN)  // _LEN: Length
NBAS = NHLA /* \NHLA */
NMAS = (NHLA + (NHLL - One))
NLEN = NHLL /* \NHLL */


 

Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

@George King

7 hours ago, George King said:

1 and 2 configured without problem. But I don't understand what you mean with that macro?

without macro you need write

extrn __imp_swprintf:PROC
....
call qword ptr [__imp_swprintf]

with macro more readable

EXTRNTHUNK swprint
....
callex swprint

ALIGN16 is ONE replace of this *s_h_i_t* before loops

Quote

db 66h

xchg ax,ax

xchg ax,ax

db 66h

xchg ax,ax

nop

...

 

Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

18 minutes ago, Mov AX, 0xDEAD said:

@George King

without macro you need write

extrn __imp_swprintf:PROC
....
call qword ptr [__imp_swprintf]

with macro more readable

EXTRNTHUNK swprint
....
callex swprint

ALIGN16 is ONE replace of this *s_h_i_t* before loops

 

Aha, your previously posted code is that macro? How can I lauch it please? All these things are new for me. 

Link to comment
Share on other sites

I bought my first AMD Ryzen 5000 series desktop system today (previous desktop was older 2000 series with 300 chipset)

I'll compile and test this when the system is ready.

I went with an ASRock motherboard, for whatever reason they use an iASL compiler from 2012 for their AMD boards and they seem to be the only vendor doing this. I wonder if this might be more ACPI friendly for XP because of it?

Link to comment
Share on other sites

@Mov AX, 0xDEAD

After crazy fight with the compiler I succeed to build a new Debug acpi.sys V2 with ULONG ---> ULONG64

if (!(pfd->dwFieldFlags & FDF_BUFFER_TYPE) &&
     (pfd->dwNumBits <= sizeof(ULONG64)*8)) 

And before I run a Windbg session with the looong output I try direct start and this acpi.sys works without any extra hack, nice:rolleyes:

Dietmar

PS: Now I run Windbg with the looong txt output.

 

 

 

Link to comment
Share on other sites

6 minutes ago, Dietmar said:

@Mov AX, 0xDEAD

After crazy fight with the compiler I succeed to build a new Debug acpi.sys V2 with ULONG ---> ULONG64

And before I run a Windbg session with the looong output I try direct start and this acpi.sys works without any extra hack, nice

No need to wait for full desktop loading, there is no error, so output may be infinine

Stop in windbg after some time and commit logfile

look for NMAS word and copy few lines below when it calc

if is it what we expected, i will update start post to include fix to diff file

Link to comment
Share on other sites

@Mov AX, 0xDEAD

The whole output is about 7Mb from Windbg from the Asrock z690 extreme board.

I run it until full XP SP3 desktop can be seen. No Bsod. No IDAPro modd in acpi.sys. No modd in DSDT.

Full acpi output needs about 3 hours

Dietmar

8989dbf9: {
8989dbf9: CreateQWordField(NBUF=Buffer(0x30){
	0x8a,0x2b,0x00,0x00,0x01,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x79,0x00},0xe,NBAS)AMLI:| | | | | ValidateArgTypes(pArgs=897720fc,ExpectedTypes=BI)
AMLI:| | | | | ValidateArgTypes=0

8989dc04: CreateQWordField(NBUF=Buffer(0x30){
	0x8a,0x2b,0x00,0x00,0x01,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x79,0x00},0x16,NMAS)AMLI:| | | | | ValidateArgTypes(pArgs=897720fc,ExpectedTypes=BI)
AMLI:| | | | | ValidateArgTypes=0

8989dc0f: CreateQWordField(NBUF=Buffer(0x30){
	0x8a,0x2b,0x00,0x00,0x01,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
	0x00,0x00,0x00,0x00,0x79,0x00},0x26,NLEN)AMLI:| | | | | ValidateArgTypes(pArgs=897720fc,ExpectedTypes=BI)
AMLI:| | | | | ValidateArgTypes=0

8989dc1a: Store(NHLAACPIAsyncAcquireGlobalLock: Entered with context 897720ac
ACPIAsyncAcquireGlobalLock: Got lock immediately, Context 897720ac
ACPIReleaseGlobalLock: Lock released by context 897720ac
=0x6526c000,NBAS)AMLI:| | | | ValidateTarget(pdataTarget=89772110,ExpectedType=DataObject,ppdata=ba55bcd4)
AMLI:| | | | ValidateTarget=0 (pdataTarget=89772160)
=0x6526c000
8989dc23: Add(NHLAACPIAsyncAcquireGlobalLock: Entered with context 897720ac
ACPIAsyncAcquireGlobalLock: Got lock immediately, Context 897720ac
ACPIReleaseGlobalLock: Lock released by context 897720ac
=0x6526c000,Subtract(NHLLACPIAsyncAcquireGlobalLock: Entered with context 897720ac
ACPIAsyncAcquireGlobalLock: Got lock immediately, Context 897720ac
ACPIReleaseGlobalLock: Lock released by context 897720ac
=0x0,One,)AMLI:| | | | ValidateArgTypes(pArgs=8977227c,ExpectedTypes=II)
AMLI:| | | | ValidateArgTypes=0
AMLI:| | | | ValidateTarget(pdataTarget=897722a4,ExpectedType=DataObject,ppdata=ba55bcd4)
AMLI:| | | | ValidateTarget=0 (pdataTarget=897722a4)
=0xffffffff,NMAS)AMLI:| | | | ValidateArgTypes(pArgs=897720fc,ExpectedTypes=II)
AMLI:| | | | ValidateArgTypes=0
AMLI:| | | | ValidateTarget(pdataTarget=89772124,ExpectedType=DataObject,ppdata=ba55bcd4)
AMLI:| | | | ValidateTarget=0 (pdataTarget=897721c8)
=0x6526bfff
8989dc33: Store(NHLLACPIAsyncAcquireGlobalLock: Entered with context 897720ac
ACPIAsyncAcquireGlobalLock: Got lock immediately, Context 897720ac
ACPIReleaseGlobalLock: Lock released by context 897720ac
=0x0,NLEN)AMLI:| | | | ValidateTarget(pdataTarget=89772110,ExpectedType=DataObject,ppdata=ba55bcd4)
AMLI:| | | | ValidateTarget=0 (pdataTarget=89772230)
=0x0
8989dc3c: }8989AAA0 ACPIBuildProcessRunMethodPhaseRecurse: Status = 00000103
AMLI: 89913020: AsyncEvalObject(\_SB.PC00.HDAS.SNDW._STA)

AMLI: 89913020: \_SB.PC00.HDAS.SNDW._STA()
8989A840 ACPIBuildProcessRunMethodPhaseCheckSta: Status = 00000103
AMLI: 89913020: AsyncEvalObject(\_SB.PC00.HDAS.UAOL._STA)

AMLI: 89913020: \_SB.PC00.HDAS.UAOL._STA()
8989A5F8 ACPIBuildProcessRunMethodPhaseCheckSta: Status = 00000103
8989A410 ACPIBuildProcessRunMethodPhaseCheckSta: Status = 00000000
8989A410 ACPIBuildProcessRunMethodPhaseRunMethod: Status = 00000000
8989A410 ACPIBuildProcessRunMethodPhaseRecurse: Status = 00000000
AMLI: 89913020: AsyncEvalObject(\_SB.PC00.HDAS.RTKC._STA)

AMLI: 89913020: \_SB.PC00.HDAS.RTKC._STA()
8982D7E8 ACPIBuildProcessRunMethodPhaseCheckSta: Status = 00000103

 

otto2.7z

Edited by Dietmar
Link to comment
Share on other sites

10 hours ago, Dietmar said:

@Mov AX, 0xDEAD

The whole output is about 7Mb from Windbg from the Asrock z690 extreme board.

I run it until full XP SP3 desktop can be seen. No Bsod. No IDAPro modd in acpi.sys. No modd in DSDT.

@Dietmar

Quote

NBAS = NHLA = 0x6526c000
NMAS = (NHLA + (NHLL - One)) = 0x6526c000 + (0-1) = 0x6526bfff
NLEN = NHLL = 0x0

Nice, no more "buffers", all variables are integers (not 64-bit as it should, but it is best what xp1 sources can offer)

I will update first post later Done

 

Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

@Damnation

4 hours ago, Damnation said:

@Mov AX, 0xDEAD

I would like to try and see if I can implement 64bit integer support.

struct _ObjData, integers share same space, so they declared as union

on XP it has dwDataValue/uipDataValue to store Int32 integer

on W2003 uipDataValue was deleted

since Longhorn, new field was added qwDataValue to store Int64 ineger

4 hours ago, Damnation said:

what functions should I be focusing on to properly implement this?

This is hard job :)

All functions which deal with dwDataValue/uipDataValue , including calculation size like sizeof(ULONG), sizeof(LONG), ...

Most simple/ugly way - rename dwDataValue/uipDataValue field , compile, you see most errors/places where integers was used, but code is tricky, it can works with pointer to ULONG, you won't see direct acces to field

4 hours ago, Damnation said:

which acpi.sys version has a proper 64bit integer support?

Quote

Exploring acpi.sys on Windows Longhorn betas:
4008 - integers are 32 bit, support most of acpi 2.0 opcodes (except CopyObject, Timer, QWordConst)
***
4042 - last version with 32 bit integers
4051 - first version with 64 bit integers
***
4074 - support new opcode CopyObject
***
5048 - import table match win xp !!!
***
5342 - support new opcode Timer and QWordConst, PDB published on Microsoft SYMBOL Server
5365 - integers are 32/64 (switched depending revision of DSDT table, V1=32, V2=64), added Dynamic conversion of types, PDB published

 

Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...