x86 - Converting bin to hex in assembly - Stack Overflow

Cant passthrough RX 5700 XT

I was trying to passtrough my only gpu but there seems to be a problem with vfio.
CPU: Ryzen 1700X
GPU: Sapphire pulse rx 5700 xt
Mobo: Asus Rog strix X370-F
Bios options: SVM : Enabled, SR-IOV : Disabled
OS: arch , kernel 5.2.11-arch1-1-ARCH
Kernel parameters: "amd_iommu=on iommu=pt loglevel=3 quiet"

mkinitcpio.conf (comments are ommited)
MODULES=(vfio_pci vfio vfio_iommu_type1 vfio_virqfd) BINARIES=() FILES=() HOOKS=(base udev autodetect modconf block filesystems keyboard fsck) 
/etc/modprobe.d/vfio.conf
options vfio_pci ids=1002:731f,1002:ab38 
iommu groups
IOMMU Group 0: 00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] IOMMU Group 1: 00:01.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453] IOMMU Group 10: 00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454] IOMMU Group 11: 00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 59) 00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51) IOMMU Group 12: 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 0 [1022:1460] 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 1 [1022:1461] 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 2 [1022:1462] 00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 3 [1022:1463] 00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 4 [1022:1464] 00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 5 [1022:1465] 00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 6 [1022:1466] 00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Data Fabric: Device 18h; Function 7 [1022:1467] IOMMU Group 13: 01:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 [144d:a808] IOMMU Group 14: 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset USB 3.1 xHCI Controller [1022:43b9] (rev 02) 02:00.1 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset SATA Controller [1022:43b5] (rev 02) 02:00.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] X370 Series Chipset PCIe Upstream Port [1022:43b0] (rev 02) 03:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 03:02.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 03:03.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 03:04.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 03:06.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 03:07.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] 300 Series Chipset PCIe Port [1022:43b4] (rev 02) 04:00.0 USB controller [0c03]: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller [1b21:1242] 05:00.0 Ethernet controller [0200]: Intel Corporation I211 Gigabit Network Connection [8086:1539] (rev 03) IOMMU Group 15: 0a:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1478] (rev c1) IOMMU Group 16: 0b:00.0 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1479] IOMMU Group 17: 0c:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT] [1002:731f] (rev c1) IOMMU Group 18: 0c:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 HDMI Audio [1002:ab38] IOMMU Group 19: 0d:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Raven/Raven2 PCIe Dummy Function [1022:145a] IOMMU Group 2: 00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453] IOMMU Group 20: 0d:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Platform Security Processor [1022:1456] IOMMU Group 21: 0d:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) USB 3.0 Host Controller [1022:145c] IOMMU Group 22: 0e:00.0 Non-Essential Instrumentation [1300]: Advanced Micro Devices, Inc. [AMD] Zeppelin/Renoir PCIe Dummy Function [1022:1455] IOMMU Group 23: 0e:00.2 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 51) IOMMU Group 24: 0e:00.3 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) HD Audio Controller [1022:1457] IOMMU Group 3: 00:02.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] IOMMU Group 4: 00:03.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] IOMMU Group 5: 00:03.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) PCIe GPP Bridge [1022:1453] IOMMU Group 6: 00:04.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] IOMMU Group 7: 00:07.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] IOMMU Group 8: 00:07.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-0fh) Internal PCIe GPP Bridge 0 to Bus B [1022:1454] IOMMU Group 9: 00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452] 
xml
 win10 facb7abd-ac3e-4a04-8e86-d6944b62d723      8388608 8388608 16  hvm /usshare/ovmf/x64/OVMF_CODE.fd /valib/libvirt/qemu/nvram/win10_VARS.fd                      destroy restart destroy      /usbin/qemu-system-x86_64     
Output of "dmesg | grep vfio" before starting vm
[ 1.279191] vfio-pci 0000:0c:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 1.293682] vfio_pci: add [1002:731f[ffffffff:ffffffff]] class 0x000000/00000000 [ 1.310411] vfio_pci: add [1002:ab38[ffffffff:ffffffff]] class 0x000000/00000000 
full output: https://pastebin.com/UVaxAWWU

