Author Topic: boot0.s must save/restore 32bit registers.  (Read 2409 times)

0 Members and 1 Guest are viewing this topic.


  • Entrant
  • Posts: 7
boot0.s must save/restore 32bit registers.
« on: November 21, 2009, 03:22:12 AM »
I tracked down the bug which prevents chameleon rc3 boot from SiliconImage cards.

Though read_lba of boot0.s saves/restores registers using pusha/popa, callers of the subroutine expects upper 16bits of registers are preserved - for example, code just before initBootLoader expects eax does not change.
Most BIOS preserves upper 16bits of registers, but SiliconImage BIOS doesn't and causes crash.

The fix is very simple - just replace read_lba's pusha/popa by pushad/popad.

 -- I mistyped boot0.s as bios0.s in the first post.
« Last Edit: November 21, 2009, 06:27:07 AM by hnak »


  • Administrator
  • Posts: 265
Re: boot0.s must save/restore 32bit registers.
« Reply #1 on: November 21, 2009, 12:45:27 PM »
Thanks hnak for the fix!

Just committed the changes into the repo :)

ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC