OSDev.org

The Place to Start for Operating System Developers
It is currently Sun May 19, 2024 3:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Enabling PCI-E I/O space access for serial port
PostPosted: Sat Dec 31, 2022 2:22 am 
Offline

Joined: Tue Jul 12, 2022 2:19 am
Posts: 3
Hello,

I am trying to use PCI-E serial port with UEFI. Unfortunately I cannot initialize serial port.
I checked with GRUB if it is working and while booted in i386-pc (legacy mode), I can configure serial port and everything works fine. However, when I boot x86_64-efi GRUB it says "serial port isn't found" when I try to access it same way I do under CSM.

I also displayed information about serial port device under EFI shell with `pci` command and it reports "(00) I/O space access enabled: 0", what probably is my problem.
I would like to ask if it is possible to enable I/O space access and use that PCI-E adapter for debugging purposes with EFI bootloader?


Top
 Profile  
 
 Post subject: Re: Enabling PCI-E I/O space access for serial port
PostPosted: Tue Jan 03, 2023 9:51 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5173
prontoguy wrote:
I would like to ask if it is possible to enable I/O space access and use that PCI-E adapter for debugging purposes with EFI bootloader?

Before or after you exit boot services?

Before you exit boot services, you should use the Serial I/O Protocol to access it.

After you exit boot services, you can locate the adapter by enumerating PCI and enable its port-mapped I/O by setting bit 0 of the command register in the device's PCI configuration space.


Top
 Profile  
 
 Post subject: Re: Enabling PCI-E I/O space access for serial port
PostPosted: Sun Sep 24, 2023 9:11 am 
Offline
User avatar

Joined: Wed Mar 02, 2016 10:23 am
Posts: 18
I use PCIe Serial card for debug WinXP 64-bit on pure UEFI. For debugging (WinDbg) to work, you need:

  • the PCIe Serial card must support access Port-Mapped I/O (PMIO) (or maybe MIXED Port-Mapped I/O (PMIO) + Memory-Mapped I/O (MMIO)
  • under UEFI Shell you need to set bit 0 of command register in PCI config space e.g. my card has bus dev func 04 00 00:
    Code:
    mm 04000004 1 -pci
  • debugging must be enabled in the BCD file - for my card I need speed 14400
  • kdcom.dll must be patched - instead of the I/O address for COM1 03F8 the PCIe card address - mine has D000
  • in WinDbg I need to set the speed to 115200

My card have higher CLK and therefore it must be so 14400 in BCD & 115200 in WinDbg

Read this my topic: I am looking for a PCIe card for WinXP debugging

Legacy BIOS WinDbg success: https://www.wincert.net/forum/topic/18477-i-am-looking-for-a-pcie-card-for-winxp-debugging/?do=findComment&comment=137843
Pure UEFI (CSM Disabled) WinDbg success: https://www.wincert.net/forum/topic/18477-i-am-looking-for-a-pcie-card-for-winxp-debugging/?do=findComment&comment=138077

Edited

I have built a SerialDxe.efi driver that enable I/O access (no need use mm 04000004 1 -pci anymore) but to debug Windows I still have to use baudrate 14400 in BCD and 115200 in Windbg:
SerialDxe.efi driver for my PCIe serial card


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: eekee, Google [Bot] and 33 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