OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 3:49 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: [SOLVED] PCIe Development Board to know more about PCI dev
PostPosted: Wed Aug 04, 2021 4:43 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
Have any of you tried to buy a PCIe dev board to know more about PCI development ?
https://www.aliexpress.com/item/1005002591885426.html

I tend to believe that similar to my knowledge in USB dev with development board such as STM32 Dark Pill that I am able to use it to create a USB driver (host and master) from scratch, I would be able to do the same for GPU driver if I know about the firmware code inside PCIe chip.

Thus being able to communicate with like I do with HID protocol for USBDevice.


Last edited by Rukog on Sun Aug 08, 2021 4:54 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 5:53 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
Buying a PCIe dev board to learn how to program PCI on the host side is like buying a spare engine to learn how to drive.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 6:12 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
I think a better idea is to buy an FPGA dev board from Xilinx (or some other distributor). The one I have comes with a PCIe bus, a network chip, a fiber kit, USB & graphics (HDMI). It also interfaces with high-speed ADCs & DACs. They sell it rather cheap and it includes a license for their commercial FPGA design toolkit so you can do professional stuff. There are good tools for debugging the design too, even if such tools operate slightly differently than your typical application debugger.

With such a kit, you can learn how both sides of PCIe operate and do your own designs too.

I programmed my design with Verilog and then wrote a driver for my OS to handle the device. The design actually doesn't work with Windows since Windows has no idea how to operate it (no driver).


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 8:17 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
rdos wrote:
I think a better idea is to buy an FPGA dev board from Xilinx (or some other distributor). The one I have comes with a PCIe bus, a network chip, a fiber kit, USB & graphics (HDMI). It also interfaces with high-speed ADCs & DACs. They sell it rather cheap and it includes a license for their commercial FPGA design toolkit so you can do professional stuff. There are good tools for debugging the design too, even if such tools operate slightly differently than your typical application debugger.

With such a kit, you can learn how both sides of PCIe operate and do your own designs too.

I programmed my design with Verilog and then wrote a driver for my OS to handle the device. The design actually doesn't work with Windows since Windows has no idea how to operate it (no driver).


Attachment:
d.jpg
d.jpg [ 65.76 KiB | Viewed 6232 times ]

big OOF :shock:

Don't you have a cheaper devkit please :lol:

I do not need horsepower, I just need to figure out how PCIe are programmed

Is this one will do the same job? https://www.aliexpress.com/item/1005002863348126.html


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 10:39 am 
Offline
Member
Member
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 264
Location: London, UK
Doesn’t the RaspberryPi 4 have a PCIe bus? Can’t you experiment with that?

_________________
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 11:33 am 
Offline
Member
Member

Joined: Sun Aug 01, 2021 5:24 pm
Posts: 51
bloodline wrote:
Doesn’t the RaspberryPi 4 have a PCIe bus? Can’t you experiment with that?


Too bad, it's just the PCIe port and doesn't act like a PCIe device.


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 11:49 am 
Offline
Member
Member
User avatar

Joined: Tue Sep 15, 2020 8:07 am
Posts: 264
Location: London, UK
Rukog wrote:
bloodline wrote:
Doesn’t the RaspberryPi 4 have a PCIe bus? Can’t you experiment with that?


Too bad, it's just the PCIe port and doesn't act like a PCIe device.


Understood, sorry I got the wrong end of the stick there! You want to develop a PCIe device, that does sound interesting!

_________________
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su


Last edited by bloodline on Wed Aug 04, 2021 3:00 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 12:54 pm 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
Rukog wrote:
rdos wrote:
I think a better idea is to buy an FPGA dev board from Xilinx (or some other distributor). The one I have comes with a PCIe bus, a network chip, a fiber kit, USB & graphics (HDMI). It also interfaces with high-speed ADCs & DACs. They sell it rather cheap and it includes a license for their commercial FPGA design toolkit so you can do professional stuff. There are good tools for debugging the design too, even if such tools operate slightly differently than your typical application debugger.

With such a kit, you can learn how both sides of PCIe operate and do your own designs too.

I programmed my design with Verilog and then wrote a driver for my OS to handle the device. The design actually doesn't work with Windows since Windows has no idea how to operate it (no driver).


Attachment:
d.jpg

big OOF :shock:

