Building the worst Linux PC ever: 6 hours to boot Ubuntu
hackaday.com
hackaday.com
shameless plug below:
Last year, inspired by Bellard's jslinux, I too wrote an emulator that can run Linux on the browser. Only I was lazy and emulated the vastly easier LatticeMico32 processor.
Anyways, the result was very intellectually satisfying.
After writing the interpreter, I went ahead and wrote a version that generates Javascript code on the fly (and captures up to 3 backwards jumps to the same block), for massive speed ups.
Anyways, it doesn't serve any purposes, but boy was it fun...
The code is at: https://github.com/ubercomp/jslm32/
And there's a demo running on: http://www.ubercomp.com/jslm32/src/
BEWARE: It only works well on Chrome (takes download time + 10s to boot on my machine).
If anyone is interested in this stuff, just ask and I'll write a post describing what I did to take boot time from 2.5 minutes to 10 seconds.
Yes please. Optimisation war stories are always interesting.
The LatticeMico32 toolchain (gcc, gdb, ar, ld) is very bad, seriously... I'm thinking of doing a MIPS or ARM emulator, just because the toolchains are so much better to work with.
Anyways, I do have a framebuffer demo that runs at a very decent frame rate on my machine (at this moment it is Chrome only and I unfortunately don't have the binaries for the demo on github). But this is not on Linux, it's on a barebones newlib environment (no Operating System).
Writing a mouse interface is trivial, the only reason I haven't done it yet is I'm thinking if it is worth to continue investing on the LatticeMico32 architecture, as the toolchain makes me want to pull my hair out.
Besides running Linux, the emulated system also runs RTEMS (actually it runs anything as long as you can get the toolchain to produce working binaries), and it might be easier to get an RTEMS system running with a simple graphical environment, but then there wouldn't be man y libraries do choose from.
So that's the status. I believe we are on the verge of having a viable option for making "GUI" programs on a canvas screen. If I were to work full time on it, I could pull a prototype off in about a month or two (literally), maybe a little less as this thing is so addictive I would easily work 16h days on it if I could.
IMHO, the ideal thing would be having an easy to use environment with a mature toolkit on it (I was thinking Qt) and let the user choose the language of choice to develop in. Possible choices would be C, Python, Ruby and Lua, which are fairly easy to have on the web.
Technically, it can be done, I just don't know if there would be enough interest, and how to have a sustainable business model around this idea. What do you think?
The biggest market I see for something like this is games or displaying some sort of video. It seems like it is getting harder and harder to find something that Java/Flash can do that HTML5/Javascript can't but they still have their uses. For Flash it's RTMPS for encrypted video. For Java it's ease of development.
I'm so intrigued because it seems it seems like an awesome way to do some browser fuzzing :D
As I don't want to kidnap this thread, which is about an awesome feat of hackery by dmitrygr, I submitted one about jslm32: http://news.ycombinator.com/item?id=3769498
I'll check the jslm32-specific thread sporadically to answer any questions.
It boots and I can login using Firefox Nightly.
What struck me is that he wrote a controller for an 8 bit FPM DRAM bus instead of just using a big SRAM. That's surprising, and not at all trivial to do over a bunch of GPIO pins.
SRAM would be easier because it's set and forget. It needs a more complex internal circuit, and therefore more expensive.
The 30 pin SIMM is 16MB and easy to wire (0.1" pitch). 16 MB of SRAM is probably going to be TSOP or worse, and probably in multiple packages. The multiplexed DRAM bus would also help with the pin count, but it's not clear to me that was a concern.
And sure, I can see how it's done and announce it's "easy". But I'd be hesitant to try it. So if you've actually done it, bravo.
(edit: Among other things, how did you handle the case of your refresh ISR firing in the middle of a read cycle? Certainly can be done correctly, but it's a non-trivial (albeit software-side) problem to solve.)
The point being: it's non-trivial.
[also, why do I keep being told I am submitting too fast, please slow down. I just posted 2 comments here, that is all. Had to make a new username :(]
I think there is extra throttling on brand-new accounts, to help keep spam under control. Once your account is a little older it will be less restricted.
Also: welcome, and thanks for joining the discussion!
I'm very impressed with his project!
"The raw video is in a few segments, since I had to change camera batteries a few times while filming."
[1]: http://dmitry.co/index.php?p=./04.Thoughts/07.%20Linux%20on%...
Maybe some sort of Hardware Description Language to Minecraft compiler would be useful.
With an optimizing compiler to take advantage of these, it might not be unrealistic to implement Minecraft in Minecraft. The real-time speed would only be limited by the real hardware, not by the Minecraft hardware.
"Hackers Successfully Install Linux on a Potato" http://www.bbspot.com/news/2008/12/linux-on-a-potato.html
And this was 15 years before Inception... ;)
Anybody have a SPARC 1 emulator?
4 Megs RAM and a b/w console.
Perhaps the author meant to write "Ubuntu", rather than "Linux"?
"Under-powered" is a moving target. It seems to apply best to computers that don't quite meet the specs of the current Windows, or perform very poorly with it. Anything without a prayer of running WinXP is much worse than under-powered, and modern Linux is a poor choice. An old linux2.4 distro would be a good option, or my personal favorite for truly pathetic hardware, OpenBSD.
[Dmitry] threw an antique 30-pin RAM SIMM at the problem. It’s wired up directly to the microcontroller...
Whoa. You can do that? I mean, it makes complete sense, but it never occurred to me... suddenly I might have a use for all those old free RAM sticks.
I bet nobody then imagined anyone would emulate un*x on a chip being emulated at such slow speeds.
I wonder if there's a niche for the equivalent of the Model 100 in today's world?
http://www.trs-80.com/wordpress/trs-80-computer-line/model-1...
A fully mobile general purpose computer with instant boot, impressive battery life, running off 4 AA's.
The Wikireader comes close as the modern equivalent. The input method would have to be something like Siri, with an optional keyboard. With a form factor and batteries from an iPad 3, but with a slower processor and a fast refresh eInk screen, you could have truly phenomenal battery life.
What's your day job?
Only to make it even funnier by the glazed look in my girlfriends eyes when I was trying to explain whats so funny about guy bootstrapping a 32bit OS on a 8bit micro controller.
I mean the idea of emulating 32bit OS on a 8bit machine is not something too ridiculous on its own. But the setup he used. Oh my god. Must stop trying to comprehend this madness.
Kudos to Dmitry.