Skip to content

Instantly share code, notes, and snippets.

@tlrobinson
Created May 20, 2011 06:51
Show Gist options
  • Save tlrobinson/982468 to your computer and use it in GitHub Desktop.
Save tlrobinson/982468 to your computer and use it in GitHub Desktop.
jslinux on node.js
tlrobinson@tlr-mac-pro ~/Projects/jslinux (1) $ node linux.js
loaded vmlinux26.bin (1753221 bytes to location 0x100000)
loaded root.bin (3461120 bytes to location 0x400000)
loaded linuxstart.bin (14858 bytes to location 0x10000)
Starting Linux
Linux version 2.6.20 (jdub@fehung) (gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) ) #2 Tue May 17 21:52:21 EST 2011
BIOS-provided physical RAM map:
sanitize start
sanitize bail 0
BIOS-88: 0000000000000000 - 000000000009f000 (usable)
BIOS-88: 0000000000100000 - 0000000002000000 (usable)
32MB LOWMEM available.
Zone PFN ranges:
DMA 0 -> 4096
Normal 4096 -> 8192
early_node_map[1] active PFN ranges
0: 0 -> 8192
DMI not present or invalid.
Allocating PCI resources starting at 10000000 (gap: 02000000:fe000000)
Detected 3.333 MHz processor.
Built 1 zonelists. Total pages: 8128
Kernel command line: console=ttyS0 root=/dev/ram0 rw init=/sbin/init notsc=1
Initializing CPU#0
Disabling TSC...
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 26828k/32768k available (1278k kernel code, 5552k reserved, 303k data, 124k init, 0k highmem)
virtual kernel memory layout:
fixmap : 0xffffc000 - 0xfffff000 ( 12 kB)
vmalloc : 0xc2800000 - 0xffffa000 ( 983 MB)
lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
.init : 0xc028e000 - 0xc02ad000 ( 124 kB)
.data : 0xc023fb1c - 0xc028b830 ( 303 kB)
.text : 0xc0100000 - 0xc023fb1c (1278 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 25.12 BogoMIPS (lpj=125634)
Mount-cache hash table entries: 512
Intel Pentium with F0 0F bug - workaround enabled.
Compat vDSO mapped to ffffe000.
CPU: Intel Pentium MMX stepping 03
Checking 'hlt' instruction... OK.
NET: Registered protocol family 16
Setting up standard PCI resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd
Freeing initrd memory: 3380k freed
Total HugeTLB memory allocated, 0
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Real Time Clock Driver v1.12ac
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450
RAMDISK driver initialized: 16 RAM disks of 12288K size 1024 blocksize
loop: loaded (max 8 devices)
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
Time: pit clocksource has been installed.
RAMDISK: cramfs filesystem found at block 0
RAMDISK: Loading 3380KiB [1 disk] into ram disk... done.
VFS: Mounted root (cramfs filesystem) readonly.
Freeing unused kernel memory: 124k freed
Initializing random number generator... read-only file system detected...done
Welcome to jslinux (with node.js)
jslinux login: root
root
# node
node
Segmentation fault
#
tlrobinson@tlr-mac-pro ~/Projects/jslinux (1) $ node linux.js
loaded vmlinux26.bin (1753222 bytes to location 0x100000)
loaded root.bin (2097152 bytes to location 0x400000)
loaded linuxstart.bin (14858 bytes to location 0x10000)
Starting Linux
Linux version 2.6.20 (bellard@voyager) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)) #1 Wed May 18 23:22:20 CEST 2011
BIOS-provided physical RAM map:
sanitize start
sanitize bail 0
BIOS-88: 0000000000000000 - 000000000009f000 (usable)
BIOS-88: 0000000000100000 - 0000000002000000 (usable)
32MB LOWMEM available.
Zone PFN ranges:
DMA 0 -> 4096
Normal 4096 -> 8192
early_node_map[1] active PFN ranges
0: 0 -> 8192
DMI not present or invalid.
Allocating PCI resources starting at 10000000 (gap: 02000000:fe000000)
Detected 3.333 MHz processor.
Built 1 zonelists. Total pages: 8128
Kernel command line: console=ttyS0 root=/dev/ram0 rw init=/sbin/init notsc=1
Initializing CPU#0
Disabling TSC...
PID hash table entries: 128 (order: 7, 512 bytes)
Console: colour dummy device 80x25
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 28192k/32768k available (1260k kernel code, 4188k reserved, 321k data, 124k init, 0k highmem)
virtual kernel memory layout:
fixmap : 0xffffc000 - 0xfffff000 ( 12 kB)
vmalloc : 0xc2800000 - 0xffffa000 ( 983 MB)
lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
.init : 0xc028e000 - 0xc02ad000 ( 124 kB)
.data : 0xc023b0fa - 0xc028b854 ( 321 kB)
.text : 0xc0100000 - 0xc023b0fa (1260 kB)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 26.76 BogoMIPS (lpj=133826)
Mount-cache hash table entries: 512
Intel Pentium with F0 0F bug - workaround enabled.
Compat vDSO mapped to ffffe000.
CPU: Intel Pentium MMX stepping 03
Checking 'hlt' instruction... OK.
NET: Registered protocol family 16
Setting up standard PCI resources
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 0, 4096 bytes)
TCP bind hash table entries: 512 (order: -1, 2048 bytes)
TCP: Hash tables configured (established 1024 bind 512)
TCP reno registered
checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd
Freeing initrd memory: 2048k freed
Total HugeTLB memory allocated, 0
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Real Time Clock Driver v1.12ac
JS clipboard: I/O at 0x03c0
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16450
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
Time: pit clocksource has been installed.
RAMDISK: ext2 filesystem found at block 0
RAMDISK: Loading 2048KiB [1 disk] into ram disk... done.
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 124k freed
Welcome to JS/Linux
~ # echo "hello world"
echo "hello world"
hello world
~ #
@Marak
Copy link

Marak commented May 20, 2011

holy shit...NODECEPTION

@joshleaves
Copy link

You sir are my hero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment