Re: accessing device memory



spamtrap@xxxxxxxxxx wrote:
>
>So how would one go about accessing PCI devices?

See, that's not the right question to ask. PCI is the tiniest part of
talking to a device. The typical driver has perhaps 20 or 25 lines of
PCI-specific code. The guts are in the specific device classes and the
specific devices. You might ask, "how would one go about talking to a
network device, specifically the XYZ Model 9999 NIC?"

>is it simpilist with
>ASM (or more allow more possibiltys should i say) or would it be more
>advisable to use some API?

It doesn't matter. The driver initialization process will get your a
pointer to the device's registers. Once you have a pointer, it's just as
easy to use either C or assembler, or FPC Pascal, if that shakes your tree.

>Im more interested in where someone would start on this type of
>exploration?

I'd start by looking at drivers in Linux. That way, you get real source
code for real drivers for real devices, although the comments are a bit
sparse.
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

.



Relevant Pages

  • Re: [lm-sensors] [PATCH] adxl345 accelerometer hwmon driver
    ... This driver can also be build as a module. ... * Client data ... * @param decimal Pointer to location to store decimal part. ...
    (Linux-Kernel)
  • [PATCH/RESEND] pci: dynids.use_driver_data considered harmful
    ... prevent the system administrator from telling a pci driver additional data ... the use of per-match-entry driver data is ... pointer, 14 use it for setting flags, and 98 use it as a table ... definitely into the port initialization code, ...
    (Linux-Kernel)
  • Re: NativeOverlapped, does it work??
    ... You need to keep that fixed in memory, and if you are using a fixed statement the memory location of the structure is subject to change. ... Instead, I would pin the structure (and then get the unsafe pointer to the structure), or marshal it to unmanaged memory, where you can hold onto the pointer for the life of the call. ... I'm trying to read some messages from a kernel mode mini-filter driver. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [Full-Disclosure] Win32 Device Drivers Communication Vulnerabilities + PoC for Symantec Norton A
    ... Function Codes/IRP Function Codes and IOCTRL/Defining I/O Control Codes): ... IRPs containing the I/O control code will supply a pointer ... describing the output buffer at Irp->MdlAddress. ... if the driver can be sent such a request only while it is ...
    (Full-Disclosure)
  • [RFC PATCH] PCI: remove initial bios sort of PCI devices on x86
    ... We currently keep 2 lists of PCI devices in the system, ... driver core, and one all on its own. ... Relying on BIOS ording for the binding of drivers to specific device ...
    (Linux-Kernel)