help writing pci firmware

For a project that I'm working on I want to write a low level PCI driver, but I can't seem to find any free/cheap documentation on PCI firmware specifications. I came across the "pci firmware specification 3.0" manual but this costs USD $1000 :eek:. I am not developing a commercial product therefore I can't afford to shell out this much money. Also, one person told me to read the PCI driver sources (that came with the Linux kernel), but I don't want to rummage through hundreds of lines of code. So could someone provide an easier alternative?

You might find some illuminating stuff in the Documentation folder of the Linux kernel even if you don't find the source code helpful. I'm utterly unable to help with specifics though, having never played with the PCI bus.

I looked in there but its generally Linux specific. I wanted something a bit more generic, because I'm not using Linux for my project. And also I need really low, level access info, as in address space, etc.

---------- Post updated 01-24-11 at 06:14 PM ---------- Previous update was 01-23-11 at 09:35 PM ----------

anyone?

Could you give us an idea of what O/S this PCI driver will run under ? Most O/S are completely different when writing drivers, so it is difficult to know where to point you without this info.

Its not running on any OS, its going to be in assembly. If it sounds crazy that cause its an experiment. :slight_smile:

What hardware will this PCI board be plugged into then ? Its very difficult to write a driver if you have no O/S at all...infact nearly impossible

Well its not really a driver, like I said its a firmware which basically interfaces the PCI slots in particular the video card. The pc I plan to experiment with, specs are:

forgive me if the information I'm giving is not what you want, but I really don't know how PCI interface works other than it uses DMA.

So it is a PC ? What O/S is the PC running ?
If you are writing PCI firmware to create a PCI card from scratch, you would then have to write the driver on the O/S side to interface that into the O/S on the pc, otherwise its useless. I guess your first stop would be the PCI specification.
Good luck!

Like I said it's not going to run on any OS, I plan to use a boot floopy, load grub, let grub load the "firmware/interface whatever you want to call it", then the firmware/interface will interface the PCI device. Thats it. And this firmware/interface will be written in assembly. Basically all I want to know is low level access such as address regions, and perhaps protocols.

NeurOn, please compose your thoughts so that people do not waste their valuable time trying to decipher what you mean. Ongoing vagueness on your part is not appreciated.

Before anybody on this forum can ever begin to assist you, you need to decide what firmware your proposed driver code is going to run on, how you are going to program the firmware, and what hardware your low-level PCI driver is going to work with.

Oh, and which particular PCI standard are you planning to develop against

---------- Post updated at 06:16 PM ---------- Previous update was at 06:07 PM ----------

BTW, have you figured out which type of PCI bus is in your PC?

OK, so you are writing some interfacing software in x86 assembly (firmware is code that lives in (e)prom on the PCI card itself, which I guess this isnt).

So you need to read up on GRUB (how that calls the x86 to start the boot sequence, and what it does before your code is called), and what will be available for you to use (BIOS calls, Software interrupts, dynamic memory, 32/64 bit, etc). Then you will need to reset the PCI bus, and initialize all the hardware you will need to talk to the PCI card (timers, PCI bridge, etc). Then you need to code the interaction with the PCI card (and the other hardware you will need). This is all stuff that O/S do when starting up, and I would say that you probably dont have a lot of choice about where to read about that, and 99% of it will be PC specific. My recommendation would be to look at the "Minix" sources. They are a lot simpler than Linux and are for teaching purposes, and will be relatively simplistic when they start the boot process. Even so, I think this is a large undertaking and your learning curves will be massive. I hope this helps you along your way...

dude this is exactly what I'm looking for. Thanks for the help.
Oh, and sorry about the vagueness of my questions, I'll try to do better next time

It seems to me that you should be looking at something like coreboot to execute your proposed payload rather than GRUB.

Ah, this too might help.