<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-2022-kr">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Bug in etherboot 5.1.2rc7</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>I recently check out etherboot from the cvs to do boot from ide. </FONT>
<BR><FONT SIZE=2>At the first try, It could't found ide controller with saying "No adaptor found" </FONT>
<BR><FONT SIZE=2>After tracking down the codes I found the reason in scan_bus() function in pci.c </FONT>
</P>

<P><FONT SIZE=2>The problem was that it skips to probe my ide controller. </FONT>
<BR><FONT SIZE=2>My board is organized as follows. </FONT>
<BR><FONT SIZE=2>00:02.3 <-- UBS controller</FONT>
<BR><FONT SIZE=2>00:02.4 <-- empty</FONT>
<BR><FONT SIZE=2>00:02.5 <-- IDE controller</FONT>
</P>

<P><FONT SIZE=2>When scan_bus probes all devfn, after reading PCI_VENDOR_ID from empty 00:02.4 it set hdr_type=0. therefore it skip to probe rest of functions including 00:02.5. </FONT></P>

<P><FONT SIZE=2>To avoid this situation I modified the code as follows to prevent to set hdr_type = 0. </FONT>
<BR><FONT SIZE=2>I'm not sure why original code set hdr_type = 0 when the slot return null vendor_id. </FONT>
<BR><FONT SIZE=2>But anyway I can boot from the disk by just removing this line. </FONT>
</P>

<P><FONT SIZE=2>static void scan_bus(int type, struct pci_device *dev)</FONT>
<BR><FONT SIZE=2>{</FONT>
<BR>        <FONT SIZE=2>.</FONT>
<BR>        <FONT SIZE=2>.</FONT>
<BR>        <FONT SIZE=2>buses=256;</FONT>
<BR>        <FONT SIZE=2>for (bus = first_bus; bus < buses; ++bus) {</FONT>
<BR>                <FONT SIZE=2>for (devfn = first_devfn; devfn < 0xff; ++devfn) {</FONT>
<BR>                <FONT SIZE=2>        if (PCI_FUNC (devfn) == 0)</FONT>
<BR>                                <FONT SIZE=2>pcibios_read_config_byte(bus, devfn, PCI_HEADER_TYPE, &hdr_type);</FONT>
<BR>                        <FONT SIZE=2>else if (!(hdr_type & 0x80))    /* not a multi-function device */</FONT>
<BR>                                <FONT SIZE=2>continue;</FONT>
</P>

<P>                        <FONT SIZE=2>pcibios_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l);</FONT>
<BR>                        <FONT SIZE=2>/* some broken boards return 0 if a slot is empty: */</FONT>
<BR>                        <FONT SIZE=2>if (l == 0xffffffff || l == 0x00000000) {</FONT>
<BR>                                <FONT SIZE=2>// hdr_type = 0; // <- I removed this line. hcyun. </FONT>
<BR>                                <FONT SIZE=2>continue;</FONT>
<BR>                        <FONT SIZE=2>}</FONT>
<BR>        <FONT SIZE=2>.</FONT>
<BR>        <FONT SIZE=2>.</FONT>
</P>
<BR>

<P><FONT SIZE=2>Now I can boot from IDE. but I have a question. </FONT>
<BR><FONT SIZE=2>It seems that current etherboot ide support doesn't support partition or filesystem. </FONT>
<BR><FONT SIZE=2>So now I just installed kernel image without creating any partition </FONT>
<BR><FONT SIZE=2>(dd kernel.elf of=/dev/hda), but it is too wasteful. Is there any way to place both kernel </FONT>
<BR><FONT SIZE=2>and root filesystem on the same ide disk? </FONT>
</P>

<P><FONT SIZE=2>-</FONT>
<BR><FONT SIZE=2>HeeChul Yun,          </FONT>
<BR><FONT SIZE=2>Embedded S/W Team at ETRI</FONT>
<BR><FONT SIZE=2>e-mail: hcyun@etri.re.kr</FONT>
<BR><FONT SIZE=2>phone: +82-42-860-1673</FONT>
</P>
<BR>

</BODY>