Jump to content

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


Mov AX, 0xDEAD

Recommended Posts


19 minutes ago, Dietmar said:

@George King

The Source Code here in the beginning of the thread is build from @Mov AX, 0xDEAD .

Some more I have, but not all. And the last hacks for AcpiArbCrackPRT() I think, he does not like.

But they work

Dietmar

I would like to include it in new XP2ESD which was brutally delayed due my personal issues. 

+- in 2 weeks or similar.

 

 

Link to comment
Share on other sites

@Dietmar Does your compiled files contains _OSI tweak in type2op? I have updated code I got from this topic with two new values from decompiled Windows 11 ACPI.

    // Add future OS strings here.
    char Win2000[] =      "Windows 2000";
    char Win2001[] =      "Windows 2001";
    char Win2001SP1[] =   "Windows 2001 SP1";
    char Win2001_1[] =    "Windows 2001.1";
    char Win2001SP2[] =   "Windows 2001 SP2";
    char Win2001_1SP1[] = "Windows 2001.1 SP1";
    char Win2006[] =      "Windows 2006";
    char Win2006SP1[] =   "Windows 2006 SP1";
    char Win2006_1[] =    "Windows 2006.1";
    char Win2009[] =      "Windows 2009";
    char Win2012[] =      "Windows 2012";
    char Win2013[] =      "Windows 2013";
    char Win2015[] =      "Windows 2015";
    char Win2016[] =      "Windows 2016";
    char Win2017[] =      "Windows 2017";
    char Win2017_2[] =    "Windows 2017.2";
    char Win2018[] =      "Windows 2018";
    char Win2018_2[] =    "Windows 2018.2";
    char Win2019[] =      "Windows 2019";
    char Win2020[] =      "Windows 2020";
    char Win2021[] =      "Windows 2021";
    char Win2022[] =      "Windows 2022";
    char* SupportedOSList[] = {
                                    Win2000, 
                                    Win2001,
                                    Win2001SP1,
                                    Win2001_1,
                                    Win2001SP2,
                                    Win2001_1SP1,
                                    Win2006,
                                    Win2006SP1,
                                    Win2006_1,
                                    Win2009,
                                    Win2012,
                                    Win2013,
                                    Win2015,
                                    Win2016,
                                    Win2017,
                                    Win2017_2,
                                    Win2018,
                                    Win2018_2,
                                    Win2019,
                                    Win2020,
                                    Win2021,
                                    Win2022
                                };

 

Can you please compile your latest source code mod for all three (5.1 x86, 5.2 x86, 5.2 x64) versions with this tweak included?

Edited by George King
Link to comment
Share on other sites

20 minutes ago, Dietmar said:

@George King

There has much more changed in Source Code.

And also some new hacks.

So, until now you can use only my acpi.sys which I send from here

Dietmar

Yeah, I expect many changes. That why I asked if you can add into your source mentioned OSI tweak (I can see then TPM devices, dual GPUs etc). and compile it for me instead sharing current source :)

Of cource I grabbed your 5.1 x86 and 5.2 x64 ACPI files from XP2ESD topic and here. But 5.2 x86 is still missing. So I hope you can do that instead creating SourceSode patches :)

Edited by George King
Link to comment
Share on other sites

@George King

The from Sources 2003 build acpi.sys 5.2 bit32 is much more instable than the acpi.sys from Sources for XP SP1,2,3.

So, after some talk in messages, I changed the Source Code from the acpi.sys for XP SP1, that now it supports to full(?) the acpi.sys 5.2 bit32

Dietmar

PS: All acpi.sys contains now the OS fakes, that you mentioned.

 

Edited by Dietmar
Link to comment
Share on other sites

On 4/6/2023 at 7:35 PM, Dietmar said:

Hi,

this browser is the only one, that works in April 2023 with ChatGPT under XP SP3

Dietmar

https://ufile.io/d8bk1n0a

That is interesting, but I think there's much better topic to talk about modern Chromium-based browser for Windows XP.

 

Link to comment
Share on other sites

On 3/30/2023 at 2:58 AM, George King said:

Hi @Mov AX, 0xDEAD!

Any news on v8 update?

Hi @George King

as i wrote before, comparing w2003 kernel headers is too boring, so pre-v8 has only multi-thread "ssdt loading" race condition workaround:

worker.c:

1)

Quote

VOID
ACPIWorker(
    IN PVOID StartContext
    )
{
    PLIST_ENTRY Entry;
    WORK_QUEUE_TYPE QueueType;
    PWORK_QUEUE_ITEM WorkItem;
    KIRQL OldIrql;
    NTSTATUS Status;
    static KWAIT_BLOCK WaitBlockArray[ACPIMaximumObject];
    PVOID WaitObjects[ACPIMaximumObject];

Quote

extern int gRevertAffinityACPIWorker;

VOID
ACPIWorker(
    IN PVOID StartContext
    )
{
    PLIST_ENTRY Entry;
    WORK_QUEUE_TYPE QueueType;
    PWORK_QUEUE_ITEM WorkItem;
    KIRQL OldIrql;
    NTSTATUS Status;
    static KWAIT_BLOCK WaitBlockArray[ACPIMaximumObject];
    PVOID WaitObjects[ACPIMaximumObject];

    //////////////////////////////////////////////////////////////////////////
    // Multi-thread race condition workaround, see ACPIInitializeDDBs()
    KAFFINITY oldAffinity = KeGetCurrentThread()->Affinity;
    #ifdef DEBUGGER
    DbgPrint("ACPIWorker: SetAffinity(1) oldAffinity=%p th=%p \n", oldAffinity, PsGetCurrentThread());
    #endif
    if(KeGetCurrentIrql() <= DISPATCH_LEVEL) {
        KeSetSystemAffinityThread((KAFFINITY)1);
    } else{
        DbgPrint("ACPIWorker: IRQL > DISPATCH_LEVEL \n");
    }
    //////////////////////////////////////////////////////////////////////////

 

2)

Quote

        //
        // Switch on the wait status.
        //

 

Quote

       //////////////////////////////////////////////////////////////////////////
        // Multi-thread race condition workaround, see ACPIInitializeDDBs()
        if (gRevertAffinityACPIWorker == 1) {   // revert affinity
            #ifdef DEBUGGER
            DbgPrint("ACPIWorker: RevertAffinity(%p) th=%p \n", oldAffinity, PsGetCurrentThread());
            #endif
            if(KeGetCurrentIrql() <= DISPATCH_LEVEL) {
                KeSetSystemAffinityThread(oldAffinity);
            } else{
                DbgPrint("ACPIWorker: IRQL > DISPATCH_LEVEL \n");
            }
            
            gRevertAffinityACPIWorker = 2;  // remove signal
        }
        
        #ifdef DEBUGGER
        DbgPrint("ACPIWorker: New Job \n");
        #endif
        //////////////////////////////////////////////////////////////////////////  
                                        

        //
        // Switch on the wait status.
        //

acpiinit.c:

1)

