diff --git a/com/isoterminal.js b/com/isoterminal.js index b6bd3f0..8dbf4fa 100644 --- a/com/isoterminal.js +++ b/com/isoterminal.js @@ -107,7 +107,11 @@ AFRAME.registerComponent('isoterminal', { instance.winbox.setTitle( `${w.titleBak} [${msg}]` ) } - var emulator = window.emulator = dom.emulator = new V86({ + let image = {} + if( this.data.iso.match(/\.iso$/) ) image.cdrom = { url: this.data.iso } + if( this.data.iso.match(/\.bin$/) ) image.bzImage.url = this.data.iso + + var emulator = window.emulator = dom.emulator = new V86({ ...image, wasm_path: "com/isoterminal/v86.wasm", memory_size: 32 * 1024 * 1024, vga_memory_size: 2 * 1024 * 1024, @@ -120,13 +124,7 @@ AFRAME.registerComponent('isoterminal', { url: "com/isoterminal/bios/vgabios.bin", }, network_relay_url: "wss://relay.widgetry.org/", - cdrom: { - url: this.data.iso, - }, cmdline: "rw root=host9p rootfstype=9p rootflags=trans=virtio,cache=loose modules=virtio_pci tsc=reliable init_on_free=on", - bzimage:{ - url: "com/isoterminal/images/buildroot-bzimage.bin" - }, //bzimage_initrd_from_filesystem: true, //filesystem: { // baseurl: "com/isoterminal/v86/images/alpine-rootfs-flat", diff --git a/com/isoterminal/mnt/profile b/com/isoterminal/mnt/profile index 0adf165..5169429 100644 --- a/com/isoterminal/mnt/profile +++ b/com/isoterminal/mnt/profile @@ -1,6 +1,9 @@ -# install xrsh env +# source xrsh env source /mnt/profile.xrsh +# source javascript functions +js "$(cat /mnt/profile.js)" + ## forward not-found commands to javascript (via jsh) command_not_found_handle(){ echo "$1 not found, did you mean $1(...) (javascript?)" @@ -9,12 +12,9 @@ command_not_found_handle(){ alert 'js shellfunction:' "type 'alias $1=\"jsh $1\"' to run '$1 yo' as $1('yo')" alert 'js logging: ' "type 'echo 0 > /dev/browser/console.tty' to disable" alert 'js capture log: ' "type 'tail -f /dev/browser/console'" - alert 'jsh<->sh hooks: ' "type 'chmod +x ~/hook.d/alert/* && alert helloworld'" + alert 'jsh<->sh hooks: ' "type 'chmod +x ~/hook.d/*/* && alert helloworld'" } -# source javascript functions -#js "$(cat /mnt/profile.js)" - resize #clear cat /mnt/motd