Skip to content

pci: Export pci functions through procfs and sysfs #58

Open

Description

@YusufKhan-gamedev

Aero should add a sysfs and procfs interface for PCI.

Activity

  1. YusufKhan-gamedev commented on Mar 14, 2022

    @YusufKhan-gamedev
    Author

    Maybe add /dev/<vendor id>/<device id> as another (non-standard) interface?

  2. Andy-Python-Programmer commented on Mar 14, 2022

    @Andy-Python-Programmer
    Owner

    What is the use case for these device interfaces? What is the user supposed to do with them? Are they readonly, etc... Elaborate more on the feature request.

  3. YusufKhan-gamedev commented on Mar 18, 2022

    @YusufKhan-gamedev
    Author

    What is the use case for these device interfaces? What is the user supposed to do with them? Are they readonly, etc... Elaborate more on the feature request.

    Full access to all of the functions (that would still be safe) through a fs interface, rw.

  4. pitust commented on Mar 18, 2022

    @pitust
    Contributor

    Just do standard sysfs for lspci or mini-lspci

  5. YusufKhan-gamedev commented on Mar 19, 2022

    @YusufKhan-gamedev
    Author

    Just do standard sysfs for lspci or mini-lspci

    +1 but a complementary (maybe easier to implement) nonstandard interface would be pleasant, + maybe a (easy to implement) non-standard ioctl interface?

  6. 48cf commented on Mar 19, 2022

    @48cf
    Collaborator

    ioctl is for userspace apps to be able to communicate with kernel and drivers running in the kernel, that would make no sense - if you want PCI access write a kernel module

  7. YusufKhan-gamedev commented on Mar 19, 2022

    @YusufKhan-gamedev
    Author

    ioctl is for userspace apps to be able to communicate with kernel and drivers running in the kernel, that would make no sense - if you want PCI access write a kernel module

    Yeah....but why would PCI access be locked in kernel mode? I would understand if it was exclusive to root but not kernel...

    afaik in bsd/linux it is modifiable through root with sysfs

  8. YusufKhan-gamedev commented on Mar 20, 2022

    @YusufKhan-gamedev
    Author

    Just do standard sysfs for lspci or mini-lspci

    Im a bit iffy on in the standard sysfs. seems very redundant, All I would want would be /sys/ vendor /device id/<read, write, foo, bar>

  9. Dennisbonke commented on Mar 20, 2022

    @Dennisbonke

    Considering a lot of Linux userland that uses /sys and /proc expect a certain thing there, it makes the most sense to either not do this at all, or mirror Linux for the biggest part, merely adding things aero specific as required or wanted. Standard sysfs implemented on an as needed and as possible basis is IMHO the best way to go, same for procfs.

  10. YusufKhan-gamedev commented on Mar 20, 2022

    @YusufKhan-gamedev
    Author

    Considering a lot of Linux userland that uses /sys and /proc expect a certain thing there, it makes the most sense to either not do this at all, or mirror Linux for the biggest part, merely adding things aero specific as required or wanted. Standard sysfs implemented on an as needed and as possible basis is IMHO the best way to go, same for procfs.

    Yeah, but the (pci) standard is awful imho, i2(/3)c, usb, firewire, is good but the pci proc/sysfs standard is abhorrent(imho UNIX is a curse but thats a separate thing).

  11. Dennisbonke commented on Mar 20, 2022

    @Dennisbonke

    Considering Aero is UNIX like, and likely won't write its own userland (at least not fully like ToaruOS or SerenityOS), the in your eyes abhorrent standard is the one to follow to maximize portability. UNIX being a curse is a yikes for you I'm afraid, because the aforementioned UNIX likeness of Aero. Then again, be the change you want to see, and implement a better API yourself. I'm sure contributions like that are welcomed.

  12. pitust commented on Mar 20, 2022

    @pitust
    Contributor

    Just do standard sysfs for lspci or mini-lspci

    Im a bit iffy on in the standard sysfs. seems very redundant, All I would want would be /sys/ vendor /device id/<read, write, foo, bar>

    there is a reason that isn't there, you know - driving pci devices is hard, and you can't just write values into the configuration space. Also, text is not very fun to work with, you would probably want to use ioctls and at that point why are you even using sysfs

  13. StaticSaga commented on Mar 20, 2022

    @StaticSaga

    Generally, things that use PCI are too performance sensitive even for the overhead of USB, so you won't be able to write a useful userspace driver using a text-based interface.
    Userspace drivers for PCI(e) devices, like DPDK for network cards, aren't meant for general purpose usage but only for extremely high performance scenarios (which is not something Aero is currently targetting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-kernelCategory: kernel

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions