diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/inittab b/buildroot-v86/board/v86/rootfs_overlay/etc/inittab index 8a3f477..d7a40bc 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/inittab +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/inittab @@ -26,7 +26,7 @@ ::sysinit:/etc/init.d/rcS # Put a getty on the serial port -console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL +#console::respawn:/sbin/getty -L console 0 vt100 # GENERIC_SERIAL #console::respawn:-/bin/sh # vga console # Auto-login as root on ttyS0 diff --git a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh index 8142976..c943fb3 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh +++ b/buildroot-v86/board/v86/rootfs_overlay/etc/profile.xrsh @@ -56,8 +56,9 @@ test -d /dev/browser || { } setup_mounts(){ - mkdir /mnt/helloworld + mkdir /mnt/helloworld /mnt/THREE fusescript /root/fs/helloworld /mnt/helloworld + fusescript /root/fs/THREE.js /mnt/THREE } modprobe fuse # load fuse diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/.profile b/buildroot-v86/board/v86/rootfs_overlay/root/.profile index f1b576a..692f94d 100644 --- a/buildroot-v86/board/v86/rootfs_overlay/root/.profile +++ b/buildroot-v86/board/v86/rootfs_overlay/root/.profile @@ -9,6 +9,11 @@ alias make="mim" # minimalist autoenv version [https://github.com/hyperupcall/autoenv] cd(){ + dir_cur=$(pwd) + ignore=0 + test "${dir_cur:0:4}" = /mnt && ignore=1 + test "${1:0:4}" = /mnt && ignore=1 + test "$ignore" = 1 && { command cd ${1:+"$@"}; return 1; } test -f $(pwd)/.env.leave && source $(pwd)/.env.leave # cleanup environment command cd ${1:+"$@"} && { hook cd "$@" diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/bin/helloworld.js b/buildroot-v86/board/v86/rootfs_overlay/root/bin/helloworld.js index f853370..65825dc 100755 --- a/buildroot-v86/board/v86/rootfs_overlay/root/bin/helloworld.js +++ b/buildroot-v86/board/v86/rootfs_overlay/root/bin/helloworld.js @@ -2,3 +2,6 @@ msg = args.join(' ') console.log(msg) //alert(msg) + +const term = document.querySelector('[isoterminal]').components.isoterminal.term +term.exec("logger bin/helloworld.js "+msg) diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/fs/THREE.js b/buildroot-v86/board/v86/rootfs_overlay/root/fs/THREE.js new file mode 100755 index 0000000..24daf9d --- /dev/null +++ b/buildroot-v86/board/v86/rootfs_overlay/root/fs/THREE.js @@ -0,0 +1,64 @@ +#!/bin/js + +// Function to handle getattr command +function getattr(path,obj) { + let size = 1 + if (path === '/' || path.match(/\/[0-9]+$/) ) { + return "16877 2 1000 1000 4096 8\n" + } else { + return `33188 1 1000 1000 ${size} 1\n` + } + return '' +} + +function getPath(str){ + const scene = document.querySelector('a-scene').object3D + const path = str.split("/") + const name = path.pop() + const parent = path.pop() + let obj = name == "" + ? scene + : scene.getObjectById( parseInt(name.substr(1)) ) + const propvalue = "" + if( obj && obj[ name ] ) propvalue = obj[name] + return {obj,propname:name,propvalue} +} + +// Main function to handle commands +function main(args) { + console.log( 'fs/THREE '+args.join(' ') ) + let children = '' + let props = ['name','uuid','position','rotation'] + + + switch (args[0]) { + case 'readdir':{ + const {obj,propvalue,propname} = getPath( args[1] ) + if( obj && obj.children ){ + children = obj.children.map( (n) => n.name || n.id ) + .join("\n") + } + return `${children}\n${props.join('\n')}\n` + break; + } + + case 'getattr':{ + const {obj,propvalue,propname} = getPath( args[1] ) + return getattr(args[1],{args,obj,propvalue,propname}); + break; + } + + case 'read':{ + const {propvalue,propname} = getPath( args[1] ) + return propvalue; + break; + } + + default: + return '' + } +} + +// Run the main function +return main(args.slice(1)); + diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror b/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror index 9223300..3c80ac4 100755 --- a/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror +++ b/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror @@ -5,4 +5,4 @@ me="$(dirname $(readlink -f $0))" file="$(readlink -f "$1")" $me/codemirror.js "$file" -echo "press ctrl-X to exit editor" +echo "press ctrl-Q to exit editor" diff --git a/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror.js b/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror.js index 9c1e5aa..cc86580 100755 --- a/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror.js +++ b/buildroot-v86/board/v86/rootfs_overlay/root/opt/codemirror/codemirror.js @@ -88,7 +88,7 @@ AFRAME.registerComponent('codemirror', { }) this.editor.setOption("theme", "shadowfox") this.editor.setOption("extraKeys", { - "Ctrl-X": (cm) => { + "Ctrl-Q": (cm) => { this.el.emit('close',true) // window.js will react accordingly } }) diff --git a/dist/v86-linux.iso b/dist/v86-linux.iso index a4b07f5..60fccc3 100644 Binary files a/dist/v86-linux.iso and b/dist/v86-linux.iso differ