This JavaScript PC Emulator that runs Linux is fantastic. Just stop to consider a VM running in an interpreted
environment.
It does not have a FPU (Float Point Unit, aka math co-processor) but Linux kernels emulate FPU’s if none are available.
Tell us what neat tricks you come up with in JS Linux!
#Create a mounted loopback file system as ~/loopback.img, mounted to /mnt.
#Then copied hello.c to our mount point, unmounted it, and gzipped the image =D
# dd if=/dev/zero of=loopback.img bs=1000 count=400
400+0 records in
400+0 records out
400000 bytes (390.6KB) copied, 0.129992 seconds, 2.9MB/s
# mkfs.ext2 -F loopback.img
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
48 inodes, 390 blocks
19 blocks (5%) reserved for the super user
First data block=1
Maximum filesystem blocks=262144
1 block groups
8192 blocks per group, 8192 fragments per group
48 inodes per group
# mount -o loop loopback.img /mnt
# cp hello.c /mnt && ls -al /mnt
drwxr-xr-x 3 root root 1024 May 17 14:21 .
drwxr-xr-x 13 root root 1024 May 16 16:33 ..
-rw-r--r-- 1 root root 166 May 17 14:21 hello.c
drwxr-xr-x 2 root root 12288 May 17 14:19 lost+found
# umount /mnt
# gzip loopback.img
# ls -lh
-rwxr-xr-x 1 root root 1.9K May 17 14:14 a.out
-rw-r--r-- 1 root root 166 May 15 22:15 hello.c
-rw-r--r-- 1 root root 905 May 17 14:23 loopback.img.gz

May 18th, 2011
Wez
Posted in
Tags: 
