Brennen, Again I wanted to thanks you for the help you have provided thus far.
After digging in to accessing pci devices in qemu I found that to virtualize PCi hardware you first need a board that supports VT-d. The Asus 885M-E motherboard only supports VT-x which allows for virtualization of 64bit OSes but doesn't support direct access to I/O. So this morning I started using Gigabyte H110N motherboard that does support VT-d. It took a bit of time to get the device to start using the vfio-pci kernel driver which allows qemu to access the card. Once that was complete I can now start qemu with "-device vfio-pci,host=01:00:0" and the qemu session now can see the card. The qemu_pci_init now can see the card and the Bar0 & Bar1 memory addresses. Using that I have written a very simple test program that can be enabled using "make menuconfig" called cms. Running cms from the nsh prompt access the card and turns on the isolated digital output then reads the state and reverses it. To continue my testing I would like to get the program cms to autorun that way I can at least test the I/o functionality. I will modify my program which is using hardcoded memory addresses to use the address found during a scan of the PCI configuration data so when it boots I can find the correct address as I assume it will be different when not in qemu I have tried using com1 (0x3f8) connected to coolterm on another computer to see if any terminal could be accessed but haven't had any success. I know you said you were going to work on getting a console up but having a serial terminal would work for now to keep my progress moving. -Robert -----Original Message----- From: Brennan Ashton <bash...@brennanashton.com> Sent: Friday, July 31, 2020 5:21 AM To: dev@nuttx.apache.org Subject: Re: AMD64 arch Robert, I dug into this a little more, and I am fairly confident that the PCI subsystem will find your device since it properly traverses the bridges and can identify multiple buses. A couple things that are probably important to check, you are not using the COM port on your motherboard for this testing right? There is no support for a VGA console right now and the OS is expecting to be able to write to the physical serial port. The warning you are getting in Grub is because the OS is asking for the bootloader to put the VGA controller in Text Mode, unfortunately that warning you are getting about the console is letting us know that the Grub is using UEFI which does not allow switching to text mode. I had implemented a VGA text mode console, but we cannot use this because of this limitation. I started adding support for the graphics mode so we can get a console drawn on the screen to help with debugging, but that is going to have to be a weekend project. I did get the graphics mode configured so I suspect it will not be too bad, but there are a lot of moving bits. --Brennan On Thu, Jul 30, 2020 at 2:24 PM Brennan Ashton <bash...@brennanashton.com> wrote: > > Robert, > I'll take a look this evening and get back to you. > > This has run on bare hardware before, as well as in a jailhouse cell, > so it should be fairly close to running on your hardware. I do most > of my testing inside of QEMU since it is much easier for me to attach > the debugger, but I'll see if I can still get this running directly on > my NUC. > > As for the multiple PCI busses I will need to look at that as well. > From what I remember the enumeration code structures handle the bus > id, but I would need to look at how we identify the buses that we > scan. > > This is actually all timely because I just got some PCIe hardware that > I have been waiting for for a few months, so let's see what we can do. > > --Brennan NOTICE: This e-mail message and all attachments transmitted with it may contain trade secrets and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by telephone at 407-679-9716, and delete this message and all copies and backups thereof. Thank you