FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
pci.h
Go to the documentation of this file.
1
11
12#ifndef PCI_H
13#define PCI_H
14
15#include <basics.h>
16#include <hal.h>
17#include <graphics.h>
18#include <drivers/rtl8139.h>
19#include <debugger.h>
20#include <ahci.h>
21#include <nvme.h>
22#include <hal.h>
23#include <isr.h>
24#include <pci_id.h>
25
26extern cstring display_adapter_name;
27extern cstring GPUName[1]; //Max 2 GPUs allowed
28extern string using_graphics_card;
29extern int64* graphics_base_Address;
30extern int total_devices;
31
32// Define the base address for the PCI configuration space
33#define PCI_CONFIG_ADDRESS 0xCF8
34#define PCI_CONFIG_DATA 0xCFC
35
36typedef void (*pci_probe_fn)(uint8_t bus, uint8_t slot, uint8_t function);
37
38typedef struct {
39 int16 bus;
40 int16 slot;
41 int16 func;
43
56int16 pci_read_word(int16 bus, int16 slot, int16 func, int16 offset);
57
66int16 getVendorID(int16 bus, int16 device, int16 function);
67
76int16 getDeviceID(int16 bus, int16 device, int16 function);
77
86int16 getClassId(int16 bus, int16 device, int16 function);
87
96int16 getSubClassId(int16 bus, int16 device, int16 function);
97int8 getProgIF(int16 bus, int16 device, int16 function);
98
104
114int32 pci_config_read_dword(int8 bus, int8 slot, int8 func, int8 offset);
115void pci_config_write_dword(int8 bus, int8 slot, int8 func, int8 offset, uint32_t value);
116
126int32 get_ahci_bar_address(int8 bus, int slot, int func, int bar_num);
127
128#endif
Header definitions and structures for the AHCI Driver.
This is a basic header files with FrostWing specific short forms and basically a good for life header...
The headers files for E9 hack.
Contains all the print functions.
Header file for Hardware Abstraction Layer -> Source from GoGX OS.
Interrupts handler header.
int16 getDeviceID(int16 bus, int16 device, int16 function)
Gets the Device ID from PCI.
int32 pci_config_read_dword(int8 bus, int8 slot, int8 func, int8 offset)
Function to read a 32-bit value from the PCI configuration space.
int16 getVendorID(int16 bus, int16 device, int16 function)
Gets the Vendor ID from PCI.
void probe_pci()
Scans (Probes) PCI Devices.
int16 getSubClassId(int16 bus, int16 device, int16 function)
Gets the Sub-class ID from PCI.
int32 get_ahci_bar_address(int8 bus, int slot, int func, int bar_num)
Gets the AHCI bar address.
int16 pci_read_word(int16 bus, int16 slot, int16 func, int16 offset)
Read a 16-bit value from a PCI configuration register.
int16 getClassId(int16 bus, int16 device, int16 function)
Gets the Class ID from PCI.
The list of all officially recognized devices.