Jump to content

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


Mov AX, 0xDEAD

Recommended Posts

This project make possible to compile ACPI 2.0 driver from leaked XP SP1 & W2003 RTM sources, has same functionality as existing acpi.sys v6666 (still missed integer/fields/memory 64 bit support/)

  1. Grab leaked XP SP1/W2003 RTM sources (google it)
  2. Use "XPSP1/NT" directory as basedir if you want to compile acpi.sys for Windows XP x32
  3. Use "Win2K3/NT" directory as basedir for Windows 2003 x32 / Windows 2003 x64 / Windows XP x64
  4. Download any GNU patch package for windows (gnuwin32.sourceforge.net, cygwin, mingw, msys2, ...)
  5. Open command console, change current dir to base\busdrv\acpi\
  6. (Windows XP x32) Save text diff patch  https://pastebin.com/C5NXwHbS (v7 update) to file base\busdrv\acpi\sp1_to_sp3(ACP2).patch
  7. (Windows 2003 x32 / Windows 2003 x64 / Windows XP x64) Save text diff patch https://pastebin.com/8QURrM49 (v7 update) to file base\busdrv\acpi\rtm_to_sp2(ACP2).patch
  8. (Windows 2003 x32 / Windows 2003 x64 / Windows XP x64) Rename Win2K3/NT/public to Win2K3/NT/public2
  9. (Windows 2003 x32 / Windows 2003 x64 / Windows XP x64) Update compiler and headers to mix of W2003 DDK+WRK, unpack  https://anonfiles.com/J1W9H1a8y1/W2003_tools_update_7z  to basedir with overriding existing files
  10. Remove "read only" flag from base\busdrv\acpi directory including sub-dirs and files
  11. Apply patch to convert original SP1/RTM sources to SP3/SP2 with extended ACPi 2.0 syntax:
    Quote

    (Windows XP x32) patch.exe -Np1 -u -l -i sp1_to_sp3(ACP2).patch

    (Windows 2003 x32 / Windows 2003 x64 / Windows XP x64patch.exe -Np1 -u -l -i rtm_to_sp2(ACP2).patch

     

  12. patching file driver/amlinew/amlipriv.h
    patching file driver/amlinew/amlitest.c
    patching file driver/amlinew/data.c
    patching file driver/amlinew/misc.c
    patching file driver/amlinew/object.c
    patching file driver/amlinew/parser.c
    patching file driver/amlinew/proto.h
    patching file driver/amlinew/type1op.c
    patching file driver/amlinew/type2op.c
    patching file driver/inc/aml.h
    patching file driver/nt/debug.c
    patching file driver/nt/debug.h
    patching file driver/nt/devpower.c
    patching file driver/nt/internal.c
    patching file driver/nt/interupt.c
    patching file driver/nt/irqarb.c
    patching file driver/nt/osnotify.c
    patching file driver/nt/pciopregion.c
    patching file driver/nt/rangesup.c
    patching file driver/nt/root.c
    patching file driver/nt/wake.c
  13. Change current dir to basedir
  14. (Windows XP x32 / Windows 2003 x32) Run razzle environment setup:
    Quote

    set PROCESSOR_ARCHITECTURE=x86

    tools\razzle.cmd offline No_urt no_binaries no_certcheck No_prefast

    (add option free for nondebug compiling with optimization)

     

  15. (Windows 2003 x64 / Windows XP x64) Run razzle environment setup
    Quote

    set PROCESSOR_ARCHITECTURE=x86

    tools\razzle.cmd Win64 Amd64 offline No_urt no_binaries no_certcheck No_prefast

    (add option free for nondebug compiling with optimization)

     

  16. Change current dir to base\busdrv\acpi\driver\
  17. Complie ACPI driver: build /Dcegbw
  18. Compiled acpi.sys.sys will be in (x32) base\busdrv\acpi\driver\nt\obj\i386\ or (x64) base\busdrv\acpi\driver\nt\obj\amd64\

Project contains implementation of new ACPi 2.0 syntax:

  • ToInteger
  • ToString
  • ToHexString
  • Continue
  • ConcatenateResTemplate
  • ToDecimalString
  • Mod
  • ToBuffer
  • CopyObject
  • MidString
  • QwordConst (inside ParseIntObj)
  • Timer
  • CreateQWordField(fake it as CreateDWordField)

Know issues workarounds:

  1. BSOD 0xA5 (0x10006, ...)  missing _DIS method for "PNP0C0F" (PCI Interrupt Link Devices)
  2. BSOD 0xA5 (0x02,xxx, 0x0, ...)  ACPI vs E820 mem ranges conflict
  3. IOTRAPS I/O range 0xFF00-0xFFFF vs VGA (10-bit decode!) conflict
  4. BSOD 0xA5(0x03, ..., C0140008, ...) error in ValidateArgTypes() when reading 64-bit fields
  5. BSOD 0x7E(c0000005, ...) error in AcpiArbCrackPRT() when referencing null pointer
  6. BSOD 0xA5 (0x11, 0x08, ..., ...) error in _AMLILoadDDB() (zero lenght buffer)
  7. BSOD 0xA5 (0x11, 0x08, ..., ...) error in _AMLILoadDDB() (doubled device definition)
  8. BSOD 0xA5 (0x0000000D, ..., 0x4449555F, 0) absence _UID method
  9. BSOD 0xA5 (0x11, 0x08, ..., ...) error in _AMLILoadDDB() (Connection() opcode)
  10. CPU definition as Device with _HID=ACPI0007
  11. BSOD 0xA5(0x03, ..., C0000034, ...) postponed SSDT loading on x64 platform (v8 update)
  12. Assertion Fail on loaddsdt.c, line 488 for x64 builds (v8 update)

Unresolved issues:

  1.  BSOD 0xA5 (0x0000000D, ..., ..., ...) duplicated/absence _HID/_UID method (AMD boards)
  2.  BSOD 0xA5 (0x2001, 0x01,  0xC0000034, ...) failure to evaluate the _PIC method in NotifyHalWithMachineStates()
  3. Conflicted device names in Windows device manager (Code 42)
Edited by Mov AX, 0xDEAD
Link to comment
Share on other sites

  • Mov AX, 0xDEAD changed the title to Compiling ACPI v2.0 driver for Windows XP SP3 (x32 only)

@Mov AX, 0xDEAD  @George King

 

I just test the new acpi.sys on the Asrock z370 Fatalty k6 board with 32 Gbyte ram.

It works, nicccceeeeeeee!!!!!!!!!

Interesting, that the Acpi error about mistake in DDB

0x000000A5 (0x00000011, 0x00000008, xxx, yyy)

is not longer shown without any mod

Dietmar

 

 

Edited by Dietmar
Link to comment
Share on other sites

14 hours ago, Dietmar said:

@Mov AX, 0xDEAD  @George King

 

I just test the new acpi.sys on the Asrock z370 Fatalty k6 board with 32 Gbyte ram.

It works, nicccceeeeeeee!!!!!!!!!

Interesting, that the Acpi error about mistake in DDB

0x000000A5 (0x00000011, 0x00000008, xxx, yyy)

is not longer shown without any mod

Dietmar

 

 

Great! I have added it as default one into   XP2ESD. Now we need x64 too :)

 

