Page Tables and Directories 
Author Message
 Page Tables and Directories

Is this the correct struct(for use with DJGPP) for page table entries and
page directory entries...?

They seem OK. I checked intel docs about 50 times already...I am becoming
crazy over this...

struct PageTableEntry {
 unsigned int Present          : 1 __attribute__ ((packed));
 unsigned int ReadWrite        : 1 __attribute__ ((packed));
 unsigned int UserSuper        : 1 __attribute__ ((packed));
 unsigned int WriteThrough     : 1 __attribute__ ((packed));
 unsigned int CacheDisabled    : 1 __attribute__ ((packed));
 unsigned int Accessed         : 1 __attribute__ ((packed));
 unsigned int Dirty            : 1 __attribute__ ((packed));
 unsigned int Reserved         : 1 __attribute__ ((packed));
 unsigned int Global           : 1 __attribute__ ((packed));
 unsigned int Avail            : 3 __attribute__ ((packed));
 unsigned int PageAddress      : 20 __attribute__ ((packed));

Quote:
} __attribute__ ((packed));

struct PageDirEntry {
 unsigned int Present          : 1 __attribute__ ((packed));
 unsigned int ReadWrite        : 1 __attribute__ ((packed));
 unsigned int UserSuper        : 1 __attribute__ ((packed));
 unsigned int WriteThrough     : 1 __attribute__ ((packed));
 unsigned int CacheDisabled    : 1 __attribute__ ((packed));
 unsigned int Accessed         : 1 __attribute__ ((packed));
 unsigned int Reserved         : 1 __attribute__ ((packed));
 unsigned int PageSize         : 1 __attribute__ ((packed));
 unsigned int Global           : 1 __attribute__ ((packed));
 unsigned int Avail            : 3 __attribute__ ((packed));
 unsigned int PageTableAddress : 20 __attribute__ ((packed));

Quote:
} __attribute__ ((packed));

Thank you very much.

--
*******



Thu, 18 Jul 2002 03:00:00 GMT  
 Page Tables and Directories

Quote:

> Is this the correct struct(for use with DJGPP) for page table entries and
> page directory entries...?

> They seem OK. I checked intel docs about 50 times already...I am becoming
> crazy over this...

  You posted it a few times also.  I don't see anything wrong with it.
If there were an error, I expect someone would have spotted it by now.

  Switching mapping within C code is a fairly tricky process.  There are
many places the error could be, other than this struct.  I don't think
you ever posted a clear overview of how you want the change in mapping
to work.

  I think you mentioned you were using one of my pmode bootsectors.
Unless you modified it, that loads the pmode image at physical 1Mb and
maps that to linear (4GB minus 8Mb) and jumps there (with
offset==linear).  That means your code must be linked to have an initial
offset of FF800000.

  You said you were remapping to put physical 0-128Mb, double mapped at
linear 0-128Mb and at linear 3968-4095Mb.  Is your image still at
physical 1Mb?  Is the remapping code itself executing at FF800000?  (If
so, it would crash right after the load of CR3, because it isn't
mapped).  Should your code be executing at a different linear address
after the remap than before?  If so, how is it linked for two different
linear addresses?

  You need to think through the question of where your code is
executing, both physical and linear, both before and after the remap.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/



Thu, 18 Jul 2002 03:00:00 GMT  
 Page Tables and Directories

Quote:

> Is this the correct struct(for use with DJGPP) for page table entries and
> page directory entries...?

> They seem OK. I checked intel docs about 50 times already...I am becoming
> crazy over this...

> Thank you very much.

Seems right, but I don't use any structures for that because each entry
is only a 32-bit integer. I don't recommend you to use such bit layout,
or at least check if this stuff really works.

Alexei A. Frounze



Thu, 18 Jul 2002 03:00:00 GMT  
 Page Tables and Directories
Yes!!! I think I found the damn bugs...

Man...I am often blind with my own code, I don't see what's infront of me.

1) I didn't account for the fact that bootf mapped to last 8 megs...(thanx
John)
2) Strange thing. When I rewrote the code using unsigned ints, it suddenly
worked. I don't understand.
When I set up my struct with appropriate values and then get a pointer and
display it as an integer, I get the same value
as I used in my "integer based" code. But they didn't work..

Quote:

> > Is this the correct struct(for use with DJGPP) for page table entries
and
> > page directory entries...?

> > They seem OK. I checked intel docs about 50 times already...I am
becoming
> > crazy over this...

>   You posted it a few times also.  I don't see anything wrong with it.
> If there were an error, I expect someone would have spotted it by now.

>   Switching mapping within C code is a fairly tricky process.  There are
> many places the error could be, other than this struct.  I don't think
> you ever posted a clear overview of how you want the change in mapping
> to work.

>   I think you mentioned you were using one of my pmode bootsectors.
> Unless you modified it, that loads the pmode image at physical 1Mb and
> maps that to linear (4GB minus 8Mb) and jumps there (with
> offset==linear).  That means your code must be linked to have an initial
> offset of FF800000.

>   You said you were remapping to put physical 0-128Mb, double mapped at
> linear 0-128Mb and at linear 3968-4095Mb.  Is your image still at
> physical 1Mb?  Is the remapping code itself executing at FF800000?  (If
> so, it would crash right after the load of CR3, because it isn't
> mapped).  Should your code be executing at a different linear address
> after the remap than before?  If so, how is it linked for two different
> linear addresses?

>   You need to think through the question of where your code is
> executing, both physical and linear, both before and after the remap.
> --
> http://www.erols.com/johnfine/
> http://www.geocities.com/SiliconValley/Peaks/8600/



Sat, 20 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Page Tables and Directories

2. Table directory/name assignments

3. ASP connection string for directory of Clipper tables

4. Getting a Table from a web page

5. Reports - Page numbering, Table of Contents

6. Printing Page Number in table of contents

7. Problem with OLE or DDE CW20 connect with Page Maker 6 and Table Editor 2.5 /Adobe/

8. About working by OLE2 with EXCEL 7.0, Page Maker Table Editor and MS Word 7.0

9. modifying paging table in win9x

10. How do I use Page Tables under PM???

11. Help locating page tables under WIN95

12. Page table spec.

 

 
Powered by phpBB® Forum Software