<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">At some point you need to implement the accessor functions for reading/writing PCI space and device memory. ACPI doesn’t do any of that for you (it doesn’t
know how – the mappings are OS specific). Part of the ACPI host code you need to implement is for performing those accesses. The ACPICA code is really just a bytecode interpreter with some knowledge of the ACPI data structures. It doesn’t directly implement
device access.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You can either use the traditional IO ports, or the PCIe memory-mapped config space region. Barrelfish does both depending on the device and some heuristics.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cheers,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Andrew<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> hilfialkaff@gmail.com [mailto:hilfialkaff@gmail.com]
<b>On Behalf Of </b>hilfi alkaff<br>
<b>Sent:</b> Monday, 15 August, 2011 12:57<br>
<b>To:</b> Roscoe Timothy<br>
<b>Cc:</b> barrelfish-users@lists.inf.ethz.ch; Baumann Andrew<br>
<b>Subject:</b> Re: [Barrelfish-users] Details regarding pci support with acpi<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">I seee. Do you know whether it's possible to use pure acpi functions only w/o reading the conf space manually? I'm just wondering how much could I acpi-ed my kernel<br>
<br>
Hilfi Alkaff<o:p></o:p></p>
<div>
<p class="MsoNormal">On Mon, Aug 15, 2011 at 11:42 AM, Timothy Roscoe <<a href="mailto:troscoe@inf.ethz.ch">troscoe@inf.ethz.ch</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal"><br>
Hilfi,<br>
<br>
We do low-level PCI reads/writes to configuration space just like<br>
everyone else does - the only difference is the use of the Mackerel<br>
DSL to specify register formats. pci_hdr1.dev is a Mackerel<br>
specification of the PCI type 1 (bridge) header; the format is<br>
documented in the Mackerel manual (Technical note #2). If you read<br>
that documentation, plus the pci_hdr1.dev file, you'll see that<br>
pci_hdr1_vendor_id_rd() is the function to read the vendor id field of<br>
a PCI config header.<br>
<br>
-- Mothy<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
At Mon, 15 Aug 2011 11:03:41 -0700, hilfi alkaff <<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>> wrote:<br>
> Hi,<br>
><br>
> I have some follow up questions regarding the same topic. how do you guys<br>
> read the device ID, vendor ID of the pci? I see this function<br>
> pci_hdr1_vendor_id_rd() but I don't really understand about the .dev file<br>
> format. Do you guys read from the pci conf headers or using acpi commands?<br>
><br>
> Thanks,<br>
> Hilfi Alkaff<br>
><br>
> On Thu, Aug 4, 2011 at 5:01 PM, hilfi alkaff <<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>>wrote:<br>
><br>
> > Oh, of course, how I did not realize that, >.<,, Thanks!<br>
> ><br>
> > Hilfi Alkaff<br>
> ><br>
> ><br>
> > On Thu, Aug 4, 2011 at 4:16 PM, Baumann Andrew <<a href="mailto:andrewb@inf.ethz.ch">andrewb@inf.ethz.ch</a>>wrote:<br>
> ><br>
> >> Hi,****<br>
> >><br>
> >> ** **<br>
> >><br>
> >> I’m not sure what you mean by this, since pci_add_root() is a function in<br>
> >> Barrelfish and not ACPICA, but the general answer to your question is<br>
> >> probably that you can’t use the ACPICA reference in isolation: you also need<br>
> >> to grok parts of the PCI spec (or just the bad Mindshare books), the ACPI<br>
> >> spec, the PNPBIOS spec (mainly just for the device IDs), and if in doubt<br>
> >> also the source code to something clean like FreeBSD to make sense of it<br>
> >> all.****<br>
> >><br>
> >> ** **<br>
> >><br>
> >> Good luck :)****<br>
> >><br>
> >> ** **<br>
> >><br>
> >> Andrew****<br>
> >><br>
> >> ** **<br>
> >><br>
> >> *From:* hilfi alkaff [mailto:<a href="mailto:hilfialkaff@berkeley.edu">hilfialkaff@berkeley.edu</a>]<br>
> >> *Sent:* Thursday, 04 August, 2011 15:47<br>
> >> *To:* <a href="mailto:barrelfish-users@lists.inf.ethz.ch">barrelfish-users@lists.inf.ethz.ch</a><br>
> >> *Subject:* [Barrelfish-users] Details regarding pci support with acpi****<br>
> >><br>
> >> ** **<br>
> >><br>
> >> Hi,<br>
> >><br>
> >> I'm an undergraduate currently working on a research operating system and<br>
> >> I'm having problems when initializing pci and mapping its interrupts with<br>
> >> ACPI. I'm wondering how do you guys figure out the pci_add_root() function<br>
> >> because I could not find any meaningful details in Intel's acpica reference.<br>
> >><br>
> >> Thanks,<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">> >> Hilfi Alkaff****<br>
> >><br>
> ><br>
> ><br>
><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>