Page 2 of 2

Re: Multitasking

Posted: Tue Jan 06, 2009 5:22 pm
by Combuster
1: Something that looks like an attempt at executing code from video memory. You'd have to check bochs' dump to see if that indeed is the case...

2: That's GRUB trying to see if the bios supports some obscure function - it doesn't depend on it, so you can just ignore it.

Re: Multitasking

Posted: Fri Jan 16, 2009 10:57 pm
by leledumbo
Sorry for answering old question, but I think it's worth to know.
How would the following C code be defined in Pascal?
I've asked this once in FPC mailing list, here's the answer (the developers even add it to the wiki):
C:

Code: Select all

typedef struct page
{
   u32int present    : 1;   // Page present in memory
   u32int rw         : 1;   // Read-only if clear, readwrite if set
   u32int user       : 1;   // Supervisor level only if clear
   u32int accessed   : 1;   // Has the page been accessed since last refresh?
   u32int dirty      : 1;   // Has the page been written to since last refresh?
   u32int unused     : 7;   // Amalgamation of unused and reserved bits
   u32int frame      : 20;  // Frame address (shifted right 12 bits)
} page_t;

pascal:

Code: Select all

type
    Unsigned_7  = 0 .. (1 shl 7)  - 1;
    Unsigned_20 = 0 .. (1 shl 20) - 1;
 
type
    page_t = bitpacked record
       present  : boolean;
       rw       : boolean;
       user     : boolean;
       accessed : boolean;
       dirty    : boolean;
       unused   : Unsigned_7;
       frame    : Unsigned_20;
    end;
Note that this is NOT the correct structure (I don't know why JamesM simply amalgamate unused bits), read intel manuals about paging data structures and put the unused bits in the right place (check my fpos for reference).

Re: Multitasking

Posted: Sat Jan 17, 2009 8:06 am
by System123
I actually got my answer to this from your OS. Thanks very much. I did change the way it was done because I noticed James M had just joined the bits, even though the intel manuals state it differently. So I followed the intel manual.

@leledumbo: I just would like to thank you, your OS has helped me quite a few times when I got lost converting C code, it pushed me back in the right direction

Re: Multitasking

Posted: Sun Jan 18, 2009 8:11 pm
by leledumbo
You're welcome :D, btw I just upload a new version. Please check it out.

Re: Multitasking

Posted: Sun Jan 18, 2009 11:28 pm
by System123
I will be sure to do so. :D