I don't know much of Javascript, and I want to host the web browser integrated Linux (which can be found here). Reason being I am not always connected to the net, would like to know how it works. No disrespect of the author's license intended.
I tried copying sources of the three files (term.js
, cpux86.js
and the HTML file itself) into a folder, and running the HTML, and it doesn't work.
Any way around to make it work?
Also: if it doesn't work, why is it? The directory structure is copied by me and is almost the same.
PS: I also used Javascript deobfuscator addon for Firefox, but that did not help much either. I did indent all the code to make it more readable, but it's still not understandable :P
To paste data, right click on the terminal cursor to show the contextual menu and select "Paste". Alternatively, you can use the "Paste" command in the navigator global menu.
The JS code itself is not a "Linux clone", it's a propper x86 Virtual Machine loading a Linux kernel.
As such you need at least the file containing the compiled Linux kernel for it to work correctly.
Checking the source shows that (at least) 3 files are loadded from cpux86.js
, which are: vmlinux26.bin
(the Linux kernel), root.bin
(probably the root file system) and linuxstart.bin
(this seems to be the bootloader).
These are the files you will need:
Throw them in along with this file into a folder and you're good to go:
<html>
<head>
<title>Javascript PC Emulator</title>
<style>
.term {
font-family: courier,fixed,swiss,sans-serif;
font-size: 14px;
color: #f0f0f0;
background: #000000;
}
.termReverse {
color: #000000;
background: #00ff00;
}
#note {
font-size: 12px;
}
#copyright {
font-size: 10px;
}
</style>
</head>
<body onload="start()">
<script src="term.js"></script>
<script src="cpux86.js"></script>
<div id="copyright">© 2011 Fabrice Bellard - <a href="tech.html">Technical notes</a></div>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With