Output of "dmesg | grep vfio" after starting vm
[ 1.279191] vfio-pci 0000:0c:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 1.293682] vfio_pci: add [1002:731f[ffffffff:ffffffff]] class 0x000000/00000000 [ 1.310411] vfio_pci: add [1002:ab38[ffffffff:ffffffff]] class 0x000000/00000000 [ 358.866916] vfio-pci 0000:0c:00.0: vfio_ecap_init: hiding ecap [email protected] [ 358.866927] vfio-pci 0000:0c:00.0: vfio_ecap_init: hiding ecap [email protected] [ 358.866930] vfio-pci 0000:0c:00.0: vfio_ecap_init: hiding ecap [email protected] [ 358.866931] vfio-pci 0000:0c:00.0: vfio_ecap_init: hiding ecap [email protected] [ 358.866933] vfio-pci 0000:0c:00.0: vfio_ecap_init: hiding ecap [email protected] [ 358.867808] vfio-pci 0000:0c:00.0: BAR 0: can't reserve [mem 0xe0000000-0xefffffff 64bit pref] [ 361.571367] vfio-pci 0000:0c:00.0: No more image in the PCI ROM [ 361.571388] vfio-pci 0000:0c:00.0: No more image in the PCI ROM 
full output: https://pastebin.com/VyxF9Y88

Since I only have one gpu I am forwarding X11 to a laptop and running virt-manager from there, windows starts and works fine but on my main display I only get a blinking cursor after starting the vm.

Edit: Thanks to u/cybervseas and this post https://www.reddit.com/VFIO/comments/7kpw33/cant_passthrough_boot_gpu_did_i_miss_something/ I got the vm working.
I added a line to the xml file that points to the rom file to be used. You can get that file from https://www.techpowerup.com/vgabios/ , download gpu-z and dump it or any other way to get the rom of your gpu.
    
The last thing was changing some settings in grub. I added the kernel parameter 'nofb' and changed GRUB_GFXPAYLOAD from 'keep' to 'text' in the file at /etc/default/grub.
Everything seems to work now I am writing this from inside the vm and I had no problems with the driver installation it works the same way as if windows was the host os.
submitted by diogo464 to VFIO [link] [comments]

QuickBASIC versions 4.0 and 4.5 use IEEE 754 floating-point variables by default, but (at least in version 4.5) there is a command-line option /MBF for the IDE and the compiler that switches from IEEE to MBF floating-point numbers, to support earlier-written programs that rely on details of the MBF data formats. Binary System. The binary numeral system uses the number 2 as its base (radix). As a base-2 numeral system, it consists of only two numbers: 0 and 1. While it has been applied in ancient Egypt, China and India for different purposes, the binary system has become the language of electronics and computers in the modern world. option casemap:none include \masm32\include\windows.inc one is for binary to ascii decimal, which is 16-bit code the function you want to perform is a very simple one 0Fh movzx edx, al mov al, [szHexLookup + edx] stosb shr ah, 4 movzx edx, ah mov al, [szHexLookup + edx] stosb dec ecx You don't have to run the binary or have debuginfo. $ gdb -q ./a.out Reading symbols from ./a.out...(no debugging symbols found)...done. (gdb) info functions All defined functions: Non-debugging symbols: 0x00000000004003a8 _init 0x00000000004003e0 [email protected] 0x00000000004003f0 [email protected] 0x0000000000400400 _start You can't use int 10h (0e) for char output when you collect bits into bx.That int call requires bl set to foreground colour of text and bh to point to text page.. Also in bx you will count number of ones, not the input number. Try it in debugger (your original code), put breakpoint after loop and enter (blindly, if it doesn't show) for example "1100110011001100", bx will be 8 (I may be wrong

[index] [16729] [28734] [13515] [3273] [31101] [25790] [14088] [16309] [28809] [27883]

Flag Counter