home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,586 of 4,255   
   Dan Cross to antispam@math.uni.wroc.pl   
   Re: paging makes OS to reboot infinitely   
   14 Dec 22 13:35:05   
   
   From: cross@spitfire.i.gajendra.net   
      
   In article ,   wrote:   
   >Dan Cross  wrote:   
   >> In article <34818e6d-23a5-4c02-a6ef-6dfeaaf1ce3fn@googlegroups.com>,   
   >> ? ? ???  ? ? ??? ? ? ?    wrote:   
   >> >First of all, thank you all for replying, I really appreciate it.   
   >> >   
   >> >James:   
   >> >> If in 32-bit mode do you have a page directory and the requisite initial   
   >> >page tables set up (or the equivalent) and do they identity-map the code   
   >> >location you are running at? Are they all marked Present and are all   
   >> >their other bits correct?   
   >> >   
   >> >Yes, I mean no instructions are happening after I set CR0. Didn't know it   
   needs to JMP to a new line of code after it, I thought the jump at   
   >> >the end of the scope of the function is enough, but it makes a lot of   
   sense I should identity-map the kernel's code into virtual mode. But I   
   >> >reckon it's not my only problem there.   
   >>   
   >> This is for x86, but the same principle applies generally: once   
   >> you turn on paging by setting the PG bit in %cr0, the next   
   >> instruction must necessarily come from an address that is mapped   
   >> in the address space described by the page tables that you are   
   >> pointing to in %cr3.  There is no jumping around permitted; the   
   >> next instruction is either mapped or you get a page fault.   
   >>   
   >> Perhaps you were thinking of a long-jump between segments?   
   >> Once you're turning on 32-bit paging, that's not generally at   
   >> play anymore.   
   >   
   >386 is special here: one have to jump to make sure that processor   
   >view of state of the world is consistent.  And yes, page tables   
   >have to be correctly set up with 1-1 mapping of currently   
   >executing code.   
      
   You're referring to section 10.4.4 of the 80386 Programmer's   
   Reference Manual?  Such language is absent in the current Intel   
   SDM (it was dropped when the 486 came out) when describing   
   paging in 32-bit mode, and it is not clear that OP is   
   targetting an actual 80386.  Certainly, adding a `jmp 1f; 1:`   
   isn't going to hurt, but it is not necessary on any Intel or   
   AMD microprocessor manufactured in the last 30 years, even in   
   32-bit mode.   
      
   	- Dan C.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca