WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Micro Core ported to Javascript  (Read 7139 times)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Micro Core ported to Javascript
« on: May 24, 2011, 07:31:57 PM »
Using the Javascript PC Emulator, I was able to run Micro Core 3.6 in Firefox 4. I was surprised at how simple it was. A few notes:
  • Set memory in jslinux.js to 32MB
  • Add "noswap nozswap embed nodhcp nofstab ramdisk_size=16384" command line options in jslinux.js
  • Use the config_linux-2.6.20 provided in the linuxstart.tar.gz and modify it with:
    CONFIG_SQUASHFS=y
    CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
    CONFIG_LOCALVERSION="-tinycore"
  • Patch kernel using patch_linux-2.6.20
  • Add to /etc/inittab (comment out tty1 line):
    ::respawn:/sbin/getty -L ttyS0 115200 vt100
  • Add to /opt/bootlocal.sh:
    stty -F /dev/ttyS0 rows 30
    chown root:staff /dev/clipboard
  • Merge root.bin and microcore.gz into a 12MB ext2 image

Screenshots (must be logged in to view):
screen1.png: booting to a command prompt
screen2.png: top
screen3.png: TERM=xterm-color vifm
screen4.png: lynx accessing copy of Tiny Core home page served via lighttpd-nodeps

[ Edit ] Added fourth screen shot and clarified notes
« Last Edit: May 27, 2011, 11:22:47 AM by danielibarnes »

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Micro Core ported to Javascript
« Reply #1 on: May 24, 2011, 08:03:27 PM »
I'm still laughing :D

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Micro Core ported to Javascript
« Reply #2 on: May 24, 2011, 11:04:57 PM »
I'm still laughing :D

If it had a virtual network adapter, I could run a web server within my browser ... :)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Micro Core ported to Javascript
« Reply #3 on: May 24, 2011, 11:07:10 PM »
I'm still laughing :D

If it had a virtual network adapter, I could run a web server within my browser ... :)

I've never much cared about, but isn't "Opera Unite" a ready made webserver in a browser?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Micro Core ported to Javascript
« Reply #4 on: May 24, 2011, 11:27:11 PM »
I've never much cared about, but isn't "Opera Unite" a ready made webserver in a browser?

To quote, "Opera Unite is not designed to replace professional Web servers ..." I was able to run lynx, and I considered installing busybox-httpd or my lighttpd-nodeps extension. I couldn't think of anything cool to do with it aside from having a web server serve web pages to a web browser within a web browser.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: Micro Core ported to Javascript
« Reply #5 on: May 25, 2011, 05:57:57 AM »
If it had a virtual network adapter, I could run a web server within my browser ... :)

Then we've been laughing about exactly the same thing :D

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Micro Core ported to Javascript
« Reply #6 on: May 25, 2011, 10:27:31 AM »
I still can't see why do that (the emulator). Hey all, let's run a heavy-as-is emulator on top of an interpreted language, on top of an already-heavy app, lol. :D
The only barriers that can stop you are the ones you create yourself.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: Micro Core ported to Javascript
« Reply #7 on: May 25, 2011, 10:40:28 AM »
Quote
I still can't see why do that

Read the page I linked in my original post, at the very bottom:

Quote
What's the use ?

I did it for fun, just because newer Javascript Engines are fast enough to do complicated things. Real use could be:
Benchmarking of Javascript engines (how much time takes your Javascript engine to boot Linux ?). For this particular application, efficient handling of 32 bit signed and unsigned integers and of typed arrays is important.
  • Learning to use command line Unix tools without leaving the browser.
  • Client side processing using an x86 library, for example for cryptographic purposes. For such application, the x86 emulator can be modified to provide an API to load x86 dynamic libraries and to provide a js-ctypes like API to call the C/C++ functions from javascript.
  • A more advanced version would allow to use old DOS PC software such as games.

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Micro Core ported to Javascript
« Reply #8 on: May 25, 2011, 04:29:23 PM »
I still can't see why do that (the emulator). Hey all, let's run a heavy-as-is emulator on top of an interpreted language, on top of an already-heavy app, lol. :D

Proof of concept of maximizing overhead?  ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11696
Re: Micro Core ported to Javascript
« Reply #9 on: May 25, 2011, 06:59:39 PM »
Sometimes we try things just to see if they can be done or as a learning experience, regardless of
how useful they may or may not be. I once made a bootable floppy with a 2.6.28 kernel, uclibc and
busybox. I used a 1.4Mb floppy formated to 1.722Mb and had 180Kb to spare. Did it serve a useful
purpose? Not really, but I got the satisfaction of knowing I could do it and learned a lot along the way.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: Micro Core ported to Javascript
« Reply #10 on: May 26, 2011, 01:49:36 AM »
I'm just as guilty in doing things like that too ;) Guess the part I don't get is making it a public project, my crazies tend to stay inside.
The only barriers that can stop you are the ones you create yourself.

Offline Guy

  • Hero Member
  • *****
  • Posts: 1089
Re: Micro Core ported to Javascript
« Reply #11 on: May 26, 2011, 01:54:27 AM »
You learn a lot by experimenting.

I have tried a lot of things which worked, and a lot of things which did not work.

I have learnt during the process.
Many people see what is. Some people see what can be, and make a difference.

Offline vinnie

  • Hero Member
  • *****
  • Posts: 1187
  • HandMace informatic works
Re: Micro Core ported to Javascript
« Reply #12 on: May 26, 2011, 07:24:10 AM »
I suggested to my friend who was skeptical, now that I'll show him this page he'll be knocked  ;D