RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Sep 15, 2019 10:04 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ] 
Author Message
PostPosted: Thu Mar 19, 2015 4:09 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Finally, Ethernet driver is ready. It works pretty stable on MEB-II board. For more technical information, see Networking wiki page on GitHub.

Unfortunately, MEB-II board is too expensive to recommend it to everybody as a development platform. We need something more affordable. I know Olimex is working on a new pic32mz board with Ethernet interface. It would be great to have networked SDZL variant as well.

To estimate the performance, I used the "flood ping" utility with large packet size. For 10 seconds, pic32mz is capable to receive and transmit 20920 packets of 1500 bytes each. This gives 2092*1500/1000000 = 3.138 Mbytes/sec full duplex data rate, or about 30% of available Ethernet bandwidth. It can be enhanced, as the driver is still not optimal.


Top
 Profile  
 
PostPosted: Thu Mar 19, 2015 3:13 pm 

Joined: Wed Oct 08, 2014 11:03 am
Posts: 71
hi

congratulations on your development. i wonder if the ping of death
will work with this ancient o/s? I seem to remember having fun with
that a long time ago :-)

i don't have an MZ set up so can't test anything but maybe one day...

bye-bye


Top
 Profile  
 
PostPosted: Thu Mar 19, 2015 10:36 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
I recall a particularly fun ping attack we used to do on people with dialup modems...

You sent them a ping with a certain payload, (ping -p 2b2b2b415448 <ip>) and when they replied to that ping, returning the payload, the modem interpreted it as an instruction to hang up (+++ATH). It didn't work on all modems, but most cheap ones lacked the time guards around the +++ and reacted to it regardless.

I used to administer a number of char room systems ("Talkers" as they were called back then) in my youth. Anyone that was particularly troublesome we'd just "ping death" them repeatedly until they got the message to sod off ;) (Admins could get the IP address of anyone connected).

Good times... ;)

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Mar 19, 2015 10:38 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
Serge, can you let me know what components are needed for a suitable interface? Maybe sketch me out a rough schematic so I know what's where? (I have only done ENC28J60 before now).

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Thu Mar 19, 2015 11:36 pm 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
Great !!

I'm working also on the hardware, good beginning are something like that to prototype;

http://www.mouser.es/ProductDetail/Schm ... %2f91Gw%3d

http://www.mouser.es/ProductDetail/Micr ... wrtIY1S4Bp

http://www.mouser.es/ProductDetail/WIZn ... l%2fRj9cud

At the end of next week hope to have the Ethernet hardware ready and modify the if_en.c to adapt pinout to PIC32MZ2048ECM064-I/MR...

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
PostPosted: Fri Mar 20, 2015 7:43 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
majenko wrote:
Serge, can you let me know what components are needed for a suitable interface? Maybe sketch me out a rough schematic so I know what's where? (I have only done ENC28J60 before now).

I've found a few docs on Microchip site you may find useful:

For a list of components, page 27 of MZ starter kit could help. It is based on 8740A, not 8720A, but should be similar: http://ww1.microchip.com/downloads/en/D ... 05147B.pdf


Top
 Profile  
 
PostPosted: Sat Mar 21, 2015 7:22 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Hi Mike,
Mikeloto wrote:
At the end of next week hope to have the Ethernet hardware ready and modify the if_en.c to adapt pinout to PIC32MZ2048ECM064-I/MR...

Actually I already modified the driver, so now it automatically recognizes the chip type and configures all required ethernet pins appropriately. Should work for all 64-pin, 100-pin and 144-pin devices.

I also compiled a table of Ethernet signals and pins, it could help to build the schematics: https://github.com/sergev/LiteBSD/wiki/ ... ernet-pins


Top
 Profile  
 
PostPosted: Sat Mar 21, 2015 7:37 am 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
Perfect Serge !!

These little boys are on the way to our lab....

http://www.wvshare.com/product/LAN8720-ETH-Board.htm

This http://www.mikroe.com/products/view/582/ethernet-phy-board/ is a good design reference also, almost on the PCB says "CE" this means the design gidelines are strong enough about EMI. Unfortunatelly are marked as "obsolete" :shock: product and
can't be ordered.

