Maybe a Stupid Question

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.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:Maybe a Stupid Question

Post by distantvoices »

you should use the virtual address. :-)

Where in virtual address space have you mapped your kernel? from 0xc0000000 or somewhere different? Identity mapped?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
ich_will

Re:Maybe a Stupid Question

Post by ich_will »

identy mapped

it is loaded at 0x10000 by bochs (I think bochs doesn't enable paging)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Maybe a Stupid Question

Post by Pype.Clicker »

ich_will wrote: f.e. if the page with the virtual_address 0x617000 is set (page-index 1559):

from_addr + i*4096 is 0xC30000
0x617000 + 1559*4096 --> 0xC30000 (you shouldn't use this address for invlpg, i think)
I may have misunderstood your use of 'i' ...

Let's say you want to clear pages from 0x617000 to 0x619000, you need to call (among other things) the following sequence.

Code: Select all

   _invlpg(0x617000);
   _invlpg(0x618000);
   _invlpg(0x619000);
CLR_12_BITS(...) == 0x617000 *only* because you have 1:1 mapping for that region, but it won't work any longer after this ...

(checking my own code for a hopefully correct nasm-like "invlpg" ...)
ich_will

Re:Maybe a Stupid Question

Post by ich_will »

thx, i'll try
ich_will

Re:Maybe a Stupid Question

Post by ich_will »

AAAAAAARRRRGGGGGH, I found the mistake, all the paging things seems to work fine, but I've never tried to write to one page (I've played to much with the loop code):

Code: Select all

for(i = 0; i > 4096; i++)
    { *((char*)(0x617000 + i)) = '1'; }
do this i > 4096, i will never be bigger than 4096 if it starts by zero.

Thanks alot, first the mistake was the not existing invlpg call.

Now all works. F***.
It's better if you can read.
Post Reply