overdue-scratch

Author Topic: EBIOS read error 0x42  (Read 4069 times)

0 Members and 1 Guest are viewing this topic.

hnak

  • Entrant
  • Posts: 7
EBIOS read error 0x42
« on: November 01, 2009, 10:54:29 AM »
I am writing  Sil0680 driver.
Chameleon 2.0 rc3 boot reports "EBIOS read error 0x42" 5 times about drives connected to Sil0680 IDE board with the latest BIOS. As the symptom is not related to hard drives, I suspected the boot source code and found biosfn.c's ebiosread ( request code = 0x42 ) has a problem.
According to BIOS specification, when carry flag is not set at return, the bios call was successful. However, the code just checks the value in bb.eax.r.h ( whether 0 or not ). The following code should be inserted before the check, I believe.
        if(bb.flags.cf == 0)
           bb.eax.r.h = 0;
Most BIOS seem to clear AH at successful call, but it is not guaranteed ( and SiliconImage BIOS doen't ).

Though I tried to build booter, I could not build it ( the size becomes smaller ).

zef

  • Administrator
  • Posts: 265
Re: EBIOS read error 0x42
« Reply #1 on: November 01, 2009, 01:51:46 PM »
Hi Hnak,

Thanks for the patch! Build the binary using:

make clean && make embedtheme

Let me know if this change really works, then we can incorporate it into the release.

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

hnak

  • Entrant
  • Posts: 7
Re: EBIOS read error 0x42
« Reply #2 on: November 02, 2009, 01:22:35 AM »
It works. I just inserted the line below right after BIOS call.
if (bb.flags.cf == 0) bb.eax.r.h = 0;

ebioswrite()'s code is similar.
Though it is not likely to be used at boot, it is more consistent to do the same fix there.
« Last Edit: November 02, 2009, 02:35:28 AM by hnak »

zef

  • Administrator
  • Posts: 265
Re: EBIOS read error 0x42
« Reply #3 on: November 04, 2009, 10:54:55 PM »
Thanks fix hnak! :)

Nice finding! Just checked the stage 1 loaders as well, they're testing the result against CF already - that's how you got to the stage 2 loader until now.

Now committed your fix into the repo.

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