[SOLVED]trouble locating RSDP

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
matter123
Posts: 4
Joined: Wed Jul 10, 2013 1:52 pm

[SOLVED]trouble locating RSDP

Post 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.
Last edited by matter123 on Sat Jul 13, 2013 11:13 pm, edited 1 time in total.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: trouble locating RSDP

Post 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.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
matter123
Posts: 4
Joined: Wed Jul 10, 2013 1:52 pm

Re: trouble locating RSDP

Post by matter123 »

m12 wrote:. . .
You never increment str2.
Wow, I cant belive i missed that, However the problem is not resolved.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: trouble locating RSDP

Post 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.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
matter123
Posts: 4
Joined: Wed Jul 10, 2013 1:52 pm

Re: trouble locating RSDP

Post 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
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: trouble locating RSDP

Post by Mikemk »

Oh
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
matter123
Posts: 4
Joined: Wed Jul 10, 2013 1:52 pm

Re: [SOLVED]trouble locating RSDP

Post by matter123 »

fixed it, i forgot ti increment the mem pointer. Thank you for your help, m12
Locked