Voodooprojects

Chameleon => Bug Reports => Topic started by: hnak on November 01, 2009, 10:54:29 AM

Title: EBIOS read error 0x42
Post by: hnak 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 ).
Title: Re: EBIOS read error 0x42
Post by: zef 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
Title: Re: EBIOS read error 0x42
Post by: hnak 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.
Title: Re: EBIOS read error 0x42
Post by: zef 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