print register value in assembly on bootloader

0

I'm trying to print vendorID and DeviceID of my hardware which stores in ebx using this code and I'll boot it:

_start:
    xor eax,eax
    mov eax,0x80000000
    xor ecx,ecx
.main
    mov dx,0x0cf8
    out dx,eax
    mov dx,0x0cfc
    mov ebp,eax
    in  eax,dx
    cmp eax,0xFFFFFFFF ;eax will fill with 0xFFFFFFFF if no device founded on bus
    je  .count
    xor ebx,ebx
    mov [ebx],eax    ;copy the vendor and Device ID
    add ebx,0x0004
    mov [ebx],ebx    ;their locations
    mov eax,ebx
    add eax,0x00000800 ; next device
    inc ecx
    cmp ecx,0x20
    je break
    loop main

.count
    inc ecx
    jmp main

.break
    mov rax,1
    int 0x80


times 510-($-$$) db 0
dw 0xaa55

the values as you see stores in ebx but I have problem with overwriting and move the cursor (INT 10 & 0x0e)

Q1: How to Print Those values?

Q2: How to find the actual memory address of the hardwares?(for example my network card address is 0x7F800000. (found in Windows 10 System information ))

code resource : https://www.youtube.com/watch?v=NgzT1JfBUr0&t=142s

assembly
boot

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0