Code:
out 80h,al
does not work anymore on newer motherboards, but writing word or doubleword works, it just writes the low byte (AL) and the higher bits are ignored:
Code:
out 80h,eax
Although there are TL631 cards available, they display only the last one hexadecimal character.
There is a better solution which records the whole stream of data written into i/o port 80h.
ASUS motherboards have 6-1 header named COM_DEBUG which I'm using successfully.
ASROCK has a 4-1 header UART1. I did not test it yet.
The ASUS pinout is here:
https://dlcdnets.asus.com/pub/ASUS/mb/E ... UM_WEB.pdfchapter 2-17
Attachment:
COM_DEBUG_ASUS.png [ 3.18 KiB | Viewed 2079 times ]
The motherboard from the above link has also a jumper to enable the debug port to work (at the cost of redirection of TxD from COM3 to COM_DEBUG - chapter 2-9) so for your motherboard you should very likely adjust some jumper or change some menu in UEFI setup.
For ASROCK I found a settings in UEFI menu to enable the UART1:
https://download.asrock.com/Manual/H510M-HDVM.2.pdfQuote:
Serial Port/UART Switch
Select Serial Port or UART for Port 80 debug.
The ASROCK pinout is described here without any guarantee:
https://www.reddit.com/r/buildapc/comme ... re_i_have/Quote:
There's three pins, pinout appears to be:
1. 5.1V
2. 3.7V
3. Empty
4. GND
and this:
Quote:
It spews random data on pin #2 (3.7V, 115200 8N1)
Then you need a USB to TTL adapter or real serial port on your target machine which receives the data. Something like this, it is very cheap, this one costed less than 2 EUR
https://pajenicko.cz/prevodnik-wch-ch340g-usb-na-ttl-uartBuy a TTL which chip is supported in your OS and download necessary drivers to make it working.
Connect GND (pin 2) from MB to GND pin of TTL (the black cable). Connect TxD (pin 1, transmit data) from MB to RxD pin (receive) of TTL (the white cable, sorry for the white color but I did not have any other color)
Attachment:
IMG_20240116_110041.jpg [ 117.24 KiB | Viewed 2079 times ]
On the target machine run putty utility to read the data. If your target machine runs ms win, download it e.g. from here:
https://www.chiark.greenend.org.uk/~sgt ... atest.htmlIf your target machine runs ms win, launch cmd.exe and this command:
Quote:
reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM
The output of the command looks like:
Quote:
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
\Device\Serial2 REG_SZ COM4
Use the putty to record data and also to save a log file as the data are binary (but displayed ASCII), so for reading full hexa values you need to look into the log file using binary viewer. The data are transmitted using this settings:
Code:
baudrate: 115200
data bits: 8
stop bits: 1
parity: none
flow control: none
Attachment:
putty.png [ 76.75 KiB | Viewed 2079 times ]
This is useful for finding a problem when starting a machine or for reversing a firmware (you can find which uefi module sent a hexa code of your interest e.g. using UEFItool and its search menu).
I hope this will be useful for at least someone. It is required in unusual and strange situation. All my machines have serial port, but I have to let it be used by hyper-v and kernel debugger, graphics card is used by guest OS, so for my parent hypervisor this is a way to go.
Here a video (quite low quality)
https://youtu.be/Gnm_tuARqVIHere the uefi debugging tool with the capability of writing into i/o port 80:
https://board.flatassembler.net/topic.php?t=9689