Nvreformat
Posts: 12
Joined: Thu Feb 05, 2015 8:01 pm

[Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 6:48 am

I've written an utility that does allow you to boot a custom kernel using the RPi onboard ethernet port.
It's still in a very early stage, so it may have some bugs that I don't know yet.

Info about usage and compilation can be found at:
https://github.com/Nvreformat/Etherboot

Issues:

*Although it has protection against packet loss, it looks like it doesn't work properly. Sometimes it will stop while transferring the kernel and halt there.

Any help is appreciated.

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 9:57 am

hi
i didn't read all your code but i think it should have support for usb too ;)
is it based on a custom buffered "kexec" ?
if yes multi-boot from anything is ours with your code ;)
do you plan to add some small tools to rescue a partition/os or to just be able to work ?
thanks

Nvreformat
Posts: 12
Joined: Thu Feb 05, 2015 8:01 pm

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 11:08 am

kriss wrote:hi
i didn't read all your code but i think it should have support for usb too ;)
You mean being able to boot kernels from a USB stick?
kriss wrote:is it based on a custom buffered "kexec" ?
if yes multi-boot from anything is ours with your code ;)
I didn't know what kexec was until I read its Wikipedia article right now, so I guess that no.

If it helps, once the new kernel is booted up, it gains full control of the system and the old kernel won't be used anymore.
What this utility does is basically what the RPi does when it's powered on. In fact, I wrote it so that I didn't have to pull/put the SD card evertrime I updated my kernel
kriss wrote:do you plan to add some small tools to rescue a partition/os or to just be able to work ?
thanks
Please elaborate more

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 11:25 am

your code goal is near kexec but best
usb stick and also wire (without ethernet protocol)
tools needed : editor, assembler, fsck ...
anyway why don't you have a RPI2 ???

rst
Posts: 414
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 11:30 am

Nvreformat wrote:Issues:

*Although it has protection against packet loss, it looks like it doesn't work properly. Sometimes it will stop while transferring the kernel and halt there.

Any help is appreciated.
I have pushed a small change to the USPi library to GitHub. There was an issue which caused the USB driver to halt at least in a multi-core configuration (found with a stress test with Circle on the Pi 2). Maybe this problem also did happen here. Perhaps it helps.

Nvreformat
Posts: 12
Joined: Thu Feb 05, 2015 8:01 pm

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 12:22 pm

rst wrote:
Nvreformat wrote:Issues:

*Although it has protection against packet loss, it looks like it doesn't work properly. Sometimes it will stop while transferring the kernel and halt there.

Any help is appreciated.
I have pushed a small change to the USPi library to GitHub. There was an issue which caused the USB driver to halt at least in a multi-core configuration (found with a stress test with Circle on the Pi 2). Maybe this problem also did happen here. Perhaps it helps.
Thanks, I'll update it as soon as I get home.

Now that you mention it, I recall an issue regarding USPi where if you started the driver and let it idle for approx 2 minutes then sometimes USPiReceiveFrame would always fail even though you could see the led blink in the ethernet port when you send some data.

rst
Posts: 414
Joined: Sat Apr 20, 2013 6:42 pm
Location: Germany

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 2:56 pm

Nvreformat wrote:Now that you mention it, I recall an issue regarding USPi where if you started the driver and let it idle for approx 2 minutes then sometimes USPiReceiveFrame would always fail even though you could see the led blink in the ethernet port when you send some data.
I tried to reproduce this problem with and without the last change applied using the USPi ethernet sample but without success. I waited 5 minutes until I attached the Ethernet cable to a Pi 1 B+ and it did receive my ARP pings.

Of course the received frames have to be addressed to this MAC address or must be broadcasts to be successfully received. There is no promiscous mode implemented. I think the LED flashes on every frame the Ethernet controller "sees" on the connector.

kriss
Posts: 66
Joined: Thu Apr 02, 2015 8:53 pm
Location: france for now ...

Re: [Experimental] Loading a kernel using the ethernet port

Mon May 04, 2015 5:50 pm

continue the good work (you two)
i'll be happy to disasm & optimize it ;)

Return to “Bare metal, Assembly language”