improved hashboot
Some checks failed
/ mirror_to_github (push) Failing after 2m3s
/ test (push) Successful in 9s

This commit is contained in:
Leon van Kammen 2025-02-21 16:00:38 +01:00
parent abe4fc33b1
commit 20e0854c5a
10 changed files with 86 additions and 34 deletions

View file

@ -20,7 +20,7 @@
obb-collider="showColliders:false"
raycaster="objects: [html]; interval:100;">
<a-entity isoterminal="iso: ./../xrsh.iso; overlayfs: /package.overlayfs.zip" position="0 1.6 -0.3"></a-entity>
<a-entity isoterminal="iso: ./../xrsh.iso; overlayfs: /package.overlayfs.zip; bootMenuURL: 1" position="0 1.6 -0.3"></a-entity>
<a-entity id="player" >
<a-entity camera="fov:90" position="0 1.6 0" id="camera" wasd-controls com="uri: com/control/gaze-touch-to-click.js"></a-entity>

@ -1 +1 @@
Subproject commit 04275e3f2fb9a4c7bc232e81be016c8ff44e0292
Subproject commit 2a4218120d133cf4481df9490839e6d82466c322

BIN
xrsh.com

Binary file not shown.

View file

@ -1 +1 @@
199e5555c3bedcc37b53491a1228868b3d2046578913a259b3f140ce0347d1a2 xrsh.com
0b3fa80255fdfeffba185e6e48fc93916812ff04e3024c05e5a3140693a738ac xrsh.com

36
xrsh.html Normal file
View file

@ -0,0 +1,36 @@
<script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
<script src="https://xrsh.isvery.ninja/xrsh.js"></script>
<a-scene>
<a-entity isoterminal position="0 1.6 -0.3"></a-entity>
<a-entity id="left-hand" hand-tracking-grab-controls="hand: left; modelColor: #EEEEEE; hoverEnabled:true"
laser-controls="hand: left" raycaster="objects:.ray,[html]"></a-entity>
<a-entity id="right-hand" hand-tracking-grab-controls="hand: right; modelColor: #EEEEEE; hoverEnabled:true"
laser-controls="hand: right"
raycaster="objects:.ray,[html]"></a-entity>
</a-scene>
<script>
document.querySelector('a-scene').addEventListener('isoterminal_init', function(e){
// override/extend bootmenu-array with your own REPL(s)
// see com/isoterminal/feat/boot.REPL.*.js for examples
ISOTerminal.prototype.boot.menu.push({
key: "f",
title: (opts) => `other awesome NLnet FOSS projects ❤️`,
init: function( mainmenu ){
window.open('https://nlnet.nl/project/current.html','_blank')
// return to main menu
mainmenu()
},
keyHandler: function(ch){
this.send("\n\ryou typed:"+ch) // write to term
}
})
// AFRAME exposes THREE by default
console.log( THREE )
})
</script>

View file

@ -1 +1 @@
src/xrsh-buildroot/xrsh.iso
xrsh.iso.buildroot

1
xrsh.iso.buildroot Symbolic link
View file

@ -0,0 +1 @@
../xrsh-buildroot/dist/v86-linux.iso

1
xrsh.iso.repository Symbolic link
View file

@ -0,0 +1 @@
src/xrsh-buildroot/xrsh.iso

1
xrsh.iso.wtux Symbolic link
View file

@ -0,0 +1 @@
../wtux/output/wtux.iso

73
xrsh.js
View file

