[LinuxBIOS] [PATCH] Fix various compiler warnings and potential bugs

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Feb 1 22:51:24 CET 2007

Ed Swierk wrote:
> On 2/1/07, Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:
>> The code says something different.
>> static void delayx(uint8_t value) {
>>         int i;
>>         for(i=0;i<0x8000;i++) {
>>                 outb(value, 0x80);
>>         }
>> }
>> The value is the POST code and has nothing to do with the delay.
>> So your patch changed the POST code from E8 (1000 mod 256) to 64 (100)
>> and called the delay function ten times.
> So delayx() actually sets the POST code by writing some value 32768
> times, has nothing to do with delay, and the comments about delay are
> completely irrelevant? My brain just exploded.

Prepare for more explosions. The POST code is written 32768 times and
a side effect of writing to an I/O port on x86 is that it takes ~3 usec
depending on whom you ask. Why writing the POST code, you ask? Simple.
Port 0x80 is probably the one I/O port with the least side effects.


More information about the coreboot mailing list