-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PCI #23
PCI #23
Conversation
I think while enumerating, PCI device should be placed in /dev/pci. And userspace interacte with then through ioctl but I still need to read more about PCI to see if this a good idea |
typedef struct { | ||
} pci_dev_t; | ||
|
||
// vim:set ts=4 sw=4 et: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't include your text editor configuration in the source file 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it is common for people to do this when they use VIM.
u32 lfunc = (u32)func; | ||
u16 tmp = 0; | ||
address = (u32)((lbus << 16) | (lslot << 11) | (lfunc << 8) | (offset & 0xfc) | ((u32)0x80000000)); | ||
outw(0xCF8, address); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0xCF8
don't use magic value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is based on the snippet function on the osdev wiki.
} | ||
|
||
void pci_setup() { | ||
// TODO: cache devices (probably should be done on a thread for speed improvement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use FILESYSTEM_MKDEV(device_name, device_object)
to mount a device to /dev
like /dev/zero 😉
Currently errors
|
This because you are working on the master branch, juste checkout the develop branch and it should compile 😉 |
Maybe useful or not, but I wrote a pci driver well before skiftOS, which you might want to check. 😉 https://github.com/maker-dev/core-one/commit/319c1eace4405eab813237911990f5edf13800d2 |
Adding PCI, currently it doesn't do much but I plan to add more code I just need to know how the devs want it to work.