xboxscene.org forums

Author Topic: Cromwell Mystery  (Read 76 times)

taibu

  • Archived User
  • Newbie
  • *
  • Posts: 2
Cromwell Mystery
« on: August 30, 2006, 02:54:00 PM »

hello

Ive been looking at the cromwell bios code and Im having trouble understanding a part of it.
Here's a part of 2bBootStartup.S

  136    // kill the cache  = Disable bit 30 + 29 = CD + NW
  137    // CD = Cache Disable (disable = 1)
  138    // NW Not write through (disable = 1)
  139           mov    %cr0, %eax
  140    orl   $0x60000000, %eax
  141    mov   %eax, %cr0
  142    wbinvd
  143
  144    // We clear the cr3 register
  145    mov   %eax, %eax
  146    mov   %eax, %cr3

The problem is that the part that claims to clear cr3 doesnt seem to actually do that. It writes cr0 to cr3 instead. What's the deal with that?
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Cromwell Mystery
« Reply #1 on: August 31, 2006, 07:35:00 AM »

Looks like a typo to me. mov -> xor. Might be worth contacting cromwell maintainers.
Logged

taibu

  • Archived User
  • Newbie
  • *
  • Posts: 2
Cromwell Mystery
« Reply #2 on: August 31, 2006, 09:42:00 AM »

I thought so myself. But I'm not an asm expert so I thought I'd have a second opinion (IMG:style_emoticons/default/smile.gif)
I wouldnt expect it to have any effect though, because paging is disabled at that point and if it gets enabled later they'd overwrite cr3 anyway. But since they take the bother to clear it in the first place I think Ill try to post some kind of report at their sourceforge project page.

edit: My attempt to post a bug report at their project page failed unfortunately. But at least i tried (IMG:style_emoticons/default/smile.gif)

This post has been edited by taibu: Aug 31 2006, 04:58 PM
Logged