mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-10 18:21:20 +00:00
This commit is contained in:
parent
cda3f5c062
commit
fd0440a52c
27 changed files with 0 additions and 1937 deletions
|
|
@ -1,77 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{1F7ACC2A-EA38-4B10-AB87-9450BBCC8D6F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.Driver.RTL8139</RootNamespace>
|
||||
<AssemblyName>Cosmos.Driver.RTL8139</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Cosmos.Kernel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL">
|
||||
<HintPath>..\Cosmos\Cosmos.Kernel\bin\Debug\Cosmos.Kernel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Misc\BinaryHelper.cs" />
|
||||
<Compile Include="Packet.cs" />
|
||||
<Compile Include="PacketHeader.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Register\CommandRegister.cs" />
|
||||
<Compile Include="Register\EarlyRxStatusRegister.cs" />
|
||||
<Compile Include="Register\InterruptMaskRegister.cs" />
|
||||
<Compile Include="Register\MainRegister.cs" />
|
||||
<Compile Include="Register\ReceiveConfigurationRegister.cs" />
|
||||
<Compile Include="Register\TransmitConfigurationRegister.cs" />
|
||||
<Compile Include="Register\TransmitStatusDescriptor.cs" />
|
||||
<Compile Include="RTL8139.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Cosmos\Cosmos.Hardware\Cosmos.Hardware.csproj">
|
||||
<Project>{CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}</Project>
|
||||
<Name>Cosmos.Hardware</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Misc
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains various helpermethods to make bitfiddling easier.
|
||||
/// </summary>
|
||||
public class BinaryHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Bitwise checks it the given bit is set in the data.
|
||||
/// </summary>
|
||||
/// <param name="bit">The zero-based position of a bit. I.e. bit 1 is the second bit.</param>
|
||||
/// <returns>Returns TRUE if bit is set.</returns>
|
||||
public static bool CheckBit(UInt16 data, ushort bit)
|
||||
{
|
||||
//A single bit is LEFT SHIFTED the number a given number of bits.
|
||||
//and bitwise AND'ed together with the data.
|
||||
//So the initial value is : 0000 0000.
|
||||
//Left shifting a bit 3 bits: 0000 0100
|
||||
//And'ed together with the data: 0101 0101 AND 0000 01000 => 0000 0100 (which is greater than zero - so bit is set).
|
||||
|
||||
ushort mask = (ushort)(1 << (ushort)bit);
|
||||
return (data & mask) != 0;
|
||||
}
|
||||
|
||||
public static bool CheckBit(UInt32 data, ushort bit)
|
||||
{
|
||||
UInt32 mask = (UInt32)(1 << (int)bit);
|
||||
return (data & mask) != 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the value in the given position. Either from low to high, or high to low.
|
||||
/// Returns the same byte, but with one bit changed.
|
||||
/// </summary>
|
||||
public static byte FlipBit(byte data, ushort bit)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves a byte of data from somewhere inside a 32 bit number. An offset is used to indicate where in
|
||||
/// the 32 bit number to start extracting 8 bits.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="offset"></param>
|
||||
/// <returns></returns>
|
||||
public static byte GetByteFrom32bit(UInt32 data, byte offset)
|
||||
{
|
||||
if (offset > 24)
|
||||
throw new ArgumentException("Offset can not move outside the 32 bit range");
|
||||
|
||||
data = data >> offset;
|
||||
return (byte)data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the HEX value of a given bitnumber
|
||||
/// </summary>
|
||||
public enum BitPos : uint
|
||||
{
|
||||
BIT0 = 0x1,
|
||||
BIT1 = 0x2,
|
||||
BIT2 = 0x4,
|
||||
BIT3 = 0x8,
|
||||
BIT4 = 0x10,
|
||||
BIT5 = 0x20,
|
||||
BIT6 = 0x40,
|
||||
BIT7 = 0x80,
|
||||
BIT8 = 0x100,
|
||||
BIT9 = 0x200,
|
||||
BIT10 = 0x400,
|
||||
BIT11 = 0x800,
|
||||
BIT12 = 0x1000,
|
||||
BIT13 = 0x2000,
|
||||
BIT14 = 0x4000,
|
||||
BIT15 = 0x8000,
|
||||
BIT16 = 0x10000,
|
||||
BIT17 = 0x20000,
|
||||
BIT18 = 0x40000,
|
||||
BIT19 = 0x80000,
|
||||
BIT20 = 0x100000,
|
||||
BIT21 = 0x200000,
|
||||
BIT22 = 0x400000,
|
||||
BIT23 = 0x800000,
|
||||
BIT24 = 0x1000000,
|
||||
BIT25 = 0x2000000,
|
||||
BIT26 = 0x4000000,
|
||||
BIT27 = 0x8000000,
|
||||
BIT28 = 0x10000000,
|
||||
BIT29 = 0x20000000,
|
||||
BIT30 = 0x40000000,
|
||||
BIT31 = 0x80000000
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139
|
||||
{
|
||||
/// <summary>
|
||||
/// A network Packet used when transferring data over a network.
|
||||
/// Consists of a body (with the data) and a head (with info about the packet)
|
||||
/// </summary>
|
||||
public class Packet
|
||||
{
|
||||
private PacketHeader head;
|
||||
private byte[] body;
|
||||
public PacketHeader Head { get; private set; }
|
||||
|
||||
public Packet(PacketHeader newhead, byte[] data)
|
||||
{
|
||||
head = newhead;
|
||||
body = data;
|
||||
}
|
||||
|
||||
public byte[] PacketBody
|
||||
{
|
||||
get
|
||||
{
|
||||
return body;
|
||||
}
|
||||
//return new byte[10]; //TODO: Redo this completely! Hardcoded to some bogus value now.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139
|
||||
{
|
||||
/// <summary>
|
||||
/// The packethead consists of two bytes (i.e. 16 bits).
|
||||
/// A PacketHead contains information about a network Packet, and its transfer.
|
||||
/// </summary>
|
||||
public class PacketHeader
|
||||
{
|
||||
private UInt16 head;
|
||||
|
||||
public PacketHeader(UInt16 data)
|
||||
{
|
||||
head = data;
|
||||
}
|
||||
|
||||
public ushort PacketLength
|
||||
{
|
||||
get {return 2048;} //TODO: Get from packet?
|
||||
//private set;
|
||||
}
|
||||
|
||||
public bool IsReceiveOk()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.ROK);
|
||||
}
|
||||
|
||||
public bool IsFrameAlignmentError()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.FAE);
|
||||
}
|
||||
|
||||
public bool IsCRCError()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.CRC);
|
||||
}
|
||||
|
||||
public bool IsLongPacket()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.LONG);
|
||||
}
|
||||
|
||||
public bool IsRuntPacket()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.RUNT);
|
||||
}
|
||||
|
||||
public bool IsInvalidSymbolError()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.ISE);
|
||||
}
|
||||
|
||||
public bool IsBroadcastAddress()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.BAR);
|
||||
}
|
||||
|
||||
public bool IsPhysicalAddressMatch()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.PAM);
|
||||
}
|
||||
|
||||
public bool IsMulticastAddress()
|
||||
{
|
||||
return BinaryHelper.CheckBit(head, (ushort)PacketHeadBit.MAR);
|
||||
}
|
||||
|
||||
private enum PacketHeadBit : ushort
|
||||
{
|
||||
ROK = 0x00, //Receive OK
|
||||
FAE = 0x01, //Frame Alignment Error
|
||||
CRC = 0x02, //CRC Error
|
||||
LONG = 0x03,//Long packet - set to 1 when packet over 4k bytes
|
||||
RUNT = 0x04,//Runt packet received (smaller than 64 bytes)
|
||||
ISE = 0x05, //Invalid Symbol Error (Only 100BASE-TX).
|
||||
BAR = 0x0D, //Broadcast Address Received
|
||||
PAM = 0x0E, //Physical Address Matched
|
||||
MAR = 0x0F //Multicast Address Received
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cosmos.Driver.RTL8139")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Cosmos.Driver.RTL8139")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c18ed28a-23cc-4374-832d-87aeaa37c267")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -1,369 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Hardware.Network;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Driver.RTL8139.Register;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139
|
||||
{
|
||||
/// <summary>
|
||||
/// Driver for networkcards using the RTL8139 chip.
|
||||
/// Some documentation can be found at: http://www.osdev.org/wiki/RTL8139
|
||||
/// </summary>
|
||||
public class RTL8139 : NetworkDevice //, DeviceDriver interface
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieve all Realtek 8139 network cards found on computer.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static List<RTL8139> FindRTL8139Devices()
|
||||
{
|
||||
List<RTL8139> found = new List<RTL8139>();
|
||||
|
||||
foreach (PCIDevice device in Cosmos.Hardware.PC.Bus.PCIBus.Devices)
|
||||
{
|
||||
//Console.WriteLine("VendorID: " + device.VendorID + " - DeviceID: " + device.DeviceID);
|
||||
if (device.VendorID == 0x10EC && device.DeviceID == 0x8139)
|
||||
found.Add(new RTL8139(device));
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
private PCIDevice pciCard;
|
||||
private MemoryAddressSpace mem;
|
||||
private Register.MainRegister regs;
|
||||
private byte[] TxBuffer0;
|
||||
private byte[] TxBuffer1;
|
||||
private byte[] TxBuffer2;
|
||||
private byte[] TxBuffer3;
|
||||
private byte[] RxBuffer;
|
||||
//private byte[] RxBuffer2 = new byte[2048];
|
||||
//private byte[] RxBuffer3 = new byte[2048];
|
||||
//private byte[] RxBuffer4 = new byte[2048];
|
||||
|
||||
|
||||
|
||||
public RTL8139(PCIDevice device)
|
||||
{
|
||||
pciCard = device;
|
||||
mem = device.GetAddressSpace(1) as MemoryAddressSpace;
|
||||
regs = new MainRegister(mem);
|
||||
}
|
||||
|
||||
public PCIDevice PCICard { get { return pciCard; } private set { ;} }
|
||||
|
||||
#region NetworkDevice members
|
||||
public override MACAddress MACAddress
|
||||
{
|
||||
get
|
||||
{
|
||||
//Polls the PCI device for the MAC address
|
||||
/*byte[] bytes = new byte[6];
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
uint address = (uint)(pciCard.BaseAddress1 + i);
|
||||
bytes[i] = IOSpace.Read8(address);
|
||||
}
|
||||
|
||||
MACAddress mac = new MACAddress(bytes);
|
||||
return mac;
|
||||
* */
|
||||
|
||||
return regs.Mac;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetHardwareRevision()
|
||||
{
|
||||
TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
|
||||
return TransmitConfigurationRegister.GetHardwareRevision(tcr.GetHWVERID());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs additional hardware initilization
|
||||
/// </summary>
|
||||
public void InitializeDriver()
|
||||
{
|
||||
//Turn on Tx and Rx
|
||||
EnableTransmit();
|
||||
EnableRecieve();
|
||||
|
||||
//Initialize buffers
|
||||
InitTransmitBuffer();
|
||||
InitReceiveBuffer();
|
||||
|
||||
//Setting Transmit configuration
|
||||
TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
|
||||
tcr.Init();
|
||||
|
||||
//Setting Receive configuration
|
||||
ReceiveConfigurationRegister rcr = ReceiveConfigurationRegister.Load(pciCard);
|
||||
rcr.Init();
|
||||
|
||||
//Enable IRQ Interrupt
|
||||
SetIRQMaskRegister();
|
||||
Console.WriteLine("PCI should raise IRQ" + pciCard.InterruptLine);
|
||||
Cosmos.Hardware.PC.Interrupts.IRQ11 = new Cosmos.Hardware.PC.Interrupts.InterruptDelegate(HandleNetworkInterrupt);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the Loopback mode.
|
||||
/// </summary>
|
||||
/// <param name="value">True to enable Loopback. False for normal operation.</param>
|
||||
public void SetLoopbackMode(bool value)
|
||||
{
|
||||
TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
|
||||
tcr.LoopbackMode = value;
|
||||
}
|
||||
|
||||
public bool GetLoopbackMode()
|
||||
{
|
||||
TransmitConfigurationRegister tcr = TransmitConfigurationRegister.Load(pciCard);
|
||||
return tcr.LoopbackMode;
|
||||
}
|
||||
|
||||
public override bool QueueBytes(byte[] buffer, int offset, int length)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool RecieveBytes(byte[] buffer, int offset, int max)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override int BytesAvailable()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool IsSendBufferFull()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool IsRecieveBufferFull()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Generic RTL8139 Network device"; }
|
||||
}
|
||||
|
||||
public override bool Enable()
|
||||
{
|
||||
//Writes 0x00 to CONFIG_1 registers to enable card
|
||||
regs.Config1 = 0x00;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs an internal system hardware reset of the network card.
|
||||
/// </summary>
|
||||
public void SoftReset()
|
||||
{
|
||||
Console.WriteLine("Performing software reset of RTL8139");
|
||||
|
||||
//Tell RTL chip to issue a Reset`
|
||||
regs.ChipCmd = MainRegister.ChipCommandFlags.RST;
|
||||
|
||||
//Wait while RST bit is active
|
||||
while (regs.ChipCmdTest(MainRegister.ChipCommandFlags.RST))
|
||||
{
|
||||
Console.WriteLine("Reset in progress...");
|
||||
}
|
||||
|
||||
Console.WriteLine("Reset Complete!");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// (Should be) Called when the PCI network card raises an Interrupt.
|
||||
/// </summary>
|
||||
public static void HandleNetworkInterrupt()
|
||||
{
|
||||
Console.WriteLine("Network IRQ raised! Indicates data received...");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The IRQMaskRegister
|
||||
/// </summary>
|
||||
private void SetIRQMaskRegister()
|
||||
{
|
||||
byte mask = (byte)
|
||||
(Register.InterruptMaskRegister.Bit.ROK &
|
||||
Register.InterruptMaskRegister.Bit.TOK &
|
||||
Register.InterruptMaskRegister.Bit.RER &
|
||||
Register.InterruptMaskRegister.Bit.TER
|
||||
);
|
||||
|
||||
//Note; The reference driver from Realtek sets mask = 0x7F (all bits high).
|
||||
//mask = 0x7F;
|
||||
|
||||
UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.IntrMask;
|
||||
IOSpace.Write8(address, mask);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This register indicates the source of an interrupt when the INTA pin goes active.
|
||||
/// Enabling the corresponding bits in the Interrupt Mask Register (IMR) allows bits in this register to produce an interrupt.
|
||||
/// When an interrupt is active, one of more bits in this register are set to a “1”.
|
||||
/// The interrupt Status Register reflects all current pending interrupts, regardless of the state of the corresponding mask bit in the IMR.
|
||||
/// Reading the ISR clears all interrupts. Writing to the ISR has no effect.
|
||||
/// </summary>
|
||||
private void GetIRQServiceRegister()
|
||||
{
|
||||
//Could perhaps be used to raise events?
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the NIC to be able to Recieve data.
|
||||
/// </summary>
|
||||
public void EnableRecieve()
|
||||
{
|
||||
regs.ChipCmd = MainRegister.ChipCommandFlags.TE;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enable the NIC to be able to Transmit data.
|
||||
/// </summary>
|
||||
public void EnableTransmit()
|
||||
{
|
||||
regs.ChipCmd = MainRegister.ChipCommandFlags.TE;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A general purpose timer. Writing to this will reset timer. NB: Timer does not work in Qemu.
|
||||
/// </summary>
|
||||
public UInt32 TimerCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return IOSpace.Read32(pciCard.BaseAddress1 + (byte)MainRegister.Bit.Timer);
|
||||
}
|
||||
set
|
||||
{
|
||||
UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.Timer;
|
||||
IOSpace.Write32(address, 0x00); //Resets timer
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Early TX Threshold specifies the threshold level in Tx FIFO register before transmission begins.
|
||||
/// The bytecount should not exceed 2048(2k bytes).
|
||||
/// The bytecount also needs to be dividable by 32.
|
||||
/// If bytecount 0 is set then NIC will use 8 bytes as threshold
|
||||
/// </summary>
|
||||
/// <param name="bytecount">Number zero or a number dividable by 32.</param>
|
||||
public void SetEarlyTxThreshold(uint bytecount)
|
||||
{
|
||||
//TODO: This method should be in TransmitStatusDescriptos.cs
|
||||
if (bytecount != 0 & (bytecount % 32 > 0))
|
||||
throw new ArgumentException("Early TX Threshold must be 0 or dividable by 32");
|
||||
|
||||
//Each of the four Transmit Status Descriptors (TSD) has its own EarlyTxThreshold.
|
||||
|
||||
UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.RxEarlyCnt;
|
||||
IOSpace.Write8(address, (byte)bytecount);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize the Receive Buffer. The RBSTART register consists of 4 bytes (0x30h to 0x33h) which should contain
|
||||
/// the address of a buffer to save incoming data to.
|
||||
/// </summary>
|
||||
public void InitReceiveBuffer()
|
||||
{
|
||||
//Prepare a buffer area
|
||||
|
||||
RxBuffer = new byte[2048];
|
||||
|
||||
UInt32 address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.RxBuf;
|
||||
|
||||
//Write the address of the buffer area to the RBSTART
|
||||
WriteAddressToPCI(ref RxBuffer, address);
|
||||
|
||||
Console.WriteLine("RxBuffer address: " + address);
|
||||
Console.WriteLine("RxBuffer contains address: " + IOSpace.Read32(address));
|
||||
}
|
||||
|
||||
public void InitTransmitBuffer()
|
||||
{
|
||||
//Initialize Tx Buffers
|
||||
|
||||
TxBuffer0 = new byte[2048];
|
||||
TxBuffer1 = new byte[2048];
|
||||
TxBuffer2 = new byte[2048];
|
||||
TxBuffer3 = new byte[2048];
|
||||
|
||||
WriteAddressToPCI(ref TxBuffer0, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD0);
|
||||
WriteAddressToPCI(ref TxBuffer1, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD1);
|
||||
WriteAddressToPCI(ref TxBuffer2, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD2);
|
||||
WriteAddressToPCI(ref TxBuffer3, pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSAD3);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Takes a byte array, and a memory address.
|
||||
/// The memoryaddress of the begining of the bytearray is written to the memory address.
|
||||
/// </summary>
|
||||
/// <param name="bytearray"></param>
|
||||
/// <param name="address"></param>
|
||||
private unsafe void WriteAddressToPCI(ref byte[] bytearray, uint address)
|
||||
{
|
||||
|
||||
/* The data in the bytearray contains the actual bytes we want to transfer to the network.
|
||||
* This bytearray must be in a continous memoryarea on the computer.
|
||||
* We then write the address of this memoryarea to the network card.
|
||||
* The address is stored in the Transmit Start Address which corresponds to the Transmit Status Descriptor we are currently using (0-3).
|
||||
*/
|
||||
|
||||
|
||||
fixed (byte* bodystart = &bytearray[0])
|
||||
{
|
||||
IntPtr bodyAddress = (IntPtr)bodystart;
|
||||
IOSpace.Write32(address, (uint)bodyAddress);
|
||||
Console.WriteLine("Address where buffer is stored: " + (uint)bodyAddress);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Transmits the given Packet
|
||||
/// </summary>
|
||||
/// <param name="packet"></param>
|
||||
public unsafe bool Transmit(Packet packet)
|
||||
{
|
||||
//Put the packet into the correct TxBuffer
|
||||
TxBuffer1 = packet.PacketBody;
|
||||
|
||||
//Cosmos.Hardware.PC.Global.Sleep(300);
|
||||
|
||||
//Console.Write("Data in Transmit Status Descriptor " + TransmitStatusDescriptor.GetCurrentTSDescriptor() + ":");
|
||||
//Console.WriteLine(IOSpace.Read32(address));
|
||||
//At this point the TSDA0 should contain the address of the data.
|
||||
//Console.WriteLine("The Data pointed to: " + IOSpace.Read32(IOSpace.Read32(address)));
|
||||
|
||||
//Set the transmit status - which enables the transmit.
|
||||
TransmitStatusDescriptor tsd = TransmitStatusDescriptor.Load(pciCard);
|
||||
tsd.Size = packet.PacketBody.Length;
|
||||
Console.WriteLine("Told NIC to send " + tsd.Size + " bytes.");
|
||||
|
||||
//Print packet
|
||||
/*for (int i = 0; i < tsd.Size; i++)
|
||||
{
|
||||
Console.Write(TxBuffer1[i] + ":");
|
||||
}*/
|
||||
|
||||
SetEarlyTxThreshold(1024);
|
||||
Console.WriteLine("Sending...");
|
||||
tsd.ClearOWNBit();
|
||||
TransmitStatusDescriptor.IncrementTSDescriptor();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// The CommandRegister is used for issuing commands to the RTL8139.
|
||||
/// Used for performing Software Reset, or enabling transmitter and receiver.
|
||||
/// 1 Byte wide. Only one 4 bits used. (Bit 1, 5, 6, 7 not used)
|
||||
/// Offset 0x37h from the base memory.
|
||||
/// </summary>
|
||||
public class CommandRegister
|
||||
{
|
||||
//private byte cmd;
|
||||
|
||||
private PCIDevice pcicard = null;
|
||||
private UInt32 address = 0;
|
||||
|
||||
public static CommandRegister Load(PCIDevice pci)
|
||||
{
|
||||
//pcicard = pci;
|
||||
UInt32 address = GetCmdAddress(pci);
|
||||
return new CommandRegister(pci, address);
|
||||
}
|
||||
|
||||
private CommandRegister(PCIDevice pci, UInt32 adr)
|
||||
{
|
||||
pcicard = pci;
|
||||
address = adr;
|
||||
}
|
||||
|
||||
public byte GetCmdRegister()
|
||||
{
|
||||
return IOSpace.Read8(GetCmdAddress());
|
||||
}
|
||||
|
||||
public UInt32 GetCmdAddress()
|
||||
{
|
||||
return pcicard.BaseAddress1 + (byte)MainRegister.Bit.ChipCmd;
|
||||
}
|
||||
|
||||
public static UInt32 GetCmdAddress(PCIDevice pci)
|
||||
{
|
||||
return pci.BaseAddress1 + (byte)MainRegister.Bit.ChipCmd;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bits used to issue commands to the RTL. Used in conjunction with register CHIPCMD (0x37h)
|
||||
/// </summary>
|
||||
public enum BitPosition : byte
|
||||
{
|
||||
BUFE = 0x00, //Buffer Empty, read-only
|
||||
TE = 0x02, //Transmitter Enable
|
||||
RE = 0x03, //Receiver Enable
|
||||
RST = 0x04 //Software Reset
|
||||
}
|
||||
|
||||
public enum BitValue : byte
|
||||
{
|
||||
BUFE = 1,
|
||||
TE = 4,
|
||||
RE = 8,
|
||||
RST = 16
|
||||
}
|
||||
|
||||
public bool IsResetStatus()
|
||||
{
|
||||
byte cmd = GetCmdRegister();
|
||||
return BinaryHelper.CheckBit(cmd, (byte)BitPosition.RST);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// The Early Receive Status Register (ERSR) is used as an indicator when incoming data is received.
|
||||
/// Is 1 byte wide, but only 4 bits used.
|
||||
/// Offset 0x36h from main memory.
|
||||
/// </summary>
|
||||
public class EarlyRxStatusRegister
|
||||
{
|
||||
private byte ersr;
|
||||
public EarlyRxStatusRegister(byte data)
|
||||
{
|
||||
ersr = data;
|
||||
}
|
||||
|
||||
public bool IsEarlyRXOkay()
|
||||
{
|
||||
return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.EROK);
|
||||
}
|
||||
|
||||
public bool IsEarlyRXOverwrite()
|
||||
{
|
||||
return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.EROVW);
|
||||
}
|
||||
|
||||
public bool IsEarlyRXBadPacket()
|
||||
{
|
||||
return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.ERBAD);
|
||||
}
|
||||
|
||||
public bool IsEarlyRXGoodPacket()
|
||||
{
|
||||
return BinaryHelper.CheckBit((ushort)ersr, (ushort)Bit.ERGOOD);
|
||||
}
|
||||
|
||||
public enum Bit : ushort
|
||||
{
|
||||
/// <summary>
|
||||
/// Early RX OK. Initial value 0. Set when Rx byte count exceeds Rx threshold.
|
||||
/// When whole packet is received the ROK or RER is set in ISR, and this bit is cleared.
|
||||
/// </summary>
|
||||
EROK = 0x00,
|
||||
/// <summary>
|
||||
/// Early Rx Overwrite. Set when local address pointer is equal to CAPR. In the early mode
|
||||
/// this is different from buffer overflow.
|
||||
/// </summary>
|
||||
EROVW = 0x01,
|
||||
/// <summary>
|
||||
/// Set when a packet is completely received, but the packet is bad.
|
||||
/// </summary>
|
||||
ERBAD = 0x02,
|
||||
/// <summary>
|
||||
/// Set when packet is completely received, and the packet is good.
|
||||
/// </summary>
|
||||
ERGOOD = 0x03
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// This register masks the interrupts that can be generated from the InterruptStatusRegister (ISR).
|
||||
/// Setting a bit to 1 will enable a corresponding bit in ISR to cause an interrupt.
|
||||
/// During a hardware reset all bits are set to 0.
|
||||
/// Offset 0x3C - 0x3D from base memory.
|
||||
/// 16 bit wide.
|
||||
/// </summary>
|
||||
class InterruptMaskRegister
|
||||
{
|
||||
public enum Bit : byte
|
||||
{
|
||||
ROK = 0x00, //Receive (Rx) OK
|
||||
RER = 0x01, //Receive (Rx) Error
|
||||
TOK = 0x02, //Transmit (Tx) OK
|
||||
TER = 0x03, //Transmit (Tx) Error
|
||||
RXOVW = 0x04, //Rx Buffer Overflow
|
||||
PUNLC = 0x05, //Packed Underrun/Link Change
|
||||
FOVW = 0x06, //FIFO Overflow
|
||||
LENCHG = 0x0D, //Cable Length Changed
|
||||
TIMEOUT = 0x0E, //Raised when TCTR register matches TimeInt register
|
||||
SERR = 0x0F //System Error. Might cause a reset.
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
using Cosmos.Hardware.Network;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
class MainRegister
|
||||
{
|
||||
private MemoryAddressSpace mem;
|
||||
public MainRegister(MemoryAddressSpace mem)
|
||||
{
|
||||
this.mem = mem;
|
||||
}
|
||||
|
||||
public MACAddress Mac
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] b = new byte[6];
|
||||
|
||||
for (byte i = 0; i < 6; i++)
|
||||
b[i] = mem.Read8Unchecked((UInt32)Bit.MAC0 + i);
|
||||
|
||||
return new MACAddress(b);
|
||||
}
|
||||
set
|
||||
{
|
||||
for (byte b=0; b<6; b++)
|
||||
mem.Write8Unchecked((UInt32)Bit.MAC0 + b, value.bytes[b]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public byte[] Mar
|
||||
{
|
||||
get
|
||||
{
|
||||
byte[] b = new byte[6];
|
||||
|
||||
for (byte i = 0; i < 6; i++)
|
||||
b[i] = mem.Read8Unchecked((UInt32)Bit.MAR0 + i);
|
||||
|
||||
return b;
|
||||
}
|
||||
set
|
||||
{
|
||||
for (byte b = 0; b < 6; b++)
|
||||
mem.Write8Unchecked((UInt32)Bit.MAR0 + b, value[b]);
|
||||
}
|
||||
}
|
||||
|
||||
public byte Config0
|
||||
{
|
||||
get
|
||||
{
|
||||
return mem.Read8Unchecked((UInt32)Bit.Config0);
|
||||
}
|
||||
set
|
||||
{
|
||||
mem.Write8Unchecked((UInt32)Bit.Config0, value);
|
||||
}
|
||||
}
|
||||
public byte Config1
|
||||
{
|
||||
get
|
||||
{
|
||||
return mem.Read8Unchecked((UInt32)Bit.Config1);
|
||||
}
|
||||
set
|
||||
{
|
||||
mem.Write8Unchecked((UInt32)Bit.Config1, value);
|
||||
}
|
||||
}
|
||||
|
||||
public UInt32 TxConfig
|
||||
{
|
||||
get
|
||||
{
|
||||
return mem.Read32((UInt32)Bit.TxConfig);
|
||||
}
|
||||
set
|
||||
{
|
||||
mem.Write32((UInt32)Bit.TxConfig, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ChipCommandFlags ChipCmd
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ChipCommandFlags)mem.Read8Unchecked((UInt32)Bit.ChipCmd);
|
||||
}
|
||||
set
|
||||
{
|
||||
mem.Write8Unchecked((UInt32)Bit.ChipCmd, (byte)value);
|
||||
}
|
||||
}
|
||||
public bool ChipCmdTest(ChipCommandFlags mask)
|
||||
{
|
||||
return (ChipCmd & mask) == mask;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum ChipCommandFlags : byte
|
||||
{
|
||||
BUFE = 1,
|
||||
TE = 4,
|
||||
RE = 8,
|
||||
RST = 16
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The RTL8139 contains 64 x 16 bit EEPROM registers.
|
||||
/// </summary>
|
||||
public enum Bit : byte
|
||||
{
|
||||
MAC0 = 0x00, // Ethernet hardware address
|
||||
MAR0 = 0x08, // Multicast filter
|
||||
TSD0 = 0x10, // Transmit status (Four 32bit registers)
|
||||
TSD1 = 0x14,
|
||||
TSD2 = 0x18,
|
||||
TSD3 = 0x1C,
|
||||
TSAD0 = 0x20, // Tx descriptors (also four 32bit)
|
||||
TSAD1 = 0x24,
|
||||
TSAD2 = 0x28,
|
||||
TSAD3 = 0x2C,
|
||||
RxBuf = 0x30,
|
||||
RxEarlyCnt = 0x34,
|
||||
RxEarlyStatus = 0x36,
|
||||
ChipCmd = 0x37,
|
||||
RxBufPtr = 0x38,
|
||||
RxBufAddr = 0x3A,
|
||||
IntrMask = 0x3C,
|
||||
IntrStatus = 0x3E,
|
||||
TxConfig = 0x40,
|
||||
RxConfig = 0x44,
|
||||
Timer = 0x48, // A general-purpose counter
|
||||
RxMissed = 0x4C, // 24 bits valid, write clears
|
||||
Cfg9346 = 0x50,
|
||||
Config0 = 0x51,
|
||||
Config1 = 0x52,
|
||||
FlashReg = 0x54,
|
||||
GPPinData = 0x58,
|
||||
GPPinDir = 0x59,
|
||||
MII_SMI = 0x5A,
|
||||
HltClk = 0x5B,
|
||||
MultiIntr = 0x5C,
|
||||
TxSummary = 0x60,
|
||||
MII_BMCR = 0x62,
|
||||
MII_BMSR = 0x64,
|
||||
NWayAdvert = 0x66,
|
||||
NWayLPAR = 0x68,
|
||||
NWayExpansion = 0x6A
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// Receive Configuration Register is used to set receive configuration.
|
||||
/// Offset 44h from main memory.
|
||||
/// </summary>
|
||||
public class ReceiveConfigurationRegister
|
||||
{
|
||||
private PCIDevice pci;
|
||||
private UInt32 rcrAddress;
|
||||
|
||||
public static ReceiveConfigurationRegister Load(PCIDevice pcicard)
|
||||
{
|
||||
UInt32 address = pcicard.BaseAddress1 + (byte)MainRegister.Bit.RxConfig;
|
||||
return new ReceiveConfigurationRegister(pcicard, address);
|
||||
}
|
||||
|
||||
public ReceiveConfigurationRegister(PCIDevice hw, UInt32 adr)
|
||||
{
|
||||
pci = hw;
|
||||
rcrAddress = adr;
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
UInt32 data = (UInt32)(BitValue.RBLEN0 | BitValue.MXDMA0 | BitValue.MXDMA1 | BitValue.AB | BitValue.AM | BitValue.APM);
|
||||
Console.WriteLine("Data in INIT for RX is: " + data);
|
||||
IOSpace.Write32(rcrAddress, data);
|
||||
}
|
||||
|
||||
public UInt32 RCR
|
||||
{
|
||||
get
|
||||
{
|
||||
return IOSpace.Read32(rcrAddress);
|
||||
}
|
||||
private set { ;}
|
||||
}
|
||||
|
||||
public enum BitValue : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Accept Physical Address Packets. 0 rejects, 1 accepts.
|
||||
/// </summary>
|
||||
AAP = BinaryHelper.BitPos.BIT0,
|
||||
/// <summary>
|
||||
/// Accept Physical Match Packets. 0 rejects, 1 accepts.
|
||||
/// </summary>
|
||||
APM = BinaryHelper.BitPos.BIT1,
|
||||
/// <summary>
|
||||
/// Accept Multicast Packets. 0 rejects, 1 accepts.
|
||||
/// </summary>
|
||||
AM = BinaryHelper.BitPos.BIT2,
|
||||
/// <summary>
|
||||
/// Accept Broadcast Packets. 0 rejects, 1 accepts.
|
||||
/// </summary>
|
||||
AB = BinaryHelper.BitPos.BIT3,
|
||||
/// <summary>
|
||||
/// Accept Runt Packets (packets smaller than 64 bytes - but over 8 bytes.)
|
||||
/// </summary>
|
||||
AR = BinaryHelper.BitPos.BIT4,
|
||||
/// <summary>
|
||||
/// Accept Error Packets (Packets with CRC error, alignment error and/or collided fragments).
|
||||
/// </summary>
|
||||
AER = BinaryHelper.BitPos.BIT5,
|
||||
/// <summary>
|
||||
/// EEPROM used. 0 = 9346, 1 = 9356.
|
||||
/// </summary>
|
||||
EEPROM = BinaryHelper.BitPos.BIT6,
|
||||
/// <summary>
|
||||
/// (Only C mode) 0: Wrap incoming packet to beginning of next RxBuffer.
|
||||
/// 1: Overflow packet even after coming to end of buffer.
|
||||
/// </summary>
|
||||
WRAP = BinaryHelper.BitPos.BIT7,
|
||||
/// <summary>
|
||||
/// Three bits wide.
|
||||
/// Max DMA Burst Size per Rx DMA Burst. 010 = 64 bytes, 011 = 128 bytes, 100 = 256 bytes.
|
||||
/// </summary>
|
||||
MXDMA0 = BinaryHelper.BitPos.BIT8,
|
||||
MXDMA1 = BinaryHelper.BitPos.BIT9,
|
||||
MXDMA2 = BinaryHelper.BitPos.BIT10,
|
||||
/// <summary>
|
||||
/// RxBuffer Length.
|
||||
/// 00 = 8k + 16 byte
|
||||
/// 01 = 16k + 16 byte
|
||||
/// 10 = 32k + 16 byte
|
||||
/// 11 = 64k + 16 byte
|
||||
/// </summary>
|
||||
RBLEN0 = BinaryHelper.BitPos.BIT11,
|
||||
RBLEN1 = BinaryHelper.BitPos.BIT12,
|
||||
/// <summary>
|
||||
/// Rx FIFO Threshold. Three bits wide.
|
||||
/// When recieved byte count matches this level the incoming data will
|
||||
/// be transferred from FIFO to host memory.
|
||||
/// See 8139C+ specs for valid values.
|
||||
/// </summary>
|
||||
RXFTH0 = BinaryHelper.BitPos.BIT13,
|
||||
/// <summary>
|
||||
/// Receive Error Packets Larger than 8 bytes. Yes if 1. If 0 (default) then
|
||||
/// 64-byte error packets are received. Also depends on AER or AR bits.
|
||||
/// </summary>
|
||||
RER8 = BinaryHelper.BitPos.BIT16,
|
||||
/// <summary>
|
||||
/// Multiple Early Interrupt Select. 1 bit wide.
|
||||
/// </summary>
|
||||
MULERINT = BinaryHelper.BitPos.BIT17,
|
||||
/// <summary>
|
||||
/// Early Rx Threshold. 4 bits wide.
|
||||
/// </summary>
|
||||
ERTH0 = BinaryHelper.BitPos.BIT24
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// The TransmitConfigurationRegister (TCR) defines transmit configuration. It controls functions as
|
||||
/// loopback, heartbeat, auto transmit padding, Programmable Interframe Gap, Fill and Drain thresholds
|
||||
/// and maximum DMS burst size.
|
||||
/// Is 32 bits wide. Offset 0x40h-0x43h from main memory.
|
||||
/// </summary>
|
||||
public class TransmitConfigurationRegister
|
||||
{
|
||||
private UInt32 tcr;
|
||||
private PCIDevice pci;
|
||||
private UInt32 tcrAddress;
|
||||
private TransmitConfigurationRegister(UInt32 data, PCIDevice hw, UInt32 adr)
|
||||
{
|
||||
tcr = data;
|
||||
pci = hw;
|
||||
tcrAddress = adr;
|
||||
}
|
||||
|
||||
public static TransmitConfigurationRegister Load(PCIDevice pcicard)
|
||||
{
|
||||
UInt32 address = pcicard.BaseAddress1 + (byte)MainRegister.Bit.TxConfig;
|
||||
UInt32 foundbytes = IOSpace.Read32(address);
|
||||
return new TransmitConfigurationRegister(foundbytes, pcicard, address);
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
//Set Interframe Gap and Max Burst Size (to 128 bytes)
|
||||
UInt32 data = (UInt32)(BitValue.IFG0 | BitValue.IFG1 | BitValue.MAXDMA0 | BitValue.MAXDMA1);
|
||||
//Console.WriteLine("Data in INIT for TX:" + data);
|
||||
IOSpace.Write32(tcrAddress, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves 6 bits
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public byte GetHWVERID()
|
||||
{
|
||||
byte mask = 249; // 1111 1001
|
||||
byte hwverid = Misc.BinaryHelper.GetByteFrom32bit(tcr, (byte)(23));
|
||||
return (byte)(mask & hwverid);
|
||||
}
|
||||
|
||||
//internal void SetLoopBack(bool value)
|
||||
//{
|
||||
// //Change bits LBK0 and LBK1 to HIGH for Loopback, or LOW for Normal mode.
|
||||
// if (value)
|
||||
|
||||
|
||||
|
||||
//}
|
||||
|
||||
public bool LoopbackMode
|
||||
{
|
||||
get
|
||||
{
|
||||
UInt32 data = IOSpace.Read32(tcrAddress);
|
||||
bool low = BinaryHelper.CheckBit(data, 17);
|
||||
bool high = BinaryHelper.CheckBit(data, 18);
|
||||
|
||||
if (low != high)
|
||||
Console.WriteLine("Warning: Loopback bits should always be the same!");
|
||||
|
||||
if (low && high)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
set
|
||||
{
|
||||
UInt32 data = IOSpace.Read32(tcrAddress);
|
||||
if (value) //turn ON
|
||||
data = (UInt32)(data | (uint)BitValue.LBK0 | (uint)BitValue.LBK1);
|
||||
else //turn OFF
|
||||
data = (UInt32)(data & (uint)~BitValue.LBK0 & (uint)~BitValue.LBK1);
|
||||
|
||||
IOSpace.Write32(tcrAddress, data);
|
||||
}
|
||||
}
|
||||
|
||||
public enum BitValue : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Setting to 1 will cause RTL8139 to retransmit packet. Only allowed in transmit abort state.
|
||||
/// </summary>
|
||||
CLRABT = BinaryHelper.BitPos.BIT0,
|
||||
/// <summary>
|
||||
/// Tx Retry Count - 4 bits wide. Tx retry count in multiple of 16. Retries = 16 + (TXRR * 16) times.
|
||||
/// </summary>
|
||||
TXRR = BinaryHelper.BitPos.BIT4,
|
||||
/// <summary>
|
||||
/// Max DMA Burst Size per Tx DMA Burst. Se documentation for value details.
|
||||
/// </summary>
|
||||
MAXDMA0 = BinaryHelper.BitPos.BIT8,
|
||||
MAXDMA1 = BinaryHelper.BitPos.BIT9,
|
||||
MAXDMA2 = BinaryHelper.BitPos.BIT10,
|
||||
/// <summary>
|
||||
/// Append CRC. 0 = CRC is appended. 1 = CRC not appended.
|
||||
/// </summary>
|
||||
CRC = BinaryHelper.BitPos.BIT16,
|
||||
/// <summary>
|
||||
/// Loopback test. 00 is normal. 11 is loopback mode.
|
||||
/// </summary>
|
||||
LBK0 = BinaryHelper.BitPos.BIT17,
|
||||
LBK1 = BinaryHelper.BitPos.BIT18,
|
||||
/// <summary>
|
||||
/// Revisision. If this bit is 1 then the network card is RTL8139 rev.G. All other revisions have bit set to 0.
|
||||
/// </summary>
|
||||
REVG = BinaryHelper.BitPos.BIT23,
|
||||
/// <summary>
|
||||
/// Interframe Gap Time. Adjusts time between frames. 9.6 micro sec for 10Mbps. 0,96 micro sec for 100Mbps.
|
||||
/// Only 0xFF is valid according to IEEE 802.3 standard. Two bits wide.
|
||||
/// </summary>
|
||||
IFG0 = BinaryHelper.BitPos.BIT24,
|
||||
IFG1 = BinaryHelper.BitPos.BIT25,
|
||||
/// <summary>
|
||||
/// Hardware Version ID. 5 bits wide (6 with bit 23). See separate method to convert to string.
|
||||
/// </summary>
|
||||
HWVERID = BinaryHelper.BitPos.BIT26
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the hardware revision. F.instance RTL8139A or RTL8139C+.
|
||||
/// </summary>
|
||||
/// <param name="hwverid">Must be the byte from bit 23 to bit 30 in the TCR! Bit 24 and 25 must be 0.</param>
|
||||
/// <returns></returns>
|
||||
public static string GetHardwareRevision(byte hwverid)
|
||||
{
|
||||
switch (hwverid)
|
||||
{
|
||||
case 192: //11000000
|
||||
return "RTL8139";
|
||||
case 224: //11100000
|
||||
return "RTL8139A";
|
||||
case 225: //11100001
|
||||
return "RTL8139A-G";
|
||||
case 232: //11101000
|
||||
return "RTL8139C";
|
||||
case 233: //11101001
|
||||
return "RTL8139C+";
|
||||
case 240: //11110000
|
||||
return "RTL8139B";
|
||||
case 248: //11111000
|
||||
return "RTL8130";
|
||||
default:
|
||||
return "Unknown RTL813xxx revision (" + hwverid + ")";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,161 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Cosmos.Hardware;
|
||||
using Cosmos.Hardware.PC.Bus;
|
||||
using Cosmos.Driver.RTL8139.Register;
|
||||
using Cosmos.Driver.RTL8139.Misc;
|
||||
|
||||
|
||||
namespace Cosmos.Driver.RTL8139.Register
|
||||
{
|
||||
/// <summary>
|
||||
/// Transmit Status Register is used to describe how the process of transmitting data is going/gone.
|
||||
/// The RTL8139 contains four of these descriptors.
|
||||
/// Located at 0x10h, 0x14h, 0x18h and 0x1Ch, each is 4 bytes wide.
|
||||
/// </summary>
|
||||
public class TransmitStatusDescriptor
|
||||
{
|
||||
private PCIDevice pci;
|
||||
private UInt32 tdsAddress;
|
||||
public static TransmitStatusDescriptor Load(PCIDevice pciCard)
|
||||
{
|
||||
//Retrieve the 32 bits from the PCI card
|
||||
//and create a TSD object
|
||||
UInt32 address = 0;
|
||||
switch (GetCurrentTSDescriptor())
|
||||
{
|
||||
case 0:
|
||||
address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD0;
|
||||
break;
|
||||
case 1:
|
||||
address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD1;
|
||||
break;
|
||||
case 2:
|
||||
address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD2;
|
||||
break;
|
||||
case 3:
|
||||
address = pciCard.BaseAddress1 + (byte)MainRegister.Bit.TSD3;
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Illegal TSDescriptor in RTL driver!");
|
||||
break;
|
||||
}
|
||||
|
||||
return new TransmitStatusDescriptor(pciCard, address);
|
||||
}
|
||||
|
||||
private TransmitStatusDescriptor(PCIDevice hw, UInt32 adr)
|
||||
{
|
||||
pci = hw;
|
||||
tdsAddress = adr;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to get the 32 bit value stored in the TransmitStatusDescriptor.
|
||||
/// </summary>
|
||||
private UInt32 TSD
|
||||
{
|
||||
get
|
||||
{
|
||||
return IOSpace.Read32(tdsAddress);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the OWN bit in the Transmit Status Descriptor. This starts poring the data from the
|
||||
/// buffer into the FIFO buffer on the PCI card. The data then moves from the FIFO to the network cable.
|
||||
/// </summary>
|
||||
public void ClearOWNBit()
|
||||
{
|
||||
//Read byte from register
|
||||
byte offset = 8;
|
||||
byte data = BinaryHelper.GetByteFrom32bit(this.TSD, offset);
|
||||
|
||||
|
||||
Console.WriteLine("OWN data before: " + BinaryHelper.CheckBit(this.TSD, 13));
|
||||
|
||||
//Turn off single OWN bit
|
||||
//data &= (byte)~(1 << (byte)(BitValue.OWN - offset));
|
||||
data &= (byte)~(1 << (byte)(13 - offset));
|
||||
|
||||
//TODO, change to this instead...
|
||||
// if (BinaryHelper.CheckBit(data, 13 - offset)) //OWN bit is HIGH
|
||||
// BinaryHelper.FlipBit(data, 13 - offset);
|
||||
|
||||
//Write all 8 bits back
|
||||
IOSpace.Write8(tdsAddress + offset, data);
|
||||
|
||||
Console.WriteLine("OWN data after: " + BinaryHelper.CheckBit(this.TSD, 13));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The total size in bytes of the data in the descriptor. Must not be longer then 1792 bytes (0x700h), this
|
||||
/// will set Tx queue invalid.
|
||||
/// </summary>
|
||||
public int Size
|
||||
{
|
||||
get
|
||||
{
|
||||
byte offset = 0;
|
||||
//return (int)IOSpace.Read8(this.TSD + offset);
|
||||
//return (int)IOSpace.Read8(
|
||||
Console.WriteLine("TSD is: " + this.TSD);
|
||||
Console.WriteLine("First 8 bits: " + (byte)BinaryHelper.GetByteFrom32bit(this.TSD, offset));
|
||||
return (int)BinaryHelper.GetByteFrom32bit(this.TSD, offset);
|
||||
}
|
||||
set
|
||||
{
|
||||
//TODO: Check this - the register contains 12 bits. We only write 8 bits here.
|
||||
byte offset = 0;
|
||||
IOSpace.Write16(tdsAddress + offset, (UInt16)value);
|
||||
//Console.WriteLine("Wrote value " + (UInt16)value + " to TDSAddress: " + tdsAddress);
|
||||
//Console.WriteLine("Read again: " + IOSpace.Read8(tdsAddress + offset));
|
||||
}
|
||||
}
|
||||
|
||||
public enum BitValue : uint
|
||||
{
|
||||
SIZE = BinaryHelper.BitPos.BIT0, //12 bit long. Must not contain value over 0x700h
|
||||
OWN = BinaryHelper.BitPos.BIT13, //Set to 1 when transmit complete. Defaults to 1.
|
||||
TUN = BinaryHelper.BitPos.BIT14, //Transmit FIFO Underrun. Is set to 1 if TxFIFO was exhausted during transmition.
|
||||
TOK = BinaryHelper.BitPos.BIT15, //Transmit OK.
|
||||
ERTXTH0 = BinaryHelper.BitPos.BIT16, //Early TX Threshold 0-5
|
||||
ERTXTH1 = BinaryHelper.BitPos.BIT17,
|
||||
ERTXTH2 = BinaryHelper.BitPos.BIT18,
|
||||
ERTXTH3 = BinaryHelper.BitPos.BIT19,
|
||||
ERTXTH4 = BinaryHelper.BitPos.BIT20,
|
||||
ERTXTH5 = BinaryHelper.BitPos.BIT21,
|
||||
NCC0 = BinaryHelper.BitPos.BIT24, //Number of Collision Count 0-3
|
||||
NCC1 = BinaryHelper.BitPos.BIT25,
|
||||
NCC2 = BinaryHelper.BitPos.BIT26,
|
||||
NCC3 = BinaryHelper.BitPos.BIT27,
|
||||
CDH = BinaryHelper.BitPos.BIT28, //CD Heart Beat. Cleared in 100Mbps mode.
|
||||
OWC = BinaryHelper.BitPos.BIT29, //Out of Window Collision
|
||||
TABT = BinaryHelper.BitPos.BIT30, //Transmition aborted
|
||||
CRS = BinaryHelper.BitPos.BIT31 //Carrier Sense Lost
|
||||
}
|
||||
|
||||
private static byte currentTSDescriptor = 0;
|
||||
/// <summary>
|
||||
/// Increments to the next Transmit Status Descriptor to use.
|
||||
/// There are four TSD's which are used in round-robin.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static void IncrementTSDescriptor()
|
||||
{
|
||||
const byte NumberOfDescriptors = 4;
|
||||
if (currentTSDescriptor == (NumberOfDescriptors - 1))
|
||||
currentTSDescriptor = 0;
|
||||
else
|
||||
currentTSDescriptor++;
|
||||
}
|
||||
|
||||
public static byte GetCurrentTSDescriptor()
|
||||
{
|
||||
return currentTSDescriptor;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A62F41F4-A759-40FA-90AA-CF8A3C9AC72A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.Hardware.PC.x86</RootNamespace>
|
||||
<AssemblyName>Cosmos.Hardware.PC.x86</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cosmos.Hardware.PC.x86")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Chad Z. Hower")]
|
||||
[assembly: AssemblyProduct("Cosmos.Hardware.PC.x86")]
|
||||
[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("411d2b0b-d9d0-485a-a06c-c106c2aba25a")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B024FADF-EF04-4602-A0F4-49016D68B2AF}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.Hardware.PC</RootNamespace>
|
||||
<AssemblyName>Cosmos.Hardware.PC</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>Cosmos.snk</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Bus\CPUBus.cs" />
|
||||
<Compile Include="Bus\CPU\Keyboard.cs" />
|
||||
<Compile Include="Bus\CPU\PIC.cs" />
|
||||
<Compile Include="Bus\AddressSpace.cs" />
|
||||
<Compile Include="Bus\PCIBus.cs" />
|
||||
<Compile Include="DebugUtil.cs" />
|
||||
<Compile Include="Global.cs" />
|
||||
<Compile Include="Interrupts.cs" />
|
||||
<Compile Include="Processor.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Cosmos\Cosmos.Hardware\Cosmos.Hardware.csproj">
|
||||
<Project>{CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}</Project>
|
||||
<Name>Cosmos.Hardware</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Cosmos.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
Binary file not shown.
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cosmos.Hardware.PC")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Chad Z. Hower")]
|
||||
[assembly: AssemblyProduct("Cosmos.Hardware.PC")]
|
||||
[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("e2b5a184-1d28-45b6-b574-23977738d1ba")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{289839F2-263E-4B79-B63B-8CB8BF0788E1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.Hardware.Network.Ethernet.RTL8139</RootNamespace>
|
||||
<AssemblyName>Cosmos.Hardware.Network.Ethernet.RTL8139</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cosmos.Hardware.Network.Ethernet.RTL8139")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Chad Z. Hower")]
|
||||
[assembly: AssemblyProduct("Cosmos.Hardware.Network.Ethernet.RTL8139")]
|
||||
[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("46cc9611-2abc-4bac-bcc6-33b21d290252")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{00494BF0-8629-4D18-993B-224441E460D1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.Hardware.Network.Ethernet</RootNamespace>
|
||||
<AssemblyName>Cosmos.Hardware.Network.Ethernet</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Cosmos.Hardware.Network.Ethernet")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Chad Z. Hower")]
|
||||
[assembly: AssemblyProduct("Cosmos.Hardware.Network.Ethernet")]
|
||||
[assembly: AssemblyCopyright("Copyright © Chad Z. Hower 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("148b2fe3-790a-42a9-bb91-e7913c5de580")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Loading…
Reference in a new issue