Hello everyone,
I am trying to setup a RTL8169 driver.
So far I used the tutorial on osdev.org and added the interrupt function so the interrupts are working.
After this, I decided to look for incoming packets by sending "sudo dhclient" from my Linux computer to my computer with my OS on it.
The computer caused an interrupt and I can see what the system is sending to my computer.
So far so good.
Now I'm trying to send data to the network (the same package as I received earlier since I know this package is alright):
https://github.com/AdeRegt/SanderOSUSB/ ... 8169.c#L58
This function is not causing an interrupt and polling seems not to work (stays on 0x40 forever). Also, I cannot see it is sent with Wireshark.
Im testing this on real hardware.
I hope someone can help me.
RTL8169 on real hardware not able to send packages
Re: RTL8169 on real hardware not able to send packages
Hard to say what's wrong but one common mistake is that you forgot to set PCI Bus Mastering for the card.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
http://github.com/Jezze/fudge/
Re: RTL8169 on real hardware not able to send packages
Please get rid of the magic numbers, it makes the code hard to read and maintain
It's not clear from the code if TX descriptors are properly aligned, they should be aligned on 256 byte boundary if I'm not mistaken.
You did not set the high address of the TX descriptor ring (bar1 + 0x24)
It's not clear from the code if TX descriptors are properly aligned, they should be aligned on 256 byte boundary if I'm not mistaken.
You did not set the high address of the TX descriptor ring (bar1 + 0x24)
Re: RTL8169 on real hardware not able to send packages
I managed to make an RTL8139 driver for my OS but I had trouble getting it to start. the clock was missing and I had not found any indication of this clock in the official documentation. to start the clock there is a need to send the "R" byte to port 5Bh of the card registers
the source code of my driver: https://github.com/N-LG/service-etherne ... TL8139.asm (in assembler and commented in French, I know it's not easy but it can help a little bit)
the source code of my driver: https://github.com/N-LG/service-etherne ... TL8139.asm (in assembler and commented in French, I know it's not easy but it can help a little bit)
Re: RTL8169 on real hardware not able to send packages
Thank you for your comments.
I managed to make it work on real hardware.
This is the sourcecode:
https://github.com/AdeRegt/SanderOSUSB/ ... /RTL8169.c
I managed to make it work on real hardware.
This is the sourcecode:
https://github.com/AdeRegt/SanderOSUSB/ ... /RTL8169.c