error in paging function :-(

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.
Post Reply
St8ic

error in paging function :-(

Post 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!)
carbonBased

RE:error in paging function :-(

Post 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
Post Reply