git-svn-id: https://spexeah.com:8443/svn/Asuro@703 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron 2018-05-10 14:27:46 +00:00
parent 88e5f04c74
commit 63c2b15181
15 changed files with 9 additions and 5 deletions

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -8,7 +8,8 @@ uses
nettypes, netutils, nettypes, netutils,
net, net,
netlog, netlog,
console; console,
crc;
procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext); procedure send(p_data : void; p_len : uint16; eth_type : uint16; p_context : PPacketContext);
procedure registerType(eType : uint16; RecvCB : TRecvCallback); procedure registerType(eType : uint16; RecvCB : TRecvCallback);
@ -38,6 +39,7 @@ var
hdr : TEthernetHeader; hdr : TEthernetHeader;
pad : sint32; pad : sint32;
size : uint32; size : uint32;
FCS : puint32;
begin begin
pad:= 46 - p_len; pad:= 46 - p_len;
@ -45,7 +47,7 @@ begin
push_trace('eth2.send'); push_trace('eth2.send');
writeToLogLn(' L2: eth2.send'); writeToLogLn(' L2: eth2.send');
if p_context <> nil then begin if p_context <> nil then begin
size:= pad + p_len + sizeof(TEthernetHeader); size:= sizeof(TEthernetHeader) + p_len + pad + 4;
buffer:= kalloc(size); buffer:= kalloc(size);
copyMAC(@p_context^.MAC.Source[0], @hdr.src[0]); copyMAC(@p_context^.MAC.Source[0], @hdr.src[0]);
copyMAC(@p_context^.MAC.Destination[0], @hdr.dst[0]); copyMAC(@p_context^.MAC.Destination[0], @hdr.dst[0]);
@ -53,6 +55,8 @@ begin
hdr.EthTypeLo:= eth_type AND $FF; hdr.EthTypeLo:= eth_type AND $FF;
memcpy(uint32(@hdr), uint32(buffer), sizeof(TEthernetHeader)); memcpy(uint32(@hdr), uint32(buffer), sizeof(TEthernetHeader));
memcpy(uint32(p_data), uint32(buffer)+sizeof(TEthernetHeader), p_len); memcpy(uint32(p_data), uint32(buffer)+sizeof(TEthernetHeader), p_len);
FCS:= puint32((uint32(buffer) + size) - 4);
FCS^:= crc32(puint8(buffer), size - 4);
net.send(buffer, size); net.send(buffer, size);
kfree(buffer); kfree(buffer);
end; end;

View File

@ -9,14 +9,14 @@ const
VERSION_SUB = '1'; VERSION_SUB = '1';
REVISION = '677'; REVISION = '677';
RELEASE = 'ia'; RELEASE = 'ia';
LINE_COUNT = 27909; LINE_COUNT = 28004;
FILE_COUNT = 89; FILE_COUNT = 90;
DRIVER_COUNT = 32; DRIVER_COUNT = 32;
FPC_VERSION = '2.6.4'; FPC_VERSION = '2.6.4';
NASM_VERSION = '2.10.09'; NASM_VERSION = '2.10.09';
MAKE_VERSION = '3.81'; MAKE_VERSION = '3.81';
COMPILE_DATE = '10/05/18'; COMPILE_DATE = '10/05/18';
COMPILE_TIME = '15:00:26'; COMPILE_TIME = '15:27:24';
implementation implementation