But the manual have a nice schematic for reference.

http://www.mikroe.com/downloads/get/1447/eth_phy_manual_v100.pdf

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
PostPosted: Sun Mar 22, 2015 4:45 pm 

Joined: Sun Mar 22, 2015 4:36 pm
Posts: 12
I had been looking at getting the Duinomite e-Mega, as it has the built-in ethernet. But all I could find were the "regular" Mega, not the e-Mega. Is the ethernet on the e-Mega supported? If so, it looks like a cool low-cost board. 8-)

As an aside, and nothing to do with BSD, but I like the Duinomite way of being self-contained compared to the Arduino way of flashing code over to the board every time you change something.

:)


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 1:20 pm 
User avatar

Joined: Fri Mar 06, 2015 9:13 pm
Posts: 37
Location: Barcelona, SP
Finally modules to check arrived to the lab, PHY_ID on these modules are 1 changed on the config file recompiled the kernel and checking it....

Code:
4.4BSD-Lite build 0 compiled 2015-03-27
    root@LiteBSD:LiteBSD/sys/compile/ECMB.pic32
cpu: PIC32MZ2048ECM064 rev A5, 200 MHz
oscillator: system PLL div 1:6 mult x50
cache: 16/4 kbytes
real mem = 512 kbytes
avail mem = 340 kbytes
using 18 buffers containing 73728 bytes of memory
spi2 at pins sdi=G7/sdo=G8/sck=G6
en0 at interrupt 153, MAC address d8:80:39:0d:cd:63
en0: <SMSC LAN8720A>
uart1 at pins rx=F4/tx=F5, interrupts 112/113/114, console
uart2 at pins rx=B7/tx=B6, interrupts 145/146/147
uart3 at pins rx=C13/tx=C14, interrupts 157/158/159
uart4 at pins rx=D5/tx=D4, interrupts 170/171/172
sd0 at port spi2, pin cs=G9
sd0: type SDHC, size 7761920 kbytes, speed 16 Mbit/sec
sd0a: partition type b7, sector 2, size 512000 kbytes
sd0b: partition type b8, sector 1024002, size 512000 kbytes
sd0c: partition type b7, sector 2048002, size 512000 kbytes
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!

starting file system checks.
/dev/rsd0a: file system is clean; not checking
/dev/rsd0c: file system is clean; not checking
starting network
en0: link up, 100Mbps, full duplex
clearing /tmp
standard daemons: update inetd.
Sat Mar 21 11:08:28 PST 2015


4.4BSD-Lite (bsd.net) (console)

login: root
Password:
Last login: Sat Mar 21 11:07:56 on console
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.   All rights reserved.

4.4BSD-Lite UNIX #1: Fri Apr 01 00:00:00 PDT 1994

Welcome to 4.4BSD-Lite!

# ifconfig en0 192.168.0.1 netmask 255.255.255.0
# ping 192.168.0.100
PING 192.168.0.100 (192.168.0.100): 56 data bytes
64 bytes from 192.168.0.100: icmp_seq=0 ttl=128 time=0.733 ms
64 bytes from 192.168.0.100: icmp_seq=1 ttl=128 time=0.365 ms
64 bytes from 192.168.0.100: icmp_seq=2 ttl=128 time=0.478 ms
64 bytes from 192.168.0.100: icmp_seq=3 ttl=128 time=0.431 ms
64 bytes from 192.168.0.100: icmp_seq=4 ttl=128 time=0.329 ms
64 bytes from 192.168.0.100: icmp_seq=5 ttl=128 time=0.494 ms
64 bytes from 192.168.0.100: icmp_seq=6 ttl=128 time=0.409 ms
64 bytes from 192.168.0.100: icmp_seq=7 ttl=128 time=0.388 ms
64 bytes from 192.168.0.100: icmp_seq=8 ttl=128 time=0.492 ms
64 bytes from 192.168.0.100: icmp_seq=9 ttl=128 time=0.454 ms
^C
--- 192.168.0.100 ping statistics ---
10 packets transmitted, 10 packets received, 0% packet loss
round-trip min/avg/max = 0.329/0.457/0.733 ms
#


