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,547 of 4,255   
   =?UTF-8?B?15DXldeo15kg15XXmdeh15HXn to All   
   Re: paging makes OS to reboot infinitely   
   06 Dec 22 09:00:33   
   
   From: turhuhxckuo@gmail.com   
      
   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.   
   Yes, I'm in 32-bit mode. No, I don't have an initial page tables setup, but if   
   I'm not mistaken, that shouldn't cause the whole system reboot thing, until   
   I'm trying to do a memory-based operation, and then it should call for a page   
   fault.   
   Although now I realize that if I'm saying the function's ending is equivalent   
   to a jump, it means I am trying to execute a memory-based operation, so yeah,   
   it might be it.   
   Yes, the handler for page fault is correct, the code just doesn't get to it. I   
   loaded CR3, as you can see in the code.   
      
   I believe for GDT specifically the CPU is not using paging for the address,   
   but it does for JMP operations.   
   I did do a page fault handler. I've tried including asm file, it is a bit   
   easier but it's not that different.   
      
   Joe, I think Waldek is right.   
      
   Alex:   
   >If your page tables aren't properly set up, your kernel will almost certainly   
   triple-fault and reset because it itself uses page tables to access memory.   
   When you screw up your page tables, memory accesses either won't work at all   
   due to permissions or will read/write wrong memory cells, not the ones you're   
   expeting.   
      
   Yeah, but I thought it would call for a page fault, not reboot the system over   
   and over again. I think James is right about his guess about not   
   identity-mapping the kernel's code as the reason for its rebooting.   
      
      
   >Are you setting up 4KB pages or 4MB pages? You can't magically have both. For   
   4KB pages you aren't setting up any page tables or you're not showing your   
   code for this.   
   4KB. You're right, I'm not setting up page tables, but again it should do a   
   page fault IMO.   
      
      
   >Also, with PDT_SIZE=1024, (i>>22) is always 0. For 4MB pages you probably   
   want (i<<22) here.   
   Oh, I forgot that I need to shift left, you're right.   
   Why are you talking specifically about 4MB pages? Isn't it right for 4KB too?   
      
   (Also, this setup is just for placeholding, they're obviously not real page   
   tables)   
      
   --- 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