Live data from Hacker News

Boot a linux kernel right inside your browser.

bellard.org

151–160 of 255 posts

Re: Boot a linux kernel right inside your browser.

#151

Earlier quoted context omitted.

This is explained well in the Technical Notes section of the site. http://bellard.org/jslinux/tech.html

I saw that, but I don't understand how it's booted.

From what I can see from the minimized JS, it:

- Loads the linux binary and the root memory disk image into 'memory' at the expected addresses (0x100000 and 0x400000, respectively)

- Sets the interpreted x86 CPU's EIP to the kernel's entry point

- Initializes additional requisite register state

- Starts execution.

Take a look at load_binary() and start() functions.

[edit] rickard already discussed this here: http://news.ycombinator.com/item?id=2555552

Re: Boot a linux kernel right inside your browser.

#152
post #50
post #46

ERROR: your browser is too old to run JS/Linux. You should use a recent browser such as Firefox 4.x or Google Chrome. No, it isn't. Stop using user-agent matching and start using JavaScript feature detection instead.

It does. It tests for ArrayBuffer support, outputting that message if the necessary constructors aren't found. What browser are you using that you expect to be supported? (Safari doesn't have support for ArrayBuffer, but a recent WebKit nightly does, and this runs in that).

Even in that case the error messages is still wrong. My browser is up to date, it just does not support the needed feature(s).

Re: Boot a linux kernel right inside your browser.

#153
post #89

Fun command to use: reboot -f

Crashed Firefox portable 4.0.1 for me. What's the intended result?

Iirc the way to reboot an x86 machine is to triple-fault, i.e. execute an interrupt in an interrupt in an interrupt. Could be done by e.g. marking the pagefault handler's stack space as "not available" in the pagetables.

Now if the virtual cpu does not implement that reboot behaviour, the likely result is just an endless recursion of fault handlers. So the script runs an endless loop, hanging Firefox until it notices this and stops it.

Re: Boot a linux kernel right inside your browser.

#156

My favorite bit: # cat /proc/cpuinfo ... f00f bug: yes # Hah! 20 bogomips by the way, at least on Chrome on a MacBook Pro. I sense a whole new era of browser performance testing..

Heh, I get 'Illegal instruction' when I compile and run:

long main = 0xc8c70ff0;

That used to crash my old Pentium box.

Re: Boot a linux kernel right inside your browser.

#157
post #68

Earlier quoted context omitted.

Indeed, this is completely awesome. I first thought it was some remotely hosted virtual machine, but it really runs inside the browser. Insane! Especially considered how fast it is. When he adds X, we can run Firefox inside Linux inside Firefox inside Linux :') Edit: seems the terminal emulator supports ANSI escape codes such as the 16 Linux colors, but not the XTerm 256 color mode (\e[38;5;CCm) or Konsole 24 bit (\e…

No network connection yet either :( ~ # ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B

This would require a server-side component, as the browser has cross-domain limitations and couldn't generate arbitrary network traffic anyway. You could tunnel through websockets, however.

Re: Boot a linux kernel right inside your browser.

#159
post #46

ERROR: your browser is too old to run JS/Linux. You should use a recent browser such as Firefox 4.x or Google Chrome. No, it isn't. Stop using user-agent matching and start using JavaScript feature detection instead.

Yeah, its a poorly worded error message for anyone running the latest version of Opera

Re: Boot a linux kernel right inside your browser.

#160

Earlier quoted context omitted.

Indeed, this is completely awesome. I first thought it was some remotely hosted virtual machine, but it really runs inside the browser. Insane! Especially considered how fast it is. When he adds X, we can run Firefox inside Linux inside Firefox inside Linux :') Edit: seems the terminal emulator supports ANSI escape codes such as the 16 Linux colors, but not the XTerm 256 color mode (\e[38;5;CCm) or Konsole 24 bit (\e…

Sadly my dreams were also crushed when I discovered that lynx wasn't in there. However, wget is there, so all the building blocks are in place.

As far as I can guess, any networking implementation would have to pass low level requests through a proxy on the server, which would end up making things pretty slow even on an unburdened server.
Post reply on HN