Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Aug 2001 17:51:52 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        djohnson <johnson@faradayco.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: PCI Enumeration 
Message-ID:  <200108260051.f7Q0prn21818@mass.dis.org>
In-Reply-To: Your message of "Sat, 25 Aug 2001 08:31:31 MDT." <3B87B6C3.E5DDBB12@faradayco.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I am working on an embedded FreeBSD (4.2) device with proprietary PCI
> devices on the bus..  I don't have a FreeBSD background and am having
> trouble finding the right underlying code to hook into, for what we need
> to do.  Basically two things need to happen:
> 
> 1) Need to be able to enumerate the PCI bus and printf as much
> information about bus devices as possible (sort of like what
> pcisupport.c does).  Preferrably this would do the enumeration without
> going to BIOS for it, but BIOS calls may be acceptable.  So, which of
> the several (sort of undocumented) underlying pci code modules are
> preferred, for: (a) getting the raw data, and (b) for converting it to
> human form?

It's not clear where exactly you want to do this, but look at the 
'pciconf' utility, which already knows how to read PCI configuration 
space via the defined kernel interfaces.

> 2) I also need to be able to perform basic write-read tests on devices
> on the bus, both in memory space and I/O space.  Upsetting the hardware
> during these tests is acceptable.

I/O space is easy, but memory space is hard.  Userspace access to 
physical memory is a big no-no in the *nix world.

Typically for this you'd want to write a device driver (build it as a 
loadable module) that attaches to the hardware you want to test.  There 
are lots of examples of this in the system already.

If you have more specific questions, feel free to ask them...

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108260051.f7Q0prn21818>