Hi,
Altenius wrote:I really don't think there's a problem with my code but this is the code that should initialize ACPI minus the verification to keep it short.
It's possible (as far as we can tell) that your code thinks its found the RSDP when it only found something that looks a bit like an RSDP (e.g. the signature was found but it didn't check the checksum), and that this is the reason the RSDT/XSDT pointers are dodgy.
Now; what do you mean by "initialize ACPI"? There's 2 possibilities here - only finding the ACPI tables and parsing them but not setting up a full AML interpreter and initialising it (which makes sense early during boot); or setting up a full AML interpreter and initialising it (which does not make sense without a lot of other framework for the AML interpreter to rely on).
The thing is, I suspect you mean the latter, and that you're doing something that's extremely complicated and potentially dangerous.
Think of it as 2 modes - "legacy mode" and "ACPI mode". In legacy mode when something involving power management occurs the hardware sends an SMI and the firmware's SMM code handles it (for example, if a temperature sensor detects that the computer is about to melt it sends an SMI and the firmware's SMM code increases fan speed or something to prevent hardware damage). In "ACPI mode" the hardware sends an SCI to the OS, the OS receives the event, and the OS uses an AML interpreter where the firmware's AML code handles the event (for example, if a temperature sensor detects that the computer is about to melt it sends an SCI and the firmware's AML code increases fan speed or something to prevent hardware damage).
To enable "ACPI mode" you send a command to enable it. If you send this command before you've got an AML interpreter (and before you've even got things like memory management, etc that the AML interpreter relies on to function properly); then (e.g.) a temperature sensor detects that the computer is about to melt and sends an SCI, but the OS doesn't have an AML interpreter and can't do anything about it (e.g. increasing fan speed), so the computer catches fire and burns down your house.
Note that it took experienced Intel programmers about 10 years to write ACPICA (an open source AML interpreter) and get it to a usable/reliable state. It's not something a beginner who has only just switched to protected mode should even consider until after they've got "legacy mode" working well.
Cheers,
Brendan