mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-04-03 14:55:06 +01:00
Restructure UDP and TCP #include process.
Add newlines to OS Upgrade questions. Move PCNet interrupt #defines. Improve E1000 PCI device loading. Add comments in E1000 driver to sketch out dev process.
This commit is contained in:
parent
72e706962a
commit
8a5e9328ca
19 changed files with 6109 additions and 5975 deletions
ZealOS-2021-07-06-23_24_42.iso
docs
src
Home/Net
Misc
Binary file not shown.
|
@ -29,10 +29,10 @@ body {background-color:#000000;}
|
|||
<a name="l2"></a> </span><span class=cF2>Author: TomAwezome</span><span class=cF0>
|
||||
<a name="l3"></a>
|
||||
<a name="l4"></a> </span><span class=cF2>Driver is based on:</span><span class=cF0>
|
||||
<a name="l5"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>Linux E1000 implementation</span><span class=cF0>
|
||||
<a name="l6"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>01000101's example E1000 driver</span><span class=cF0>
|
||||
<a name="l7"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>OSDev Intel(R) E1000 documentation</span><span class=cF0>
|
||||
<a name="l8"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>Intel(R) 8254x family datasheet</span><span class=cF0>
|
||||
<a name="l5"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>Linux E1000 driver</span><span class=cF0>
|
||||
<a name="l6"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>01000101's example i825xx driver</span><span class=cF0>
|
||||
<a name="l7"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>OSDev Intel(R) 8254x documentation</span><span class=cF0>
|
||||
<a name="l8"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>Intel(R) PCI/PCI-X Family of Gigabit Ethernet Controllers Software Developer's Manual</span><span class=cF0>
|
||||
<a name="l9"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>any other useful sources.</span><span class=cF0>
|
||||
<a name="l10"></a>
|
||||
<a name="l11"></a> </span><span class=cF2>Guidelines:</span><span class=cF0>
|
||||
|
@ -41,91 +41,129 @@ body {background-color:#000000;}
|
|||
<a name="l14"></a> </span><span class=cF2>-</span><span class=cF0> </span><span class=cF2>Clear documentation.</span><span class=cF0>
|
||||
<a name="l15"></a></span><span class=cF2>*/</span><span class=cF0>
|
||||
<a name="l16"></a>
|
||||
<a name="l17"></a></span><span class=cF2>// TODO: WIP</span><span class=cF0>
|
||||
<a name="l18"></a>
|
||||
<a name="l19"></a></span><span class=cF1>class</span><span class=cF0> CE1000
|
||||
<a name="l20"></a>{
|
||||
<a name="l21"></a> </span><span class=cF9>CPCIDev</span><span class=cF0> *pci;
|
||||
<a name="l22"></a>
|
||||
<a name="l23"></a> </span><span class=cF1>U8</span><span class=cF0> mac_address[</span><span class=cFE>6</span><span class=cF0>];
|
||||
<a name="l24"></a>
|
||||
<a name="l25"></a>} e1000; </span><span class=cF2>// e1000 is the global variable we store all of this into.</span><span class=cF0>
|
||||
<a name="l26"></a>
|
||||
<a name="l27"></a></span><span class=cF9>CPCIDev</span><span class=cF0> *E1000PCIDevFind()
|
||||
<a name="l28"></a>{</span><span class=cF2>// Find and return E1000 card as a CPCIDev pointer.</span><span class=cF0>
|
||||
<a name="l29"></a>
|
||||
<a name="l30"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>PCIDevFind</span><span class=cF0>(,, PCIV_E1000, PCID_82545EM);
|
||||
<a name="l31"></a>}
|
||||
<a name="l32"></a>
|
||||
<a name="l33"></a></span><span class=cF1>U0</span><span class=cF0> EthernetFrameFinish(</span><span class=cF9>I64</span><span class=cF0> de_index)
|
||||
<a name="l34"></a>{</span><span class=cF2>//Alias for driver Finish TX function.</span><span class=cF0>
|
||||
<a name="l35"></a> </span><span class=cF2>//E1000TransmitPacketFinish(de_index);</span><span class=cF0>
|
||||
<a name="l36"></a> </span><span class=cF1>no_warn</span><span class=cF0> de_index;
|
||||
<a name="l37"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l38"></a>}
|
||||
<a name="l39"></a>
|
||||
<a name="l40"></a></span><span class=cF2>/*</span><span class=cF0>
|
||||
<a name="l41"></a></span><span class=cF2>U0 PCIInterruptsReroute(I64 base)</span><span class=cF0>
|
||||
<a name="l42"></a></span><span class=cF2>{ // todo: comments explaining process, maybe better var names</span><span class=cF0>
|
||||
<a name="l43"></a> </span><span class=cF2>I64</span><span class=cF0> </span><span class=cF2> i;</span><span class=cF0>
|
||||
<a name="l44"></a> </span><span class=cF2>U8</span><span class=cF0> </span><span class=cF2>*da = dev.uncached_alias + IOAPIC_REG;</span><span class=cF0>
|
||||
<a name="l45"></a> </span><span class=cF2>U32 *_d = dev.uncached_alias + IOAPIC_DATA;</span><span class=cF0>
|
||||
<a name="l46"></a>
|
||||
<a name="l47"></a> </span><span class=cF2>for (i = 0; i < 4; i++)</span><span class=cF0>
|
||||
<a name="l48"></a> </span><span class=cF2>{</span><span class=cF0>
|
||||
<a name="l49"></a> </span><span class=cF2>*da = IOREDTAB + i * 2 + 1;</span><span class=cF0>
|
||||
<a name="l50"></a> </span><span class=cF2>*_d = dev.mp_apic_ids[INT_DEST_CPU] << 24;</span><span class=cF0>
|
||||
<a name="l51"></a> </span><span class=cF2>*da = IOREDTAB + i * 2;</span><span class=cF0>
|
||||
<a name="l52"></a> </span><span class=cF2>*_d = 0x4000 + base + i;</span><span class=cF0>
|
||||
<a name="l53"></a> </span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l54"></a></span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l55"></a>
|
||||
<a name="l56"></a>
|
||||
<a name="l57"></a></span><span class=cF2>U0 E1000InterruptsSetup()</span><span class=cF0>
|
||||
<a name="l58"></a></span><span class=cF2>{</span><span class=cF0>
|
||||
<a name="l59"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>PCIInterruptsReroute(I_E10000);</span><span class=cF0>
|
||||
<a name="l60"></a> </span><span class=cF2>NetErr("TODO E1000");</span><span class=cF0>
|
||||
<a name="l61"></a></span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l62"></a></span><span class=cF2>*/</span><span class=cF0>
|
||||
<a name="l63"></a>
|
||||
<a name="l64"></a></span><span class=cF1>U0</span><span class=cF0> E1000Init()
|
||||
<a name="l65"></a>{
|
||||
<a name="l66"></a> </span><span class=cF5>MemSet</span><span class=cF0>(&e1000, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CE1000</span><span class=cF7>)</span><span class=cF0>); </span><span class=cF2>// e1000 global var will hold member data the driver uses often.</span><span class=cF0>
|
||||
<a name="l67"></a>
|
||||
<a name="l68"></a> e1000.pci = E1000PCIDevFind;
|
||||
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (!e1000.pci)
|
||||
<a name="l70"></a> </span><span class=cF1>return</span><span class=cF0>; </span><span class=cF2>// if we don't find the card, quit.</span><span class=cF0>
|
||||
<a name="l17"></a></span><span class=cF1>class</span><span class=cF0> CE1000
|
||||
<a name="l18"></a>{
|
||||
<a name="l19"></a> </span><span class=cF9>CPCIDev</span><span class=cF0> *pci;
|
||||
<a name="l20"></a>
|
||||
<a name="l21"></a> </span><span class=cF1>U8</span><span class=cF0> mac_address[</span><span class=cFE>6</span><span class=cF0>];
|
||||
<a name="l22"></a> </span><span class=cF9>U64</span><span class=cF0> mmio_address;
|
||||
<a name="l23"></a>
|
||||
<a name="l24"></a>} e1000; </span><span class=cF2>// e1000 is the global variable we store all of this into.</span><span class=cF0>
|
||||
<a name="l25"></a>
|
||||
<a name="l26"></a></span><span class=cF9>CPCIDev</span><span class=cF0> *E1000PCIDevFind()
|
||||
<a name="l27"></a>{</span><span class=cF2>// Find and return E1000 card as a CPCIDev pointer.</span><span class=cF0>
|
||||
<a name="l28"></a>
|
||||
<a name="l29"></a> </span><span class=cF9>CPCIDev</span><span class=cF0> *pci = </span><span class=cF5>PCIDevFind</span><span class=cF0>(</span><span class=cF3>PCIC_NETWORK</span><span class=cF0>,, PCIV_E1000);
|
||||
<a name="l30"></a>
|
||||
<a name="l31"></a> </span><span class=cF1>if</span><span class=cF0> (!pci)
|
||||
<a name="l32"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
||||
<a name="l33"></a>
|
||||
<a name="l34"></a> </span><span class=cF5>ClassRep</span><span class=cF0>(pci);
|
||||
<a name="l35"></a>
|
||||
<a name="l36"></a> </span><span class=cF1>switch</span><span class=cF0> (pci->device_id)
|
||||
<a name="l37"></a> </span><span class=cF7>{</span><span class=cF0>
|
||||
<a name="l38"></a> </span><span class=cF1>case</span><span class=cF0> PCID_82545EM:
|
||||
<a name="l39"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||||
<a name="l40"></a>
|
||||
<a name="l41"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||||
<a name="l42"></a> pci = </span><span class=cF3>NULL</span><span class=cF0>;
|
||||
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
|
||||
<a name="l44"></a>
|
||||
<a name="l45"></a> </span><span class=cF1>return</span><span class=cF0> pci;
|
||||
<a name="l46"></a>}
|
||||
<a name="l47"></a>
|
||||
<a name="l48"></a></span><span class=cF1>U0</span><span class=cF0> EthernetFrameFinish(</span><span class=cF9>I64</span><span class=cF0> de_index)
|
||||
<a name="l49"></a>{</span><span class=cF2>//Alias for driver Finish TX function.</span><span class=cF0>
|
||||
<a name="l50"></a> </span><span class=cF2>//E1000TransmitPacketFinish(de_index);</span><span class=cF0>
|
||||
<a name="l51"></a> </span><span class=cF1>no_warn</span><span class=cF0> de_index;
|
||||
<a name="l52"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l53"></a>}
|
||||
<a name="l54"></a>
|
||||
<a name="l55"></a></span><span class=cF2>/*</span><span class=cF0>
|
||||
<a name="l56"></a></span><span class=cF2>U0 PCIInterruptsReroute(I64 base)</span><span class=cF0>
|
||||
<a name="l57"></a></span><span class=cF2>{ // todo: comments explaining process, maybe better var names</span><span class=cF0>
|
||||
<a name="l58"></a> </span><span class=cF2>I64</span><span class=cF0> </span><span class=cF2> i;</span><span class=cF0>
|
||||
<a name="l59"></a> </span><span class=cF2>U8</span><span class=cF0> </span><span class=cF2>*da = dev.uncached_alias + IOAPIC_REG;</span><span class=cF0>
|
||||
<a name="l60"></a> </span><span class=cF2>U32 *_d = dev.uncached_alias + IOAPIC_DATA;</span><span class=cF0>
|
||||
<a name="l61"></a>
|
||||
<a name="l62"></a> </span><span class=cF2>for (i = 0; i < 4; i++)</span><span class=cF0>
|
||||
<a name="l63"></a> </span><span class=cF2>{</span><span class=cF0>
|
||||
<a name="l64"></a> </span><span class=cF2>*da = IOREDTAB + i * 2 + 1;</span><span class=cF0>
|
||||
<a name="l65"></a> </span><span class=cF2>*_d = dev.mp_apic_ids[INT_DEST_CPU] << 24;</span><span class=cF0>
|
||||
<a name="l66"></a> </span><span class=cF2>*da = IOREDTAB + i * 2;</span><span class=cF0>
|
||||
<a name="l67"></a> </span><span class=cF2>*_d = 0x4000 + base + i;</span><span class=cF0>
|
||||
<a name="l68"></a> </span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l69"></a></span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l70"></a>
|
||||
<a name="l71"></a>
|
||||
<a name="l72"></a> </span><span class=cF6>"\nE1000 driver WIP\n\n"</span><span class=cF0>;
|
||||
<a name="l73"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l74"></a>}
|
||||
<a name="l75"></a>
|
||||
<a name="l76"></a></span><span class=cF9>I64</span><span class=cF0> EthernetFrameAllocate(</span><span class=cF1>U8</span><span class=cF0> **packet_buffer_out,
|
||||
<a name="l77"></a> </span><span class=cF1>U8</span><span class=cF0> *source_address,
|
||||
<a name="l78"></a> </span><span class=cF1>U8</span><span class=cF0> *destination_address,
|
||||
<a name="l79"></a> </span><span class=cF9>U16</span><span class=cF0> ethertype,
|
||||
<a name="l80"></a> </span><span class=cF9>I64</span><span class=cF0> packet_length)
|
||||
<a name="l81"></a>{
|
||||
<a name="l82"></a> </span><span class=cF1>no_warn</span><span class=cF0> packet_buffer_out, source_address, destination_address, ethertype, packet_length;
|
||||
<a name="l83"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l84"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
|
||||
<a name="l85"></a>}
|
||||
<a name="l86"></a>
|
||||
<a name="l87"></a></span><span class=cF1>U8</span><span class=cF0> *EthernetMACGet()
|
||||
<a name="l88"></a>{
|
||||
<a name="l89"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l90"></a> </span><span class=cF1>return</span><span class=cF0> e1000.mac_address;
|
||||
<a name="l91"></a>}
|
||||
<a name="l92"></a>
|
||||
<a name="l93"></a></span><span class=cF1>U0</span><span class=cF0> NetStop()
|
||||
<a name="l94"></a>{
|
||||
<a name="l72"></a></span><span class=cF2>U0 E1000InterruptsSetup()</span><span class=cF0>
|
||||
<a name="l73"></a></span><span class=cF2>{</span><span class=cF0>
|
||||
<a name="l74"></a></span><span class=cF2>//</span><span class=cF0> </span><span class=cF2>PCIInterruptsReroute(I_E1000);</span><span class=cF0>
|
||||
<a name="l75"></a> </span><span class=cF2>NetErr("TODO E1000");</span><span class=cF0>
|
||||
<a name="l76"></a></span><span class=cF2>}</span><span class=cF0>
|
||||
<a name="l77"></a></span><span class=cF2>*/</span><span class=cF0>
|
||||
<a name="l78"></a>
|
||||
<a name="l79"></a></span><span class=cF1>U0</span><span class=cF0> E1000Init()
|
||||
<a name="l80"></a>{
|
||||
<a name="l81"></a> </span><span class=cF5>MemSet</span><span class=cF0>(&e1000, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CE1000</span><span class=cF7>)</span><span class=cF0>); </span><span class=cF2>// e1000 global var will hold member data the driver uses often.</span><span class=cF0>
|
||||
<a name="l82"></a> </span><span class=cF6>"\nE1000 driver WIP\n\n"</span><span class=cF0>;
|
||||
<a name="l83"></a>
|
||||
<a name="l84"></a> e1000.pci = E1000PCIDevFind;
|
||||
<a name="l85"></a> </span><span class=cF1>if</span><span class=cF0> (!e1000.pci)
|
||||
<a name="l86"></a> </span><span class=cF1>return</span><span class=cF0>; </span><span class=cF2>// if we don't find the card, quit.</span><span class=cF0>
|
||||
<a name="l87"></a>
|
||||
<a name="l88"></a>
|
||||
<a name="l89"></a> e1000.mmio_address = </span><span class=cFB>dev</span><span class=cF0>.uncached_alias + e1000.pci->base[</span><span class=cFE>0</span><span class=cF0>] & ~</span><span class=cFE>0xF</span><span class=cF0>;
|
||||
<a name="l90"></a> </span><span class=cF2>// Assuming card supports MMIO... lower 4 bits are hardwired zero (?)</span><span class=cF0>
|
||||
<a name="l91"></a>
|
||||
<a name="l92"></a> </span><span class=cF6>"\nMMIO address: 0x%0X\n"</span><span class=cF0>, e1000.mmio_address;
|
||||
<a name="l93"></a>
|
||||
<a name="l94"></a> </span><span class=cF2>// init rx/tx addrs?</span><span class=cF0>
|
||||
<a name="l95"></a>
|
||||
<a name="l96"></a>}
|
||||
<a name="l96"></a> </span><span class=cF2>// eeprom? MAC ?</span><span class=cF0>
|
||||
<a name="l97"></a>
|
||||
<a name="l98"></a></span><span class=cF1>U0</span><span class=cF0> NetStart()
|
||||
<a name="l99"></a>{
|
||||
<a name="l100"></a>
|
||||
<a name="l101"></a>}
|
||||
<a name="l98"></a> </span><span class=cF2>// setup link? (01000101's driver)</span><span class=cF0>
|
||||
<a name="l99"></a>
|
||||
<a name="l100"></a> </span><span class=cF2>// zero out multicast hash? (linux)</span><span class=cF0>
|
||||
<a name="l101"></a> </span><span class=cF2>// zero out multicast table array (01000101's driver)</span><span class=cF0>
|
||||
<a name="l102"></a>
|
||||
<a name="l103"></a>E1000Init;</span></pre></body>
|
||||
<a name="l103"></a> </span><span class=cF2>// setup link? (linux)</span><span class=cF0>
|
||||
<a name="l104"></a>
|
||||
<a name="l105"></a> </span><span class=cF2>// clear all statistics regs after link establish attempt (linux)</span><span class=cF0>
|
||||
<a name="l106"></a>
|
||||
<a name="l107"></a> </span><span class=cF2>// enable interupts (01000101's driver)</span><span class=cF0>
|
||||
<a name="l108"></a>
|
||||
<a name="l109"></a> </span><span class=cF2>// start rx tx?</span><span class=cF0>
|
||||
<a name="l110"></a>
|
||||
<a name="l111"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l112"></a>}
|
||||
<a name="l113"></a>
|
||||
<a name="l114"></a></span><span class=cF9>I64</span><span class=cF0> EthernetFrameAllocate(</span><span class=cF1>U8</span><span class=cF0> **packet_buffer_out,
|
||||
<a name="l115"></a> </span><span class=cF1>U8</span><span class=cF0> *source_address,
|
||||
<a name="l116"></a> </span><span class=cF1>U8</span><span class=cF0> *destination_address,
|
||||
<a name="l117"></a> </span><span class=cF9>U16</span><span class=cF0> ethertype,
|
||||
<a name="l118"></a> </span><span class=cF9>I64</span><span class=cF0> packet_length)
|
||||
<a name="l119"></a>{
|
||||
<a name="l120"></a> </span><span class=cF1>no_warn</span><span class=cF0> packet_buffer_out, source_address, destination_address, ethertype, packet_length;
|
||||
<a name="l121"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l122"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
|
||||
<a name="l123"></a>}
|
||||
<a name="l124"></a>
|
||||
<a name="l125"></a></span><span class=cF1>U8</span><span class=cF0> *EthernetMACGet()
|
||||
<a name="l126"></a>{
|
||||
<a name="l127"></a> NetErr(</span><span class=cF6>"TODO E1000"</span><span class=cF0>);
|
||||
<a name="l128"></a> </span><span class=cF1>return</span><span class=cF0> e1000.mac_address;
|
||||
<a name="l129"></a>}
|
||||
<a name="l130"></a>
|
||||
<a name="l131"></a></span><span class=cF1>U0</span><span class=cF0> NetStop()
|
||||
<a name="l132"></a>{
|
||||
<a name="l133"></a>
|
||||
<a name="l134"></a>}
|
||||
<a name="l135"></a>
|
||||
<a name="l136"></a></span><span class=cF1>U0</span><span class=cF0> NetStart()
|
||||
<a name="l137"></a>{
|
||||
<a name="l138"></a>
|
||||
<a name="l139"></a>}
|
||||
<a name="l140"></a>
|
||||
<a name="l141"></a>E1000Init;</span></pre></body>
|
||||
</html>
|
||||
|
|
|
@ -43,20 +43,11 @@ body {background-color:#000000;}
|
|||
<a name="l16"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/Sockets"</span><span class=cF0>
|
||||
<a name="l17"></a>
|
||||
<a name="l18"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Utilities/BST"</span><span class=cF0>
|
||||
<a name="l19"></a>
|
||||
<a name="l20"></a></span><span class=cF2>// todo create MakeUDP and MakeTCP to clean this up</span><span class=cF0>
|
||||
<a name="l21"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDP.HH"</span><span class=cF0>
|
||||
<a name="l22"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDPTree"</span><span class=cF0>
|
||||
<a name="l23"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDP.CC"</span><span class=cF0>
|
||||
<a name="l19"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/MakeUDP"</span><span class=cF0>
|
||||
<a name="l20"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/MakeTCP"</span><span class=cF0>
|
||||
<a name="l21"></a>
|
||||
<a name="l22"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/DNS"</span><span class=cF0>
|
||||
<a name="l23"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/DHCP"</span><span class=cF0>
|
||||
<a name="l24"></a>
|
||||
<a name="l25"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCP.HH"</span><span class=cF0>
|
||||
<a name="l26"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCPTree"</span><span class=cF0>
|
||||
<a name="l27"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCP.CC"</span><span class=cF0>
|
||||
<a name="l28"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCPHandler"</span><span class=cF0>
|
||||
<a name="l29"></a>
|
||||
<a name="l30"></a>
|
||||
<a name="l31"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/DNS"</span><span class=cF0>
|
||||
<a name="l32"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/DHCP"</span><span class=cF0>
|
||||
<a name="l33"></a>
|
||||
<a name="l34"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Utilities/NetHandler"</span><span class=cF0> </span><span class=cF2>// needs IPV4, UDP, ICMP</span></pre></body>
|
||||
<a name="l25"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Utilities/NetHandler"</span><span class=cF0> </span><span class=cF2>// needs IPV4, UDP, ICMP</span></pre></body>
|
||||
</html>
|
||||
|
|
33
docs/Home/Net/Protocols/TCP/MakeTCP.CC.html
Executable file
33
docs/Home/Net/Protocols/TCP/MakeTCP.CC.html
Executable file
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
||||
<meta name="generator" content="ZealOS V0.06">
|
||||
<style type="text/css">
|
||||
body {background-color:#000000;}
|
||||
.cF0{color:#ffffff;background-color:#000000;}
|
||||
.cF1{color:#3465a4;background-color:#000000;}
|
||||
.cF2{color:#4e9a06;background-color:#000000;}
|
||||
.cF3{color:#06989a;background-color:#000000;}
|
||||
.cF4{color:#a24444;background-color:#000000;}
|
||||
.cF5{color:#75507b;background-color:#000000;}
|
||||
.cF6{color:#ce982f;background-color:#000000;}
|
||||
.cF7{color:#bcc0b9;background-color:#000000;}
|
||||
.cF8{color:#555753;background-color:#000000;}
|
||||
.cF9{color:#729fcf;background-color:#000000;}
|
||||
.cFA{color:#82bc49;background-color:#000000;}
|
||||
.cFB{color:#34e2e2;background-color:#000000;}
|
||||
.cFC{color:#ac3535;background-color:#000000;}
|
||||
.cFD{color:#ad7fa8;background-color:#000000;}
|
||||
.cFE{color:#fce94f;background-color:#000000;}
|
||||
.cFF{color:#000000;background-color:#000000;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre style="font-family:monospace;font-size:12pt">
|
||||
<a name="l1"></a><span class=cF0>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCP.HH"</span><span class=cF0>
|
||||
<a name="l2"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCPTree"</span><span class=cF0>
|
||||
<a name="l3"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCP.CC"</span><span class=cF0>
|
||||
<a name="l4"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/TCP/TCPHandler"</span><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
|
@ -29,9 +29,10 @@ body {background-color:#000000;}
|
|||
<a name="l1"></a><span class=cF0>Directory of C:/Home/Net/Protocols/TCP
|
||||
<a name="l2"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/index.html#l1"><span class=c04>./</span></a><span class=cF0>
|
||||
<a name="l3"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/index.html#l1"><span class=c04>../</span></a><span class=cF4>
|
||||
<a name="l4"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCP.CC.html#l1"><span class=cF4>TCP.CC</span></a><span class=cF4>
|
||||
<a name="l5"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCPHandler.CC.html#l1"><span class=cF4>TCPHandler.CC</span></a><span class=cF4>
|
||||
<a name="l6"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCPTree.CC.html#l1"><span class=cF4>TCPTree.CC</span></a><span class=cF4>
|
||||
<a name="l7"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCP.HH.html#l1"><span class=cF4>TCP.HH</span></a><span class=cF0>
|
||||
<a name="l4"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/MakeTCP.CC.html#l1"><span class=cF4>MakeTCP.CC</span></a><span class=cF4>
|
||||
<a name="l5"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCP.CC.html#l1"><span class=cF4>TCP.CC</span></a><span class=cF4>
|
||||
<a name="l6"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCPHandler.CC.html#l1"><span class=cF4>TCPHandler.CC</span></a><span class=cF4>
|
||||
<a name="l7"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCPTree.CC.html#l1"><span class=cF4>TCPTree.CC</span></a><span class=cF4>
|
||||
<a name="l8"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/TCP/TCP.HH.html#l1"><span class=cF4>TCP.HH</span></a><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
||||
|
|
32
docs/Home/Net/Protocols/UDP/MakeUDP.CC.html
Executable file
32
docs/Home/Net/Protocols/UDP/MakeUDP.CC.html
Executable file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
||||
<meta name="generator" content="ZealOS V0.06">
|
||||
<style type="text/css">
|
||||
body {background-color:#000000;}
|
||||
.cF0{color:#ffffff;background-color:#000000;}
|
||||
.cF1{color:#3465a4;background-color:#000000;}
|
||||
.cF2{color:#4e9a06;background-color:#000000;}
|
||||
.cF3{color:#06989a;background-color:#000000;}
|
||||
.cF4{color:#a24444;background-color:#000000;}
|
||||
.cF5{color:#75507b;background-color:#000000;}
|
||||
.cF6{color:#ce982f;background-color:#000000;}
|
||||
.cF7{color:#bcc0b9;background-color:#000000;}
|
||||
.cF8{color:#555753;background-color:#000000;}
|
||||
.cF9{color:#729fcf;background-color:#000000;}
|
||||
.cFA{color:#82bc49;background-color:#000000;}
|
||||
.cFB{color:#34e2e2;background-color:#000000;}
|
||||
.cFC{color:#ac3535;background-color:#000000;}
|
||||
.cFD{color:#ad7fa8;background-color:#000000;}
|
||||
.cFE{color:#fce94f;background-color:#000000;}
|
||||
.cFF{color:#000000;background-color:#000000;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<pre style="font-family:monospace;font-size:12pt">
|
||||
<a name="l1"></a><span class=cF0>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDP.HH"</span><span class=cF0>
|
||||
<a name="l2"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDPTree"</span><span class=cF0>
|
||||
<a name="l3"></a>#</span><span class=cF1>include</span><span class=cF0> </span><span class=cF6>"Protocols/UDP/UDP.CC"</span><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
|
@ -29,8 +29,9 @@ body {background-color:#000000;}
|
|||
<a name="l1"></a><span class=cF0>Directory of C:/Home/Net/Protocols/UDP
|
||||
<a name="l2"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/index.html#l1"><span class=c04>./</span></a><span class=cF0>
|
||||
<a name="l3"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/index.html#l1"><span class=c04>../</span></a><span class=cF4>
|
||||
<a name="l4"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDP.CC.html#l1"><span class=cF4>UDP.CC</span></a><span class=cF4>
|
||||
<a name="l5"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDPTree.CC.html#l1"><span class=cF4>UDPTree.CC</span></a><span class=cF4>
|
||||
<a name="l6"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDP.HH.html#l1"><span class=cF4>UDP.HH</span></a><span class=cF0>
|
||||
<a name="l4"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/MakeUDP.CC.html#l1"><span class=cF4>MakeUDP.CC</span></a><span class=cF4>
|
||||
<a name="l5"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDP.CC.html#l1"><span class=cF4>UDP.CC</span></a><span class=cF4>
|
||||
<a name="l6"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDPTree.CC.html#l1"><span class=cF4>UDPTree.CC</span></a><span class=cF4>
|
||||
<a name="l7"></a></span><a href="https://tomawezome.github.io/ZealOS/Home/Net/Protocols/UDP/UDP.HH.html#l1"><span class=cF4>UDP.HH</span></a><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
||||
|
|
|
@ -47,5 +47,19 @@ body {background-color:#000000;}
|
|||
<a name="l20"></a>
|
||||
<a name="l21"></a>#</span><span class=cF1>define</span><span class=cF0> IP_ADDRESS_LENGTH </span><span class=cFE>4</span><span class=cF0>
|
||||
<a name="l22"></a>
|
||||
<a name="l23"></a></span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>PCNet reroutes PCI interrupts to software. See </span><span class=cF4><u>PCNet</u></span><span class=cF2>.</span><span class=cF0>
|
||||
<a name="l24"></a> </span><span class=cF2>Net Handler interrupt is generated whenever an entry is</span><span class=cF0>
|
||||
<a name="l25"></a> </span><span class=cF2>pushed to the NetQueue. See </span><span class=cF4><u>NetHandler</u></span><span class=cF2>.</span><span class=cF0>
|
||||
<a name="l26"></a>
|
||||
<a name="l27"></a> </span><span class=cF2>TODO: Make a function to auto-allocate these;</span><span class=cF0>
|
||||
<a name="l28"></a> </span><span class=cF2> See note above </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l342"><span class=cF4>I_USER</span></a><span class=cF2>. */</span><span class=cF0>
|
||||
<a name="l29"></a>
|
||||
<a name="l30"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET0 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>0</span><span class=cF0>
|
||||
<a name="l31"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET1 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>
|
||||
<a name="l32"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET2 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>
|
||||
<a name="l33"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET3 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>3</span><span class=cF0>
|
||||
<a name="l34"></a>#</span><span class=cF1>define</span><span class=cF0> I_NETHANDLER </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>4</span><span class=cF0>
|
||||
<a name="l35"></a>
|
||||
<a name="l36"></a>#</span><span class=cF1>define</span><span class=cF0> INT_DEST_CPU </span><span class=cFE>0</span><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
||||
|
|
|
@ -49,65 +49,52 @@ body {background-color:#000000;}
|
|||
<a name="l22"></a>
|
||||
<a name="l23"></a></span><span class=cF9>CQueue</span><span class=cF0> *net_queue; </span><span class=cF2>// no QueueRemove the Head! only Entries!</span><span class=cF0>
|
||||
<a name="l24"></a>
|
||||
<a name="l25"></a>
|
||||
<a name="l26"></a></span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>PCNet reroutes PCI interrupts to software. See </span><span class=cF4><u>PCNet</u></span><span class=cF2>.</span><span class=cF0>
|
||||
<a name="l27"></a> </span><span class=cF2>Net Handler interrupt is generated whenever an entry is</span><span class=cF0>
|
||||
<a name="l28"></a> </span><span class=cF2>pushed to the NetQueue. See </span><span class=cF4><u>NetHandler</u></span><span class=cF2> */</span><span class=cF0>
|
||||
<a name="l29"></a>
|
||||
<a name="l30"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET0 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>0</span><span class=cF0>
|
||||
<a name="l31"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET1 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>
|
||||
<a name="l32"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET2 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>2</span><span class=cF0>
|
||||
<a name="l33"></a>#</span><span class=cF1>define</span><span class=cF0> I_PCNET3 </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>3</span><span class=cF0>
|
||||
<a name="l34"></a>#</span><span class=cF1>define</span><span class=cF0> I_NETHANDLER </span><span class=cF3>I_USER</span><span class=cF0> + </span><span class=cFE>4</span><span class=cF0>
|
||||
<a name="l35"></a>
|
||||
<a name="l36"></a>#</span><span class=cF1>define</span><span class=cF0> INT_DEST_CPU </span><span class=cFE>0</span><span class=cF0>
|
||||
<a name="l37"></a>
|
||||
<a name="l38"></a></span><span class=cF1>U0</span><span class=cF0> NetQueueInit()
|
||||
<a name="l39"></a>{
|
||||
<a name="l40"></a> net_queue = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CQueue</span><span class=cF7>)</span><span class=cF0>);
|
||||
<a name="l41"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(net_queue);
|
||||
<a name="l42"></a>}
|
||||
<a name="l43"></a>
|
||||
<a name="l44"></a>CNetQueueEntry *NetQueuePull()
|
||||
<a name="l45"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Returns a pointer to a CNetQueueEntry,</span><span class=cF0>
|
||||
<a name="l46"></a> </span><span class=cF2>or NULL pointer if Net Queue is empty. */</span><span class=cF0>
|
||||
<a name="l47"></a>
|
||||
<a name="l48"></a> CNetQueueEntry *entry;
|
||||
<a name="l49"></a>
|
||||
<a name="l50"></a> </span><span class=cF1>if</span><span class=cF0> (net_queue->next != net_queue)
|
||||
<a name="l51"></a> </span><span class=cF7>{</span><span class=cF0>
|
||||
<a name="l52"></a> entry = net_queue->next;
|
||||
<a name="l53"></a>
|
||||
<a name="l54"></a> NetLog(</span><span class=cF6>"NETQUEUE PULL: Removing entry from queue."</span><span class=cF0>);
|
||||
<a name="l55"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(entry);
|
||||
<a name="l56"></a> </span><span class=cF7>}</span><span class=cF0>
|
||||
<a name="l57"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF2>// Queue is empty if head->next is head itself.</span><span class=cF0>
|
||||
<a name="l58"></a> </span><span class=cF7>{</span><span class=cF0>
|
||||
<a name="l59"></a> entry = </span><span class=cF3>NULL</span><span class=cF0>;
|
||||
<a name="l60"></a> </span><span class=cF7>}</span><span class=cF0>
|
||||
<a name="l25"></a></span><span class=cF1>U0</span><span class=cF0> NetQueueInit()
|
||||
<a name="l26"></a>{
|
||||
<a name="l27"></a> net_queue = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CQueue</span><span class=cF7>)</span><span class=cF0>);
|
||||
<a name="l28"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(net_queue);
|
||||
<a name="l29"></a>}
|
||||
<a name="l30"></a>
|
||||
<a name="l31"></a>CNetQueueEntry *NetQueuePull()
|
||||
<a name="l32"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Returns a pointer to a CNetQueueEntry,</span><span class=cF0>
|
||||
<a name="l33"></a> </span><span class=cF2>or NULL pointer if Net Queue is empty. */</span><span class=cF0>
|
||||
<a name="l34"></a>
|
||||
<a name="l35"></a> CNetQueueEntry *entry;
|
||||
<a name="l36"></a>
|
||||
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (net_queue->next != net_queue)
|
||||
<a name="l38"></a> </span><span class=cF7>{</span><span class=cF0>
|
||||
<a name="l39"></a> entry = net_queue->next;
|
||||
<a name="l40"></a>
|
||||
<a name="l41"></a> NetLog(</span><span class=cF6>"NETQUEUE PULL: Removing entry from queue."</span><span class=cF0>);
|
||||
<a name="l42"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(entry);
|
||||
<a name="l43"></a> </span><span class=cF7>}</span><span class=cF0>
|
||||
<a name="l44"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF2>// Queue is empty if head->next is head itself.</span><span class=cF0>
|
||||
<a name="l45"></a> </span><span class=cF7>{</span><span class=cF0>
|
||||
<a name="l46"></a> entry = </span><span class=cF3>NULL</span><span class=cF0>;
|
||||
<a name="l47"></a> </span><span class=cF7>}</span><span class=cF0>
|
||||
<a name="l48"></a>
|
||||
<a name="l49"></a> </span><span class=cF1>return</span><span class=cF0> entry;
|
||||
<a name="l50"></a>}
|
||||
<a name="l51"></a>
|
||||
<a name="l52"></a></span><span class=cF1>U0</span><span class=cF0> NetQueuePush(</span><span class=cF1>U8</span><span class=cF0> *data, </span><span class=cF9>I64</span><span class=cF0> length)
|
||||
<a name="l53"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Pushes a copy of the packet data and length</span><span class=cF0>
|
||||
<a name="l54"></a> </span><span class=cF2>into the Net Queue. The NetQueueEntry is inserted</span><span class=cF0>
|
||||
<a name="l55"></a> </span><span class=cF2>after the last entry of net_queue to keep new</span><span class=cF0>
|
||||
<a name="l56"></a> </span><span class=cF2>items in the back of the Queue, old in front. */</span><span class=cF0>
|
||||
<a name="l57"></a>
|
||||
<a name="l58"></a> CNetQueueEntry *entry = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CNetQueueEntry</span><span class=cF7>)</span><span class=cF0>);
|
||||
<a name="l59"></a>
|
||||
<a name="l60"></a> entry->packet_length = length;
|
||||
<a name="l61"></a>
|
||||
<a name="l62"></a> </span><span class=cF1>return</span><span class=cF0> entry;
|
||||
<a name="l63"></a>}
|
||||
<a name="l64"></a>
|
||||
<a name="l65"></a></span><span class=cF1>U0</span><span class=cF0> NetQueuePush(</span><span class=cF1>U8</span><span class=cF0> *data, </span><span class=cF9>I64</span><span class=cF0> length)
|
||||
<a name="l66"></a>{</span><span class=cF2>/*</span><span class=cF0> </span><span class=cF2>Pushes a copy of the packet data and length</span><span class=cF0>
|
||||
<a name="l67"></a> </span><span class=cF2>into the Net Queue. The NetQueueEntry is inserted</span><span class=cF0>
|
||||
<a name="l68"></a> </span><span class=cF2>after the last entry of net_queue to keep new</span><span class=cF0>
|
||||
<a name="l69"></a> </span><span class=cF2>items in the back of the Queue, old in front. */</span><span class=cF0>
|
||||
<a name="l62"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(entry->frame, data, length);
|
||||
<a name="l63"></a>
|
||||
<a name="l64"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(entry, net_queue->last);
|
||||
<a name="l65"></a>
|
||||
<a name="l66"></a> </span><span class=cF2>// Generate Net Handler interrupt.</span><span class=cF0>
|
||||
<a name="l67"></a> NetLog(</span><span class=cF6>"NETQUEUE PUSH COPY: Generating NetHandler interrupt."</span><span class=cF0>);
|
||||
<a name="l68"></a> </span><span class=cF5>MPInt</span><span class=cF0>(I_NETHANDLER, INT_DEST_CPU);
|
||||
<a name="l69"></a>}
|
||||
<a name="l70"></a>
|
||||
<a name="l71"></a> CNetQueueEntry *entry = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CNetQueueEntry</span><span class=cF7>)</span><span class=cF0>);
|
||||
<a name="l72"></a>
|
||||
<a name="l73"></a> entry->packet_length = length;
|
||||
<a name="l74"></a>
|
||||
<a name="l75"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(entry->frame, data, length);
|
||||
<a name="l76"></a>
|
||||
<a name="l77"></a> </span><span class=cF5>QueueInsert</span><span class=cF0>(entry, net_queue->last);
|
||||
<a name="l78"></a>
|
||||
<a name="l79"></a> </span><span class=cF2>// Generate Net Handler interrupt.</span><span class=cF0>
|
||||
<a name="l80"></a> NetLog(</span><span class=cF6>"NETQUEUE PUSH COPY: Generating NetHandler interrupt."</span><span class=cF0>);
|
||||
<a name="l81"></a> </span><span class=cF5>MPInt</span><span class=cF0>(I_NETHANDLER, INT_DEST_CPU);
|
||||
<a name="l82"></a>}
|
||||
<a name="l83"></a>
|
||||
<a name="l84"></a>
|
||||
<a name="l85"></a>NetQueueInit;</span></pre></body>
|
||||
<a name="l71"></a>
|
||||
<a name="l72"></a>NetQueueInit;</span></pre></body>
|
||||
</html>
|
||||
|
|
|
@ -28,7 +28,6 @@ body {background-color:#000000;}
|
|||
<pre style="font-family:monospace;font-size:12pt">
|
||||
<a name="l1"></a><span class=cF5><u>+] System
|
||||
<a name="l2"></a>+] Once</span><span class=c0A>
|
||||
<a name="l3"></a>+] AutoComplete</span><span class=cF5>
|
||||
<a name="l4"></a>+] ZealOS</u></span><span class=cF0>
|
||||
<a name="l3"></a>+] AutoComplete</u></span><span class=cF0>
|
||||
</span></pre></body>
|
||||
</html>
|
||||
|
|
|
@ -127,7 +127,7 @@ body {background-color:#000000;}
|
|||
<a name="l100"></a>
|
||||
<a name="l101"></a> </span><span class=cF5>XTalk</span><span class=cF0>(task, </span><span class=cF6>"Mount;\nC\n"</span><span class=cF0>);
|
||||
<a name="l102"></a>
|
||||
<a name="l103"></a> </span><span class=cF6>"\nSelect the port of the ATA drive with an existing installation.\n"</span><span class=cF0>;
|
||||
<a name="l103"></a> </span><span class=cF6>"\n\nSelect the port of the ATA drive with an existing installation.\n\n"</span><span class=cF0>;
|
||||
<a name="l104"></a>
|
||||
<a name="l105"></a> </span><span class=cF6>"Hard Drive Port: "</span><span class=cF0>;
|
||||
<a name="l106"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
||||
|
|
11541
docs/index.html
11541
docs/index.html
File diff suppressed because it is too large
Load diff
|
@ -2,10 +2,10 @@
|
|||
Author: TomAwezome
|
||||
|
||||
Driver is based on:
|
||||
- Linux E1000 implementation
|
||||
- 01000101's example E1000 driver
|
||||
- OSDev Intel(R) E1000 documentation
|
||||
- Intel(R) 8254x family datasheet
|
||||
- Linux E1000 driver
|
||||
- 01000101's example i825xx driver
|
||||
- OSDev Intel(R) 8254x documentation
|
||||
- Intel(R) PCI/PCI-X Family of Gigabit Ethernet Controllers Software Developer's Manual
|
||||
- any other useful sources.
|
||||
|
||||
Guidelines:
|
||||
|
@ -14,20 +14,35 @@
|
|||
- Clear documentation.
|
||||
*/
|
||||
|
||||
// TODO: WIP
|
||||
|
||||
class CE1000
|
||||
{
|
||||
CPCIDev *pci;
|
||||
|
||||
U8 mac_address[6];
|
||||
U64 mmio_address;
|
||||
|
||||
} e1000; // e1000 is the global variable we store all of this into.
|
||||
|
||||
CPCIDev *E1000PCIDevFind()
|
||||
{// Find and return E1000 card as a CPCIDev pointer.
|
||||
|
||||
return PCIDevFind(,, PCIV_E1000, PCID_82545EM);
|
||||
CPCIDev *pci = PCIDevFind(PCIC_NETWORK,, PCIV_E1000);
|
||||
|
||||
if (!pci)
|
||||
return NULL;
|
||||
|
||||
ClassRep(pci);
|
||||
|
||||
switch (pci->device_id)
|
||||
{
|
||||
case PCID_82545EM:
|
||||
break;
|
||||
|
||||
default:
|
||||
pci = NULL;
|
||||
}
|
||||
|
||||
return pci;
|
||||
}
|
||||
|
||||
U0 EthernetFrameFinish(I64 de_index)
|
||||
|
@ -56,7 +71,7 @@ U0 PCIInterruptsReroute(I64 base)
|
|||
|
||||
U0 E1000InterruptsSetup()
|
||||
{
|
||||
// PCIInterruptsReroute(I_E10000);
|
||||
// PCIInterruptsReroute(I_E1000);
|
||||
NetErr("TODO E1000");
|
||||
}
|
||||
*/
|
||||
|
@ -64,12 +79,35 @@ U0 E1000InterruptsSetup()
|
|||
U0 E1000Init()
|
||||
{
|
||||
MemSet(&e1000, 0, sizeof(CE1000)); // e1000 global var will hold member data the driver uses often.
|
||||
"\nE1000 driver WIP\n\n";
|
||||
|
||||
e1000.pci = E1000PCIDevFind;
|
||||
if (!e1000.pci)
|
||||
return; // if we don't find the card, quit.
|
||||
|
||||
"\nE1000 driver WIP\n\n";
|
||||
|
||||
e1000.mmio_address = dev.uncached_alias + e1000.pci->base[0] & ~0xF;
|
||||
// Assuming card supports MMIO... lower 4 bits are hardwired zero (?)
|
||||
|
||||
"\nMMIO address: 0x%0X\n", e1000.mmio_address;
|
||||
|
||||
// init rx/tx addrs?
|
||||
|
||||
// eeprom? MAC ?
|
||||
|
||||
// setup link? (01000101's driver)
|
||||
|
||||
// zero out multicast hash? (linux)
|
||||
// zero out multicast table array (01000101's driver)
|
||||
|
||||
// setup link? (linux)
|
||||
|
||||
// clear all statistics regs after link establish attempt (linux)
|
||||
|
||||
// enable interupts (01000101's driver)
|
||||
|
||||
// start rx tx?
|
||||
|
||||
NetErr("TODO E1000");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,17 +16,8 @@ Cd(__DIR__);
|
|||
#include "Protocols/Sockets"
|
||||
|
||||
#include "Utilities/BST"
|
||||
|
||||
// todo create MakeUDP and MakeTCP to clean this up
|
||||
#include "Protocols/UDP/UDP.HH"
|
||||
#include "Protocols/UDP/UDPTree"
|
||||
#include "Protocols/UDP/UDP.CC"
|
||||
|
||||
#include "Protocols/TCP/TCP.HH"
|
||||
#include "Protocols/TCP/TCPTree"
|
||||
#include "Protocols/TCP/TCP.CC"
|
||||
#include "Protocols/TCP/TCPHandler"
|
||||
|
||||
#include "Protocols/UDP/MakeUDP"
|
||||
#include "Protocols/TCP/MakeTCP"
|
||||
|
||||
#include "Protocols/DNS"
|
||||
#include "Protocols/DHCP"
|
||||
|
|
4
src/Home/Net/Protocols/TCP/MakeTCP.CC
Executable file
4
src/Home/Net/Protocols/TCP/MakeTCP.CC
Executable file
|
@ -0,0 +1,4 @@
|
|||
#include "Protocols/TCP/TCP.HH"
|
||||
#include "Protocols/TCP/TCPTree"
|
||||
#include "Protocols/TCP/TCP.CC"
|
||||
#include "Protocols/TCP/TCPHandler"
|
3
src/Home/Net/Protocols/UDP/MakeUDP.CC
Executable file
3
src/Home/Net/Protocols/UDP/MakeUDP.CC
Executable file
|
@ -0,0 +1,3 @@
|
|||
#include "Protocols/UDP/UDP.HH"
|
||||
#include "Protocols/UDP/UDPTree"
|
||||
#include "Protocols/UDP/UDP.CC"
|
|
@ -20,3 +20,17 @@
|
|||
|
||||
#define IP_ADDRESS_LENGTH 4
|
||||
|
||||
/* PCNet reroutes PCI interrupts to software. See $LK,"PCNet",A="FF:C:/Home/Net/PCNet.CC,I_PCNET0"$.
|
||||
Net Handler interrupt is generated whenever an entry is
|
||||
pushed to the NetQueue. See $LK,"NetHandler",A="FF:C:/Home/Net/NetHandler.CC,I_NETHANDLER"$.
|
||||
|
||||
TODO: Make a function to auto-allocate these;
|
||||
See note above $LK+PU,"I_USER",A="MN:I_USER"$. */
|
||||
|
||||
#define I_PCNET0 I_USER + 0
|
||||
#define I_PCNET1 I_USER + 1
|
||||
#define I_PCNET2 I_USER + 2
|
||||
#define I_PCNET3 I_USER + 3
|
||||
#define I_NETHANDLER I_USER + 4
|
||||
|
||||
#define INT_DEST_CPU 0
|
||||
|
|
|
@ -22,19 +22,6 @@ class CNetQueueEntry:CQueue
|
|||
|
||||
CQueue *net_queue; // no QueueRemove the Head! only Entries!
|
||||
|
||||
|
||||
/* PCNet reroutes PCI interrupts to software. See $LK,"PCNet",A="FF:C:/Home/Net/PCNet.CC,I_PCNET0"$.
|
||||
Net Handler interrupt is generated whenever an entry is
|
||||
pushed to the NetQueue. See $LK,"NetHandler",A="FF:C:/Home/Net/NetHandler.CC,I_NETHANDLER"$ */
|
||||
|
||||
#define I_PCNET0 I_USER + 0
|
||||
#define I_PCNET1 I_USER + 1
|
||||
#define I_PCNET2 I_USER + 2
|
||||
#define I_PCNET3 I_USER + 3
|
||||
#define I_NETHANDLER I_USER + 4
|
||||
|
||||
#define INT_DEST_CPU 0
|
||||
|
||||
U0 NetQueueInit()
|
||||
{
|
||||
net_queue = CAlloc(sizeof(CQueue));
|
||||
|
|
|
@ -100,7 +100,7 @@ U0 OSUpgrade()
|
|||
|
||||
XTalk(task, "Mount;\nC\n");
|
||||
|
||||
"\nSelect the port of the ATA drive with an existing installation.\n";
|
||||
"\n\nSelect the port of the ATA drive with an existing installation.\n\n";
|
||||
|
||||
"Hard Drive Port: ";
|
||||
while (TRUE)
|
||||
|
|
Loading…
Reference in a new issue