02:81:b3:9c:e0:c9 is the MAC address. How does NetBSD get this?
Then I transfer a 1 megabyte file (using scp) and the transfer takes 0.8 seconds. No doubt scp adds some overhead.
Peeking at the transfer using wireshark is interesting. I see linux sending packets 15,980 bytes in size and NetBSD advertising a 32,576 byte TCP window.
Let's calculate some naive times to send a 1,000,000 byte file. This would be 8,000,000 bits and at 10 megabits should go at 0.8 seconds. With a 100 megabit network it should go at 0.08 seconds. How can we do an experiment without the overhead of ssh? What about netcat? I can start a listening server on netbsd with this command:
nc -l 4444 >fileThen I can send my 1M test file from linux via this command:
[tom@trona tom]$ time ncat netbsd 4444 < mega real 0m0.134s user 0m0.038s sys 0m0.006sAha! Now the transfer takes 0.134 second, which is clearly faster than the 0.8 second 10 mbit time, and a bit slower than the 0.08 second ideal 100 mbit time.
Also I will note that the fancy new (albeit 4 year old at this point) U-boot tells me:
## Starting EFI application at 42000000 ...This is a bit of a surprise. I have only heard of EFI (in particular UEFI) in connection with the BIOS on desktop computers. EFI is "extensible firmware interface" and is some kind of standard. It involves a dedicated boot partition. See this:
U-Boot 2018.11 (Jul 02 2022 - 01:48:14 +0000) Allwinner Technology CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi PC DRAM: 1 GiB MMC: SUNXI SD/MMC: 0 Net: phy interface0 eth0: ethernet@1c30000Now I pull the SD card out and click my reset button, again typing on the keyboard. This time I see the LED on the network swith go out when I hit reset, but the now come up showing 10M. So indeed this old version of U-boot has a PHY related bug just as I thought.
U-Boot SPL 2016.11-g29e0cfb-dirty (Jan 09 2017 - 11:19:55) CPU: Allwinner H3 (SUN8I 1680) Model: Xunlong Orange Pi PC Plus DRAM: 1 GiB MMC: SUNXI SD/MMC: 1, SUNXI SD/MMC: 0 Net: phy interface0 eth0: ethernet@1c30000
As an experiment I do this:
setenv zzz fish saveenv Saving Environment to FAT... OKThen I reset the board and once I again get to the U-boot prompt type:
=> printenv zzz zzz=fishThis is exciting because it means it will be easy to persuade this copy of U-boot to network boot Kyu if I want to do that (and easily switch back to booting NetBSD).
su fdisk /dev/sdg p Device Boot Start End Sectors Size Id Type /dev/sdg1 * 32768 196607 163840 80M c W95 FAT32 (LBA) /dev/sdg2 196608 31116287 30919680 14.7G a9 NetBSDLinux will happily mount the FAT partition for me. It has many files, mostly ".dtb" files for other systems.
The file "uboot.env" contains the saved environment variables, including my "zzz=fish". This is not a plain text file though, it is a binary image with all the envionment variables joined together will null bytes between them.
There are 2 big files of almost identical size:
-rw-r--r-- 1 tom tom 8887632 Aug 4 12:04 kernel7.img -rw-r--r-- 1 tom tom 8887640 Aug 4 12:04 netbsd-GENERIC.ubAnd the file boot.ini references the second one of these:
etenv bootargs "awge0.mac-address=${ethaddr}" setenv bootcmd "fatload mmc 0:1 0x21000000 netbsd-GENERIC.ub; fatload mmc 0:1 0x20000000 dtb/meson8b-odroidc1.dtb; bootm 0x21000000 - 0x20000000" run bootcmdThere is also the file "boot.cmd" as follows:
setenv boot_scripts setenv boot_script_dhcp run distro_bootcmdAll this is interesting, but we need to get back to the main thing.
Kyu / [email protected]