flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > RSDT problem... |
Author |
|
egos 18 Jun 2011, 21:53
See ACPI Spec.: "Finding the RSDP on IA-PC Systems"
|
|||
18 Jun 2011, 21:53 |
|
BOTOKILLER 19 Jun 2011, 07:37
Its really fun, I found it manualy in debugger on 0E0000h
Also I found out why my code didnt work, it used 'loop RSDP_LOOP' and didnt scan for the first byte of segment 0E000h, That was exactly where the signature started! |
|||
19 Jun 2011, 07:37 |
|
Mac2004 19 Jun 2011, 10:33
Wikipedia contains acpi information which should be helpful for you.
Acpi spec seems to be available from there. http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface regards Mac2004 |
|||
19 Jun 2011, 10:33 |
|
sinsi 19 Jun 2011, 10:44
|
|||
19 Jun 2011, 10:44 |
|
smiddy 16 May 2012, 23:25
Hey BOTOKILLER,
I put this together: Code: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ACPI memory table look up. ;; ;; I have to do this in stages. 1st I need to read the RSDP to get the XSDT, to look for other ;; tables. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RSDPSignature: db 'RSD PTR ',0 RSDTAddress: dd 0 XSDTAddress: dq 0 ACPIMemoryLookUp: push es push edi push eax mov si,ACPILookUpMessage call PrintString mov ax,0E000h ; Need to start looking for the RSDP to get the location of the XSDT mov es,ax ; the RSDP is in the E0000h to FFFFFh area, so the search is on. mov edi,0 ; Start at the first byte. .LoopToLook: mov eax,edi shl eax,24 cmp eax,0 jg .MoveOn mov al,[RSDPSignature] cmp byte [es:edi],al je .CheckTheRest .MoveOn: inc edi cmp edi,0FFF0h jg .CheckSegment .CheckTheRest: mov al,[RSDPSignature+1] cmp byte [es:edi+1],al jne .NotTheSame mov al,[RSDPSignature+2] cmp byte [es:edi+2],al jne .NotTheSame mov al,[RSDPSignature+3] cmp byte [es:edi+3],al jne .NotTheSame mov al,[RSDPSignature+4] cmp byte [es:edi+4],al jne .NotTheSame mov al,[RSDPSignature+5] cmp byte [es:edi+5],al jne .NotTheSame mov al,[RSDPSignature+6] cmp byte [es:edi+6],al jne .NotTheSame mov al,[RSDPSignature+7] cmp byte [es:edi+7],al jne .NotTheSame mov eax,[es:edi+16] ; 32 bit physical address of the RSDT. mov [RSDTAddress],eax ; 32 bit physical address of the RSDT. mov eax,[es:edi+24] ; 64 bit physical address of the XSDT. mov [XSDTAddress],eax ; 64 bit physical address of the XSDT. mov eax,[es:edi+28] ; 64 bit physical address of the XSDT. mov [XSDTAddress+4],eax ; 64 bit physical address of the XSDT. jmp .Done .NotTheSame: inc edi jmp .LoopToLook .CheckSegment: mov ax,es cmp ax,0F000h je .FailedToLocateRSDP mov ax,0F000h mov es,ax mov edi,0 jmp .LoopToLook .FailedToLocateRSDP: mov si,FailedMessage call PrintString .Done: mov si,ESMessage call PrintString mov eax,es mov cl,10h call ToHex mov si,HexBuffer call PrintString mov si,TheHexAfter call PrintString mov si,EDIMessage call PrintString mov eax,edi mov cl,20h call ToHex mov si,HexBuffer call PrintString mov si,TheHexAfter call PrintString mov si,TheEndOfLine call PrintString cmp dword [RSDTAddress],0 je .CheckXSDTAddress mov si,RSDTAddressMessage call PrintString mov eax,[RSDTAddress] mov cl,20h call ToHex mov si,HexBuffer call PrintString mov si,TheHexAfter call PrintString mov si,TheEndOfLine call PrintString .CheckXSDTAddress: cmp dword [XSDTAddress],0 je .DoTheEndOfTheLine mov si,XSDTAddressMessage call PrintString mov eax,[XSDTAddress+4] mov cl,20h call ToHex mov si,HexBuffer call PrintString mov eax,[XSDTAddress] mov cl,20h call ToHex mov si,HexBuffer call PrintString mov si,TheHexAfter call PrintString mov si,TheEndOfLine call PrintString .DoTheEndOfTheLine: mov si,TheEndOfLine call PrintString pop eax pop edi pop es ret This finds both the RSDT and XSDT addresses. However, and this is not fully tested (yet), when I look at the length of the RSDT and XSDT from their respective locations, I get weird results from Virtual PC and Virtualbox. Did you get very far in your endeavor? |
|||
16 May 2012, 23:25 |
|
cod3b453 17 May 2012, 20:20
For reference, VirtualBox locations are:
RSDP 000E0000 FACP 3FFF00F0 APIC 3FFF0240 DSDT 3FFF0480 (those are the ones I've parsed so far; there are plenty more) and reports ACPI v2. ---- One thing to be careful of is one VM (and theoretically some BIOS') have the signature in more than one place in the EBDA so it's probably a good idea to perform the checksum. |
|||
17 May 2012, 20:20 |
|
smiddy 18 May 2012, 01:20
cod3b453 wrote: For reference, VirtualBox locations are: Well, I figured this, that it is all over the place. RSDT tends to be reasonable in size, but I get F000FF53h for the XSDT, which in reality is off target since the numbers are even, so I must be doing something wrong. Thanks for the addresses. I'll try to verify them. I'm working to get the memory allocation information (outside of E820) and if the data spec is 2.0 versus 5.0 perhaps I need to revert some of my texts and adjust accordingly. (?) |
|||
18 May 2012, 01:20 |
|
smiddy 19 May 2012, 01:01
Ok, I was hosing up my addressing for the XSDT, however, it seems the RSDP at E0000h has a bad addess information for the XSDT. I will have to check elsewhere in Virtualbox, VirtualPC seems to work nicely.
|
|||
19 May 2012, 01:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.