Compiled file can be found here

https://www.wincert.net/forum/topic/17688-xpw2k3-x86-on-modern-hardware/?do=findComment&comment=138493
Edited by George King
Link to comment
Share on other sites

Unfortunately, Windows 2000 is unfortunate, did not find anyone to support it from these problems :no:

If you knew its value and the value of its logo and the feelings of its users towards it, it would not be left like this :unsure:.

WinWord2000 triste ma grazie a tutti !

Link to comment
Share on other sites

On the new z690 Asrock extreme board,

the new Vers 2.0 acpi.sys gives BSOD

0x000000A5 (0x00000003, 0x98E1DBA4, 0xC0140008, 0x494E495F)

so until now manual hack in acpi.sys with IDAPro is needed also

Dietmar

 

PS:  _ValidateArgTypes was called with 2nd arg = pointer to string with "H" char inside

at winxp_5512 exist  C, I, O, A, B, D, .. but not "H"

 

 

Edited by Dietmar
Link to comment
Share on other sites

19 hours ago, WinWord2000 said:

Unfortunately, Windows 2000 is unfortunate, did not find anyone to support it from these problems :no:

If you knew its value and the value of its logo and the feelings of its users towards it, it would not be left like this :unsure:.

WinWord2000 triste ma grazie a tutti !

Yes, Windows 2000 is the best classic system and really needs this support

Link to comment
Share on other sites

@Mov AX, 0xDEAD

Thanks for this project. Really great job. I have successfully compiled Debug + Free acpi.sys v5.1.2600.1106

 

What about x64 support?

I have used Win2K3 tools folder inside XPSP1 tree and I tried to build this awesome acpi.sys with razzle option win64 amd64

But seems like compile problems are connected with converting data types and ASM in devpower.c , internal.c , type2op.c , osnotify.c. According to log it seems like it doesn't know "__asm" - keyword not supported it this product. But this is caused by missing ASM code for x64?

Is there any chance to make it x64 compatible? 

 

EDIT: I grabbed tool folder from Win2K3 tree and placed them into XPSP1 tree. I must copy build.exe and mofcomp.exe from x86 to amd64 to be able compile x64 files on Windows 10 x64. So now I can build x64 1106 files.

Now I can launch razzle with win64 amd64 on untouched XPSP1 source tree. I was able to build untouched ACPI for x64 without errors. I think leaked enviroment is capable to build 1106 ACPI for x64 5.2 systems too?

x86 ACPI 2.0 1106 works with 5.1 and 5.2

Windows-XP-5-2-ACPI-2-0.png

More info is  here

https://www.wincert.net/forum/topic/17688-xpw2k3-x86-on-modern-hardware/?do=findComment&comment=138493

Edited by George King
Link to comment
Share on other sites

15 hours ago, Dietmar said:

On the new z690 Asrock extreme board,

the new Vers 2.0 acpi.sys gives BSOD

0x000000A5 (0x00000003, 0x98E1DBA4, 0xC0140008, 0x494E495F)

so until now manual hack in acpi.sys with IDAPro is needed also

Dietmar

 

PS:  _ValidateArgTypes was called with 2nd arg = pointer to string with "H" char inside

at winxp_5512 exist  C, I, O, A, B, D, .. but not "H"

 

 

I think we can add it into misc.c and alipriv.h 

 

Can you try this one? I have added "blank case" result for H argument. But it could be same result as default case so maybe nothing changed.

https://anonfiles.com/1fffa8T7x8/ACPI_2.0_H_test_7z
Edited by George King
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...