[SqNOS] We can now send ethernet packets!

Gerardo Richarte gera at corest.com
Sat Jul 15 05:14:57 UTC 2006


What we have today is a very simple (and pour) implementation of the
LanceNICDevice, however, I think it's a decent starting point. With what
I just send to Squeaksource we can now do things like:

"Initializae Networking"
LancePCIDevice installOn: Computer current.

"easy accesors"
netdev := Computer current defaultNetworkInterface.
netdev enableInterrupts.
tring := netdev initializationBlock transmitRing.

"Build EthernetPacket"
eth := EthernetPacket new: 1000.
eth source: ((ByteArray new: 6) copyFrom: netdev macAddress).
eth destination: ((ByteArray new: 6) atAllPut: 255).

"Build ARPPacket (ARP Request)"
arp := ARPPacket on: eth.
eth type: arp class etherType.

arp opcodeName: #Request.
arp senderHardwareAddress: eth source.
arp senderProtocolAddress: (InternetAddress fromString: '192.168.247.128').
arp targetProtocolAddress: (InternetAddress fromString: '192.168.247.1').

"send"
tring message: eth asString.

    This will install and initialize the device, then it will generate a
proper ARP request, send it... and get a proper response from a real box :-)

    this is so exciting!!!
    I'm happy, and I'm going to sleep now :-)
    stay tunned, I think we'll have a new release on Sunday, and it'll
hopefully be a really good one :-)

    gera


More information about the SqueakNOS mailing list