Sending a packet works fine, i'm able to transmit a packet and that very packet can then be properly received by other machine.
The thing is, that when i try to receive this packet using my system (picture two Qemu connected together, both running my system) i get strange data. There must be something wrong with the routine that handles DMA receiving, because that received data does not match the original ones (data that has been sent) at all.
There is this snippet of code that does DMA read, this routine is called when there is a packet waiting and irq is fired - that isr will call this routine.
Code: Select all
; in cx is size to be read
; in edi is location where to put data
mov al, CR_PS1 ; bank 1
mov edx, dword [BASE]
out dx, al
add dx, 7 ; CURR PAGE REGISTER
in ax, dx
push ax
mov al, CR_PS0 ; bank 0
mov edx, dword [BASE]
out dx, al
inc cx
and cx, 0fffeh
mov edx, dword [BASE]
add dx, RBCR0
mov al, cl
out dx, al
mov edx, dword [BASE]
add dx, RBCR1
mov al, ch
out dx, al
pop ax ; Get our page back
mov edx, dword [BASE]
add dx, RSAR0
out dx, al
mov edx, dword [BASE]
add dx, RSAR1
mov al, ah
out dx, al
mov edx, dword [BASE]
mov al, 0ah ; Read and start ( bank 0, read, sta)
out dx, al
add dx, ASIC ; (io)
shr cx, 1
push es
mov ax, 0x10
mov es, ax
iter:
in ax, dx
stosw
loop iter
pop es
ret