Dealing with peripherals [DRAFT]Created at 2017-01-13T20:01:33.000Z
Assume: x86 and PCI
- check spec of the location of the bus memory for periperal
- ioread, iowrite
- (how about DMA ? is it the concept specific to certain bus (e.g. PCI) ?)
- /proc/iomem, /proc/ioports
- firmware: (how is configuration space setup ?)
allocate I/O and memory regions of the device (if BIOS did not)?
- is it allocation to physical address ?
- how device (5bit), function (3bit) is defined ? (is this hardcoded on the board ?)
- how to talk to pci device => how to talk to pci bus => how to talk to pci controller or whatever managing bus
- how to manage device pci configuration registers ?
- what is "memory controller" showing up as PCI device
other "modern" bus if there is ?
Example: keyboard device
- device identification => load driver => initialize device =>
Example: video card
- is io port hard-coded to hardware ?
- I mean, which IO port connects to what is defined by what ? (intel board spec or pc vendor ?)
- what is that even ?
- memory mapped
- how much is it different if we use ARM kernel ?
- definition of SoC ("platform bus" vs "pci bus" ?)
- LDD3 (Chapter 9: Communicating with Hardware)