Don't you have a cheaper devkit please :lol:


My complete dev system ended up at around $5000, so it's cheap. :-)
I also bought an 1GHz ADC & DAC (that fits on my evaluation board) and built a 12-core AMD Threadripper based computer with 128 GB RAM. :-)

Rukog wrote:
I do not need horsepower, I just need to figure out how PCIe are programmed

Is this one will do the same job? https://www.aliexpress.com/item/1005002863348126.html


It might. You should try to figure out if the FPGA tools from Altera are part of the package, or if you need to buy them separately (which could cost a fortune). Some designs also operate by simulating CPU cores in the FPGA, and that kind of stuff is not at all as fast as native Verilog.


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 1:03 pm 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
bloodline wrote:
Doesn’t the RaspberryPi 4 have a PCIe bus? Can’t you experiment with that?


That would require you to use Linux, and a real OS developer doesn't want to rely on a competitive OS. :-)

I think there are some advanced embedded processors that have PCIe device functions, but designing with them is very complicated. You would need an evaluation board. And you might not get to look at the PCIe basics either since it is probably implemented in some chipset. FPGAs implement PCIe with IPs (code libraries) that are very low level. You can control everything. :-)


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Wed Aug 04, 2021 5:48 pm 
Offline
Member
Member
User avatar

Joined: Sun Apr 30, 2017 12:16 pm
Posts: 68
Location: Poland
rdos wrote:
That would require you to use Linux, and a real OS developer doesn't want to rely on a competitive OS. :-)

Or you can duplicate what the Linux code does, which is what TianoCore, U-Boot, and the BSDs have done. ;) (As a side note, I've tried doing that but I've been unsuccessful, instead getting an SError on almost any register read)

_________________
Working on managarm.


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Thu Aug 05, 2021 1:03 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
qookie wrote:
rdos wrote:
That would require you to use Linux, and a real OS developer doesn't want to rely on a competitive OS. :-)

Or you can duplicate what the Linux code does, which is what TianoCore, U-Boot, and the BSDs have done. ;) (As a side note, I've tried doing that but I've been unsuccessful, instead getting an SError on almost any register read)


I don't believe in duplicating any code, be it tutorials or Linux. By deciding to write an OS, I also decided to do my own choices for everything. I might use interesting ideas other people have, possibly improve on them too, but reusing code is not for me. :-)


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Thu Aug 05, 2021 4:18 am 
Offline
Member
Member

Joined: Thu May 17, 2007 1:27 pm
Posts: 999
Well, good luck with non-x86 or more complicated x86 devices then, because in many situations, the Linux driver is the only documentation. Which does not mean that you should re-use it's code (that'd also be illegal if your project is not GPL, like in the case that qookie posted above -- TianoCore is permissively licensed), but you will have to read Linux code to write your own driver. Devices like Intel iGPUs have undocumented registers and quirks that make it impossible to use the hardware if you don't know about them.

_________________
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].


Top
 Profile  
 
 Post subject: Re: Buying a PCIe Development Board to know more about PCI d
PostPosted: Thu Aug 05, 2021 5:00 am 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3192
Korona wrote:
Well, good luck with non-x86 or more complicated x86 devices then, because in many situations, the Linux driver is the only documentation. Which does not mean that you should re-use it's code (that'd also be illegal if your project is not GPL, like in the case that qookie posted above -- TianoCore is permissively licensed), but you will have to read Linux code to write your own driver. Devices like Intel iGPUs have undocumented registers and quirks that make it impossible to use the hardware if you don't know about them.


I suppose using quirks from Linux drivers would be ok (I use the RTL network chip quirks in my OS). However, I would not even dream about implementing a network interface that matches that of Linux in order to be able to reuse the code. For one, I find this interface very poor, so I wouldn't want to have it anyway.

Besides, many chips without documentation don't have open-source drivers, and so Linux doesn't help much there. WiFi chips come to mind.

As for GPUs, I currently use LFB, either through VBE or UEFI, which also means I try to avoid Intel as they have extremely poor LFB performance. Their BIOSes (and UEFIs too) won't give you the right resolutions either, and so if you use 16:9 or other non-standard VGA modes, then you cannot use Intel. Asking the BIOS manufacturer to fix it won't work either since Intel will not fix it for them either.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 64 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group