@ -249,25 +249,26 @@ e.removeClass=function(a){this.g.classList.remove(a);return this};e.toggleClass=
*
* > depends on [AFRAME.utils.require](com/require.js)
*
* | property | type | default | info |
* |------------------|-----------|------------------------|------|
* | `iso` | `string` | https`//forgejo.isvery.ninja/assets/xrsh-buildroot/main/xrsh.iso" | |
* | `overlayfs` | `string` | '' | zip URL/file to autoextract on top of filesystem |
* | `width` | `number` | 800 ||
* | `height` | `number` | 600 ||
* | `depth` | `number` | 0.03 ||
* | `lineHeight` | `number` | 18 ||
* | `bootmenu` | `boolean` | true | give user choice [or boot straight into ISO ] |
* | `padding` | `number`` | 18 | |
* | `maximized` | `boolean` | false | |
* | `minimized` | `boolean` | false | |
* | `muteUntilPrompt`| `boolean` | true | mute stdout until a prompt is detected in ISO |
* | `HUD` | `boolean` | false | link to camera movement |
* | `transparent` | `boolean` | false | heavy, needs good gpu |
* | `memory` | `number` | 60 | VM memory (in MB) [NOTE` quest or smartphone webworker might crash > 40mb ] |
* | `bufferLatency` | `number` | 1 | in ms` bufferlatency from webworker to term (batch-update every char to texture) |
* | `debug` | `boolean` | false | |
* | `emulator` | `string` | fbterm | terminal emulator |
* | property | type | default | info |
* |-------------------|-----------|------------------------|------|
* | `iso` | `string` | https`//forgejo.isvery.ninja/assets/xrsh-buildroot/main/xrsh.iso" | |
* | `overlayfs` | `string` | '' | zip URL/file to autoextract on top of filesystem |
* | `width` | `number` | 800 ||
* | `height` | `number` | 600 ||
* | `depth` | `number` | 0.03 ||
* | `lineHeight` | `number` | 18 ||
* | `bootMenu` | `string` | "" | character to auto-enter in bootMenu |
* | `bootMenuURL` | `string` | "" | character to auto-enter in bootmeun when URL has fragment (#foo.zip e.g.) |
* | `padding` | `number`` | 18 | |
* | `maximized` | `boolean` | false | |
* | `minimized` | `boolean` | false | |
* | `muteUntilPrompt` | `boolean` | true | mute stdout until a prompt is detected in ISO |
* | `HUD` | `boolean` | false | link to camera movement |
* | `transparent` | `boolean` | false | heavy, needs good gpu |
* | `memory` | `number` | 60 | VM memory (in MB) [NOTE` quest or smartphone webworker might crash > 40mb ] |
* | `bufferLatency` | `number` | 1 | in ms` bufferlatency from webworker to term (batch-update every char to texture) |
* | `debug` | `boolean` | false | |
* | `emulator` | `string` | fbterm | terminal emulator |
*
* > for more info see [xrsh.isvery.ninja](https://xrsh.isvery.ninja)
*
@ -313,7 +314,9 @@ if( typeof AFRAME != 'undefined '){
height: { type: 'number',"default": 600 },
depth: { type: 'number',"default": 0.03 },
lineHeight: { type: 'number',"default": 18 },
bootmenu: { type: 'string', "default": 'show' }, // show bootmenu or autosend key to bootmenu (key '1' e.g.)
bootOnFragment: { type: 'string',"default": "nothing" },
bootMenu: { type: 'string', "default": '' }, // show bootMenu if empty, or autosend key to bootMenu (key '1' e.g.)
bootMenuURL: { type: 'string', "default": '' }, // show bootMenu if empty, or autosend key to bootMenu (key '1' e.g.)
padding: { type: 'number',"default": 18 },
maximized: { type: 'boolean',"default":false},
minimized: { type: 'boolean',"default":false},
@ -1685,9 +1688,7 @@ ISOTerminal.prototype.startVM = function(opts){
this.emit('status',msglib.loadmsg)
this.emit('serial-output-string', msg)
if( this.opts.bootmenu == 'show'){
this.emit('bootmenu',{})
}
this.emit('bootMenu',{bootMenu: this.opts.bootMenu, bootMenuURL: this.opts.bootMenuURL })
}
ISOTerminal.prototype.bootISO = function(){
@ -3219,15 +3220,27 @@ ISOTerminal.addEventListener('ready', function(e){
ISOTerminal.prototype.bootMenu = function(e){
this.boot.menu.selected = false // reset
let msg = '\n\r'
this.boot.menu.map( (m) => {
msg += `\r${m.key}) ${m.title(this.opts)}\n`
})
msg += `\n\renter choice> `
this.send(msg)
const autobootURL = e.detail.bootMenuURL && document.location.hash.length > 1
const autoboot = e.detail.bootMenu || autobootURL
if( !autoboot ){
alert("ja")
let msg = '\n\r'
this.boot.menu.map( (m) => {
msg += `\r${m.key}) ${m.title(this.opts)}\n`
})
msg += `\n\renter choice> `
this.send(msg)
}else{ // autoboot
if( this.term ){
this.term.handler( e.detail.bootMenu || e.detail.bootMenuURL )
this.term.handler("\n")
}
}
}
ISOTerminal.addEventListener('bootmenu', function(e){ this.bootMenu() })
ISOTerminal.addEventListener('bootMenu', function(e){ this.bootMenu(e) } )
ISOTerminal.prototype.boot = async function(e){
// set environment