Now the point of interest are the LVDO's for use ethernet (mAmps eater) and finish the PCB design based on the prototype, good performance over ethernet on ftp, etc.... nice Serge !! :P

_________________
Dennis MacAlistair Ritchie (Sep.09.1941 - Oct.12.2011)


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 1:25 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi All,

WOW !!!

Gotta get my own running :).

Wiz


Top
 Profile  
 
PostPosted: Fri Apr 03, 2015 12:16 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
With a few recent modifications, the driver can be considered complete. I tested it with four different transeivers: LAN8720A, LAN8740A, IP101G and LAN9303. Thanks to Microchip for providing the hardware. All four PHY modules work pretty stable. Buffer handling is also enhanced, to eliminate extra data copying. Buffers are now allocated dynamically and freed when the interface is put down.

The system is capable to handle about 16000 packets per second, measured with flood ping.

I tried to make the sources as clean and readable as possible, in case some would need to adapt it to their need or port it to other hardware: https://github.com/sergev/LiteBSD/blob/master/sys/mips/dev/if_en.c


Top
 Profile  
 
PostPosted: Wed Jan 27, 2016 8:00 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Hi, let me ask experts following - there are ebay boards with 8720 with a crystal and without a crystal resonator.
Also they usually provide "LAN8720" type in the info (without A).
Is there any difference - what is your recommendation?
Ie.
http://www.ebay.com/itm/LAN8720-Module- ... Sw6dNWTYBG

http://www.ebay.com/itm/LAN8720-Develop ... SwPgxVNK~N

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Jan 27, 2016 10:08 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Serge and all,

Very impressive :).

I assume we are limited to one ethernet chip per PIC32 MZ? So if I want my box in series with a 'regular' ethernet connection I will need 2 PIC32 MZ's connected to each other? [ or a different type of ethernet chip as the 2nd ethernet port. ]

If I use a WiFire board I could have both an ethernet and a WIFI running on the same PIC32 MZ?

It is truly amazing to watch LiteBSD grow so quickly into a do anything system :).

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 12:07 pm 

Joined: Mon Nov 24, 2014 1:07 pm
Posts: 58
Hi Wiz,

This is why I want to get the KSZ8873 from Micrel working. It's a 3 port switch, 1 of the ports is the RMII interface to connect to the PIC32MZ and the other two form the switch. It would be like having the PIC32MZ permanently connected to a 3 port switch so you could place it between 2 endpoints and sniff off the data for network monitoring and diagnostics purposes.

I've got all the parts, just need to do the pcb design. What I would like to know is if the KSZ8873 would just need configuring in a similar way to the LAN8720 (it uses the same standard interface) and then it would just work? I'm not sure but when I get time I'm going to prototype the board and try it anyway. That may take a lot longer than I'd like as my son arrived 3 weeks ago and is keeping me awake and busy at all hours of the night :/

Still lots of fun though,

Dan


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 2:52 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Dan,

If I had the chip, I could probably do the rest. I suppose I 'should' order some samples.... And get busy coding.

I think it would be VERY interesting to see in what ways my computers [ mostly Dells ] access the web during power up and down.

Given some of the curiousities I have observed, I suspect stuff is going on.

FWIW - I picked up a discarded HP printer a few years ago. Got it up and running. Pushed some button and pages previously printed by the former owner began to be printed !!

Took it apart. Just the usual CPU and DRAM and FLASH. Must have had a hidden file system that probably ran out of room, causing the printer to be discarded.

MOST THOUGHT PROVOKING !!

Is there ANY way to know this laptop has not been hacked. Especially the bios? We really need to be able to dump ALL flash memories and compare them with older copies from time to time.

All that said, I am CERTAIN that my PIC32 system has NOT been hacked [except by me] :).

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 8:51 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
Pushed some button and pages previously printed by the former owner began to be printed !!

That is because you are the person who practices magic.. :P

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Thu Jan 28, 2016 9:49 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Pito,

Sure did get me thinking....

I have a USB laser copier/printer, typical windoze type unit. USB not connected.

At least it has no wireless. So far it seems to still work as a copier. I wonder if its flash will run out one day and it will stop working?

Lots of fun :).

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission