Page 1 of 1

[SOLVED]trouble locating RSDP

Posted: Sat Jul 13, 2013 8:27 pm
by matter123
I am searching the entire adress space below 1mb and I can't find the RSDP signature "RSD PTR ".

The code for the search is

Code: Select all

    
    char *mem;
    for(int i=0;i<0x100000;i+=16) {
        if(!rstrncmp(mem,"RSD PTR "))return (uint32_t)mem;
    }
And the function rstrncmp is as follows

Code: Select all

int rstrncmp(char *str1, char *str2) {
    for(int i=0;i<8 ;i++) {
        if(*str1++!=*str2)return 1;
    }
    return 0;
}
I am using QEMU, and have not tested, not have the ability to test on real hardware.
Any help would be greatly Appreciated.

Re: trouble locating RSDP

Posted: Sat Jul 13, 2013 10:08 pm
by Mikemk
matter123 wrote:

Code: Select all

int rstrncmp(char *str1, char *str2) {
    for(int i=0;i<8 ;i++) {
        if(*str1++!=*str2)return 1;
    }
    return 0;
}
You never increment str2.

Re: trouble locating RSDP

Posted: Sat Jul 13, 2013 10:22 pm
by matter123
m12 wrote:. . .
You never increment str2.
Wow, I cant belive i missed that, However the problem is not resolved.

Re: trouble locating RSDP

Posted: Sat Jul 13, 2013 10:31 pm
by Mikemk
matter123 wrote:

Code: Select all

    
    for(int i=0;i<0x100000;i+=16) {
Why are you skipping over 93.75% of the ram in the first MB?

EDIT: I find it at 0xfd9a0 in my QEMU. There's no guarantee that it'll be there, but if we are using the same version, there's a chance. Try printing out the code at that location.

Re: trouble locating RSDP

Posted: Sat Jul 13, 2013 10:39 pm
by matter123
... To find the table, the Operating System has to find the "RSD PTR " string (notice the last space character) in one of the two areas. This signature is always on a 16 byte boundary.
http://wiki.osdev.org/RSDP#Detecting_the_RSDP

Re: trouble locating RSDP

Posted: Sat Jul 13, 2013 11:07 pm
by Mikemk
Oh

Re: [SOLVED]trouble locating RSDP

Posted: Sat Jul 13, 2013 11:14 pm
by matter123
fixed it, i forgot ti increment the mem pointer. Thank you for your help, m12