Page 1 of 1

error in paging function :-(

Posted: Fri Nov 14, 2003 12:00 am
by St8ic
In one of my functions (init_paging) there is one line that always errors on compile. it looks like this:

page_table = page_directory + 0x1000;

page_directory IS used as an array later on. Maybe I need to add a type cast? How would I go about doing so?

Does anyone have an idea what the hell is wrong with it? I've been hacking at this paging function for almost a month now!

Thanks,
St8ic
(We write code so they don't have to...
Let's hear it for the geeks!)

RE:error in paging function :-(

Posted: Fri Nov 14, 2003 12:00 am
by carbonBased
With all due respect, you really outta look into the C language before writting an OS in it :)

I don't recall what page_table and page_directory are defined as, however, assuming they're both pointers (which they much be, if you're performing arithmetic like that on them) the following should work:

page_table = (PageTable *)( (long)page_directory + 0x1000 );

Cheers,
Jeff