while im busy implelmenting threading ive decided to work on multiprocessing too.
so far everything has worked apart from accessing the apic base adress which is at 0xfee00000
i found that need to map this address in my pgdir for it to work.
however i carnt find the physical address which this is mapped to.
the only thing i can think of is to map 0xfee00000 to a random physical address in the pgdir
so that i can access it.
ive tryed reading the intel docs and the information on msrs and apic on osdev but i dont really
understand how the base address is mapped still.
can anyone help me on this??
apic base
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: apic base
Moved from theory since it doesn't belong there.
The APIC is virtually located between the CPU and the system bus - that means that it reacts as a normal device at a certain physical address (segmentation and paging are thus applied beforehand!). On the other hand, it is in front of the FSB so it is not accessible for other CPUs. That also means, 0xfee00000 IS the physical address. What virtual address maps to that is your call.
So, if you access 0xfee00000 from one (logical) CPU, you get the APIC that belongs to that CPU. If some other device happens to exist at the same address, you will not be able to access it.
While the APIC has a default location, there is a MSR that you can use to set the physical address the attached APIC will be responding to. You shouldn't normally move that address since you can render other devices inacessible, and you'd need to be aware of the caching consequences. Not to mention, moving the APIC is not supported on older CPUs.
Hope that makes things a bit clearer. It might help if you are more specific in your question (what are you trying to do and in what way?)
The APIC is virtually located between the CPU and the system bus - that means that it reacts as a normal device at a certain physical address (segmentation and paging are thus applied beforehand!). On the other hand, it is in front of the FSB so it is not accessible for other CPUs. That also means, 0xfee00000 IS the physical address. What virtual address maps to that is your call.
So, if you access 0xfee00000 from one (logical) CPU, you get the APIC that belongs to that CPU. If some other device happens to exist at the same address, you will not be able to access it.
While the APIC has a default location, there is a MSR that you can use to set the physical address the attached APIC will be responding to. You shouldn't normally move that address since you can render other devices inacessible, and you'd need to be aware of the caching consequences. Not to mention, moving the APIC is not supported on older CPUs.
Hope that makes things a bit clearer. It might help if you are more specific in your question (what are you trying to do and in what way?)
Re: apic base
basically im just trying to access the 0xfee00000 address and i keep getting a page fault.
it is so that i can identify which cpu is causing an interupt. like in the xv6 code
from http://pdos.csail.mit.edu/6.828/2007/
anyway, ive just mapped some mem from physicall address of 8mb to 12mb
to the location of 0xfee00000 and now im not getting the page fault when
trying to access it.
but i dunno if it works yet cos i havent written the boot up code for the
other processors yet.
it is so that i can identify which cpu is causing an interupt. like in the xv6 code
from http://pdos.csail.mit.edu/6.828/2007/
anyway, ive just mapped some mem from physicall address of 8mb to 12mb
to the location of 0xfee00000 and now im not getting the page fault when
trying to access it.
but i dunno if it works yet cos i havent written the boot up code for the
other processors yet.
Re: apic base
You do understand what causes a page fault, or?itisiuk wrote:basically im just trying to access the 0xfee00000 address and i keep getting a page fault.
JAL
Re: apic base
Hi,
The misunderstanding here is that the APIC is at 0xFEE00000 physical. You can map this to anywhere you like in your virtual address space. You are attempting to do this the other way around.
Cheers,
Adam
The misunderstanding here is that the APIC is at 0xFEE00000 physical. You can map this to anywhere you like in your virtual address space. You are attempting to do this the other way around.
Cheers,
Adam
Re: apic base
oh ****
well, that was another obvious mistake.
my bad.
is this the APIC mapped at that base even if you only have 128Mb then??
cheers
well, that was another obvious mistake.
my bad.
is this the APIC mapped at that base even if you only have 128Mb then??
cheers
Re: apic base
Even if you have 8M !itisiuk wrote:oh ****
well, that was another obvious mistake.
is this the APIC mapped at that base even if you only have 128Mb then??
cheers
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: apic base
The processor doesn't know how much RAM you have. And in the end, it makes it easier because you can use the APIC without knowing the ammount of ram.itisiuk wrote: is this the APIC mapped at that base even if you only have 128Mb then??
Re: apic base
great, well i just got that fixed and working
thanks guys`
now onto finishing threading
thanks guys`
now onto finishing threading