News for hackers. Stuff that matters.
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by jstanley on Tuesday October 30, 2018 @07:16AM (#18335441)
Interestingly the VM seems to have internet access via a DigitalOcean instance:

> Access to Internet is possible inside the emulator. It uses the websocket VPN offered by Benjamin Burns (see his blog[0]). The bandwidth is capped to 40 kB/s and at most two connections are allowed per public IP address. Please don't abuse the service.

[0] http://www.benjamincburns.com/2013/11/10/jor1k-ethmac-suppor...

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by s-macke on Tuesday October 30, 2018 @11:50AM (#18337867)
Yes, the emulated computer emulates a network device. This sends the Ethernet frames via web sockets to the proxy server. On the proxy server, the frames are written to a TAP device. Then some firewall rules do the rest.
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by Immortalin on Tuesday October 30, 2018 @11:52AM (#18337893)
Why do you even need the additional layer of redirection when most (port 80 tcp) traffic can be done straight from the browser?
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by jstanley on Tuesday October 30, 2018 @12:32PM (#18338439)
Most port 80 TCP traffic can't be done straight from the browser. E.g. it won't let you write arbitrary headers.

Cross-domain requests won't work for the majority of sites.

And non-HTTP requests can't be done at all from the browser, it would be a pretty limited "network interface" if all it could do was call out to XMLHTTPRequest.

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by ossm1db on Friday November 09, 2018 @12:08AM (#18412459)
Run the websocket proxy yourself and get much better performance: https://github.com/benjamincburns/websockproxy

From the FAQ: "net_url sets the URL of the websocket VPN." I did this and it works great.

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by m4r35n357 on Tuesday October 30, 2018 @05:43AM (#18335049)
This guy is also responsible for Qemu and FFMPEG. https://bellard.org/
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by molticrystal on Tuesday October 30, 2018 @04:29AM (#18334730)
I love the projects this person works on, usually full or close to full implementations in very small amounts of code.

The one I first learned about was Tiny C Compiler. It is discontinued now, but it is an about 100K compiler,linker,assembler that can compile many programs like the links browser. https://bellard.org/tcc/

If that is too large, you can go with the project that inspired it, the Obfuscated Tiny C Compiler, a 2048 byte compiler that supports a subset of C. https://bellard.org/otcc/

All these projects are great for learning from.

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by saagarjha on Tuesday October 30, 2018 @05:02AM (#18334881)
> It is discontinued now

TinyCC is still being developed: https://repo.or.cz/w/tinycc.git

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by equalunique on Thursday November 08, 2018 @09:32PM (#18411969)
The fact that I was able just now to run an X session on a RISC-V VM & direct the Dillio browser to Google - I did not even know these things were possible today. Pretty excited.
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by dmos62 on Tuesday October 30, 2018 @08:23AM (#18335814)
His online scientific calculator is great!

http://numcalc.com/

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by saagarjha on Tuesday October 30, 2018 @04:14AM (#18334673)
I don’t see anything about running this in the browser on that page. Is there a place to demo this somewhere?
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by molticrystal on Tuesday October 30, 2018 @04:17AM (#18334683)
The phrases "Can be used online" and "Javascript version running Linux and Windows 2000. " link to:

https://bellard.org/jslinux/

You can then click on the "Startup link" labeled "click here" for the OS and CPU architecture you want to try out.

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by zrth on Tuesday October 30, 2018 @04:18AM (#18334687)
all versions -> https://bellard.org/jslinux/

riscv64 Linux 4.15.0 (Fedora 29) X Window -> https://bellard.org/jslinux/vm.html?cpu=riscv64&url=https://...

Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by rustcharm on Tuesday October 30, 2018 @12:11PM (#18338120)
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by jetzzz on Tuesday October 30, 2018 @08:29AM (#18335863)
For some reason x86 emulator is not open-source. If you download source, x86 is just stubbed out.
Re:TinyEMU, a RISC-V/i486 VM for Linux in the Browser by molticrystal on Tuesday October 30, 2018 @09:31AM (#18336246)
For the JSlinux one, from the wayback machine:

>In the technical notes, an archive is given which explains how to build the various binary images. The readable source code of the JS PC emulator itself is not yet available. At this point, any mirroring or redistribution of the code needs my explicit permission.

And you can find the stuff referred to here:

http://web.archive.org/web/20141219111736/http://bellard.org...

---------

For tinyemu, my understanding is most of the code is in x86_machine.c , the actual cpu stuff is provided by kvm, the readme states:

>5) x86 emulator A small x86 emulator is included. It is not really an emulator because it uses the Linux KVM API to run the x86 code at near native performance.

> The x86 emulator uses the same set of VirtIO devices as the RISCV emulator and is able to run many operating systems.

>The x86 emulator accepts a Linux kernel image (bzImage). No BIOS image is necessary.

> The x86 emulator comes from my JS/Linux project (2011) which was one of the first emulator running Linux fully implemented in Javascript. It is provided to allow easy access to the x86 images hosted at https://bellard.org/jslinux