Quote

NTSTATUS
ACPIInitializeDDBs(
    VOID
    )
/*++

Routine Description:

    This function looks that the RsdtInformation and attemps to load
    all of the possible Dynamic Data Blocks

Arguments:

    None

Return Value:

    NTSTATUS

--*/
{
    NTSTATUS    status;
    ULONG       index;
    ULONG       numElements;

Quote

int gRevertAffinityACPIWorker = 0;

NTSTATUS
ACPIInitializeDDBs(
    VOID
    )
/*++

Routine Description:

    This function looks that the RsdtInformation and attemps to load
    all of the possible Dynamic Data Blocks

Arguments:

    None

Return Value:

    NTSTATUS

--*/
{
    NTSTATUS    status;
    ULONG       index;
    ULONG       numElements;

    //////////////////////////////////////////////////////////////////////////
    // Multi-thread race condition workaround, see ACPIWorker()
    KAFFINITY oldAffinity = KeGetCurrentThread()->Affinity;
    #ifdef DEBUGGER
    DbgPrint("ACPIInitializeDDBs: SetAffinity(1) oldAffinity=%p th=%p \n", oldAffinity, PsGetCurrentThread());
    #endif
    if(KeGetCurrentIrql() <= DISPATCH_LEVEL) {
        KeSetSystemAffinityThread((KAFFINITY)1);
    } else{
        DbgPrint("ACPIInitializeDDBs: IRQL > DISPATCH_LEVEL \n");
    }    
    //////////////////////////////////////////////////////////////////////////

2)

Quote

    //
    // If we got here, then everything is okay
    //
    return STATUS_SUCCESS;

 

Quote

   //////////////////////////////////////////////////////////////////////////
    // Multi-thread race condition workaround, see ACPIWorker()
    #ifdef DEBUGGER
    DbgPrint("ACPIInitializeDDBs: RevertAffinity(%p) th=%p \n", oldAffinity, PsGetCurrentThread());
    #endif
    if(KeGetCurrentIrql() <= DISPATCH_LEVEL) {
        KeSetSystemAffinityThread(oldAffinity);
    } else{
        DbgPrint("ACPIInitializeDDBs: IRQL > DISPATCH_LEVEL \n");
    }
    gRevertAffinityACPIWorker = 1;  // signal for ACPIWorker()
    //////////////////////////////////////////////////////////////////////////


    //
    // If we got here, then everything is okay
    //
    return STATUS_SUCCESS;

patched code uses KeGetCurrentThread()->Affinity, on x64 _KTHREAD structure has WRK(SP1) definition and ->Affinity mismatch with x64 SP2 kernels, need update header:

ke.h:

w2003 wrk:

Quote

    PKTRAP_FRAME TrapFrame;
    PVOID CallbackStack;
    PVOID ServiceTable;

#if defined(_AMD64_)

    ULONG KernelLimit;

#endif

    //
    // The following fields are referenced during ready thread and wait
    // completion.
    //

    UCHAR ApcStateIndex;
    UCHAR IdealProcessor;
    BOOLEAN Preempted;
    BOOLEAN ProcessReadyQueue;

#if defined(_AMD64_)

    PVOID Win32kTable;
    ULONG Win32kLimit;

#endif

SP2 actual:

Quote

    PKTRAP_FRAME TrapFrame;
    PVOID CallbackStack;

#if defined(_AMD64_)
    
    //PVOID ServiceTable;
    //ULONG KernelLimit;
#else
    
    PVOID ServiceTable;

#endif


    //
    // The following fields are referenced during ready thread and wait
    // completion.
    //

    UCHAR ApcStateIndex;
    UCHAR IdealProcessor;
    BOOLEAN Preempted;
    BOOLEAN ProcessReadyQueue;

#if defined(_AMD64_)

    //PVOID Win32kTable;
    //ULONG Win32kLimit;


#endif

2) there is self-check, need comment all three lines because we don't have Win32kTable/KernelLimit/Win32kLimit on x64 SP2 anymore:

Quote

C_ASSERT((FIELD_OFFSET(KTHREAD, ServiceTable) + 16) == FIELD_OFFSET(KTHREAD, Win32kTable));
C_ASSERT((FIELD_OFFSET(KTHREAD, ServiceTable) + 8) == FIELD_OFFSET(KTHREAD, KernelLimit));
C_ASSERT((FIELD_OFFSET(KTHREAD, Win32kTable) + 8) == FIELD_OFFSET(KTHREAD, Win32kLimit));

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...