Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulling latest linux kernel and rebuilding jor1k #156

Open
unicomp21 opened this issue Aug 9, 2020 · 17 comments
Open

Pulling latest linux kernel and rebuilding jor1k #156

unicomp21 opened this issue Aug 9, 2020 · 17 comments

Comments

@unicomp21
Copy link

I'd like to rebuild jor1k w/ the latest linux kernel. My intention is to experiment w/ the wireguard protocol just added to the linux kernel, and run it over jor1k websockets.

@pflegende
Copy link

great!

A tiny please by me:
It is so a big wish of some years to the santa:
;)
running in jor1k: "gcc -g mytool.c -o mytoolexe ; gdb mytoolexe"
but gdb wan't do it at the moment.

May be, it is not soooo much more to invest ... having a look to the at the moment in jor1k not solved problem with gdb? It is not running now. Something difficult with build says @s-macke sometimes ago ...,
long long ago ...
;)

May be the prerequisites are now better after some time.
... only there as long as casually without trouble would result.
;)

Awesome project!
Good luck!

@s-macke
Copy link
Owner

s-macke commented Aug 13, 2020

I will try to compile the latest kernel.
You are right, that gdb did not work years ago. But it is worth trying again.

@pflegende
Copy link

Good luck!
and much more than this:
KEEP HEALTHY!
:)

@unicomp21
Copy link
Author

thanks @s-macke !

@unicomp21
Copy link
Author

By the way, this is an amazing project. It could change the world on a number of fronts. I still can't believe how fast it runs in a web browser.

@unicomp21
Copy link
Author

unicomp21 commented Aug 14, 2020

If I want to create communication between javascript in a web page and jor1k, w/ both running on the same/main web browser thread, what's the best way to do this?

To provide more background on what I plan to do, I'm wanting to compile and run boringtun within jor1k and then communicate from javascript/browser to jor1k using protobuf messages, probably something similar to an event/message bus.

https://github.com/cloudflare/boringtun
https://github.com/protobufjs/protobuf.js

ie create a virtual nic (vpn connection) within jor1k by tunneling wireguard/udp packets over javascript/browser/websocket.

@unicomp21
Copy link
Author

How hard would it be to make Ubuntu 18.10 run in jor1k? If it isn't easy, please disregard this query.

@unicomp21
Copy link
Author

Is there any way I can help? Would love to learn how to do this myself.

@s-macke
Copy link
Owner

s-macke commented Aug 16, 2020

The kernel is now on version 5.8 with enabled wireguard. In order to cross compile some code you might want to use a pre build toolchain. https://github.com/openrisc/or1k-gcc/releases/tag/or1k-7.2.0-20180317
I haven't tested these, because I use my own toolchain which you can find here. https://jor1k.com/or1k-toolchain.tar.bz2

Ubuntu will not work on this machine. To port Ubuntu on OpenRisc would probably mean a full time job for one year.

@s-macke
Copy link
Owner

s-macke commented Aug 16, 2020

jor1k network connection runs on the lowest level you can imagine. On Ethernet Frames. The frames are sent to a websocket host which then use a Linux TAP device.
The ethernet frames are handled in the following script: https://github.com/s-macke/jor1k/blob/master/js/master/dev/ethernet.js
Dependent on what you want to do exactly this can be very difficult. E. g. build you own TCP/IP Stack implementation.

@unicomp21
Copy link
Author

unicomp21 commented Aug 16, 2020

Thanks @s-macke ! Much appreciated.

In case I need it, is there an example somewhere for creating a pre-build? Or maybe a howto page?

No worries w/ the ethernet frames, I've worked w/ them in the past, building kernel-bypass systems.

@unicomp21

This comment has been minimized.

@andrakis
Copy link

@unicomp21 Yes, you can run the websocket proxy locally in docker, see the websocket proxy project page for a docker command that will set it up locally. You can then change the URL used by the jor1k webpage to point to the correct address (&relayURL=wss://localhost:8080/ or thereabouts.) Note that there is a form of rate limiting applied, but this rate limiting can be disabled with a bit of tweaking in limiter.py. It won't go a heck of a lot faster, but you should be able to break 10kbyte/s.

@unicomp21
Copy link
Author

unicomp21 commented Aug 17, 2020

@andrakis thinking I could speed up this interface dramatically (possibly MB/s if lucky) using RTCDataChannel(s), w/ the guaranteed delivery disabled, instead of websockets, just need to find some time.

@s-macke
Copy link
Owner

s-macke commented Aug 20, 2020

So far no luck with gdb. It has still not been ported to run natively.

What do you mean with pre build? The root filesystem or the emulator itself? For the emulator just look at compile.sh. You just need browserify. You can ignore all the webassembly stuff.

@unicomp21
Copy link
Author

@s-macke Sorry, should have been more clear, I meant the root filesystem (ie building a new kernel)

On the emulator side, would it make sense to "jit" emulated instructions into webassembly? If so, how hard would it be?

@remisharrock
Copy link

So far no luck with gdb. It has still not been ported to run natively.

What do you mean with pre build? The root filesystem or the emulator itself? For the emulator just look at compile.sh. You just need browserify. You can ignore all the webassembly stuff.

Ho I was hoping to have gdb support, should we contact the openrisc community and/or the gdb community for help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants