RTL8139Test now kills Qemu.

This commit is contained in:
Scalpel_cp 2008-07-29 20:51:01 +00:00
parent 4abc2d114c
commit 70079b676a
3 changed files with 37 additions and 43 deletions

View file

@ -342,12 +342,11 @@ namespace Cosmos.Hardware.Network.Devices.RTL8139
WriteAddressToPCI(ref TxBuffer3, (byte)Register.MainRegister.Bit.TSAD3); WriteAddressToPCI(ref TxBuffer3, (byte)Register.MainRegister.Bit.TSAD3);
var tsd = Register.TransmitStatusDescriptor.Load(mem); var tsd = Register.TransmitStatusDescriptor.Load(mem);
Console.WriteLine("Telling NIC to send " + aData.Length + " bytes."); //Console.WriteLine("Telling NIC to send " + aData.Length + " bytes.");
tsd.Size = aData.Length; tsd.Size = aData.Length;
//Console.WriteLine("TransmitStatusDescriptor contains size of" + tsd.Size + " bytes.");
//Console.WriteLine("TDS : " + tsd.ToString()); tsd.OWN = false; //Begins sending - causes QEMU to DIE (Frode, 29.july)!
tsd.OWN = false; //Begins sending
//Console.WriteLine("TDS : " + tsd.ToString());
Register.TransmitStatusDescriptor.IncrementTSDescriptor(); Register.TransmitStatusDescriptor.IncrementTSDescriptor();
return true; return true;

View file

@ -38,12 +38,14 @@ namespace FrodeTest
//Test.TransmitStatusDescriptorTest.RunTest(); //Test.TransmitStatusDescriptorTest.RunTest();
//Test.PacketHeaderTest.RunTest(); //Test.PacketHeaderTest.RunTest();
//Test.RAMBusTest.RunTest(); //Test.RAMBusTest.RunTest();
//Test.RTL8139Test.RunTest();
//Test.NumberSystemTest.RunTest(); //Test.NumberSystemTest.RunTest();
//Test.IPv4Test.RunTest(); //Test.IPv4Test.RunTest();
//Test.UDPTest.RunTest(); //Test.UDPTest.RunTest();
//Test.MACAddressTest.RunTest(); //Test.MACAddressTest.RunTest();
//Test.LinqTest.RunTest(); //Test.LinqTest.RunTest();
//Tests ready for Matthijs to fix ;)
Test.RTL8139Test.RunTest();
Test.ExceptionTest.RunTest(); Test.ExceptionTest.RunTest();
//Done //Done

View file

@ -1,43 +1,36 @@
//using System; using System;
//using System.Collections.Generic; using System.Collections.Generic;
//using System.Text; using System.Text;
//using Cosmos.Hardware.Network.Devices.RTL8139; using Cosmos.Hardware.Network.Devices.RTL8139;
using Cosmos.Sys.Network;
//namespace FrodeTest.Test namespace FrodeTest.Test
//{ {
// public class RTL8139Test public class RTL8139Test
// { {
// [Obsolete] [Obsolete]
// public static void RunTest() public static void RunTest()
// { {
// // Testing RTL8139 PCI networkcard // Testing RTL8139 PCI networkcard
// //Load card //Load card
// var nics = RTL8139.FindAll(); var xNics = RTL8139.FindAll();
// if (nics.Count == 0) if (xNics.Count == 0)
// { {
// Console.WriteLine("No Realtek 8139 network card found!!"); Console.WriteLine("No Realtek 8139 network card found!!");
// return; return;
// } }
// Console.WriteLine(nics.Count + " network cards found"); Console.WriteLine(xNics.Count + " network cards found");
// var nic = (RTL8139)nics[0]; var xNic = (RTL8139)xNics[0];
// Console.WriteLine("Network card: " + nic.Name); xNic.Enable();
// Console.WriteLine("HW Revision: " + nic.HardwareRevision); xNic.InitializeDriver();
// Console.WriteLine("MAC address: " + nic.MACAddress.ToString());
// //Console.WriteLine("BaseAddress0 is : " + pciNic.BaseAddress0); byte[] xPingData = { (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f' };
// Console.WriteLine("BaseAddress1 is : " + nic.PCICard.BaseAddress1); var xPingOut = new ICMPPacket(1, 2, ICMPPacket.ICMPType.EchoRequest, xPingData, 0);
// Console.WriteLine("Enabling card...");
// nic.Enable();
// Console.WriteLine("Initializing driver...");
// nic.InitializeDriver();
// var head = new PacketHeader(0xFF); xNic.TransmitBytes(xPingOut.GetData());
// byte[] data = Mock.FakeBroadcastPacket.GetFakePacketAllHigh(); }
// var packet = new Packet(head, data); }
// nic.Transmit(packet); }
// }
// }
//}