various updates

This commit is contained in:
Leon van Kammen 2024-10-23 18:51:56 +02:00
parent bf70f11e44
commit 8ab3dcf590
14 changed files with 101 additions and 68 deletions

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.33.0
# Wed Oct 2 12:49:15 2024
# Mon Oct 14 15:09:24 2024
#
CONFIG_HAVE_DOT_CONFIG=y
@ -1129,41 +1129,41 @@ CONFIG_ASH_GETOPTS=y
CONFIG_ASH_CMDCMD=y
# CONFIG_CTTYHACK is not set
# CONFIG_HUSH is not set
CONFIG_SHELL_HUSH=y
CONFIG_HUSH_BASH_COMPAT=y
CONFIG_HUSH_BRACE_EXPANSION=y
CONFIG_HUSH_LINENO_VAR=y
# CONFIG_SHELL_HUSH is not set
# CONFIG_HUSH_BASH_COMPAT is not set
# CONFIG_HUSH_BRACE_EXPANSION is not set
# CONFIG_HUSH_LINENO_VAR is not set
# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set
CONFIG_HUSH_INTERACTIVE=y
CONFIG_HUSH_SAVEHISTORY=y
CONFIG_HUSH_JOB=y
CONFIG_HUSH_TICK=y
CONFIG_HUSH_IF=y
CONFIG_HUSH_LOOPS=y
CONFIG_HUSH_CASE=y
CONFIG_HUSH_FUNCTIONS=y
CONFIG_HUSH_LOCAL=y
CONFIG_HUSH_RANDOM_SUPPORT=y
CONFIG_HUSH_MODE_X=y
CONFIG_HUSH_ECHO=y
CONFIG_HUSH_PRINTF=y
CONFIG_HUSH_TEST=y
CONFIG_HUSH_HELP=y
CONFIG_HUSH_EXPORT=y
CONFIG_HUSH_EXPORT_N=y
CONFIG_HUSH_READONLY=y
CONFIG_HUSH_KILL=y
CONFIG_HUSH_WAIT=y
CONFIG_HUSH_COMMAND=y
CONFIG_HUSH_TRAP=y
CONFIG_HUSH_TYPE=y
CONFIG_HUSH_TIMES=y
CONFIG_HUSH_READ=y
CONFIG_HUSH_SET=y
CONFIG_HUSH_UNSET=y
CONFIG_HUSH_ULIMIT=y
CONFIG_HUSH_UMASK=y
CONFIG_HUSH_GETOPTS=y
# CONFIG_HUSH_INTERACTIVE is not set
# CONFIG_HUSH_SAVEHISTORY is not set
# CONFIG_HUSH_JOB is not set
# CONFIG_HUSH_TICK is not set
# CONFIG_HUSH_IF is not set
# CONFIG_HUSH_LOOPS is not set
# CONFIG_HUSH_CASE is not set
# CONFIG_HUSH_FUNCTIONS is not set
# CONFIG_HUSH_LOCAL is not set
# CONFIG_HUSH_RANDOM_SUPPORT is not set
# CONFIG_HUSH_MODE_X is not set
# CONFIG_HUSH_ECHO is not set
# CONFIG_HUSH_PRINTF is not set
# CONFIG_HUSH_TEST is not set
# CONFIG_HUSH_HELP is not set
# CONFIG_HUSH_EXPORT is not set
# CONFIG_HUSH_EXPORT_N is not set
# CONFIG_HUSH_READONLY is not set
# CONFIG_HUSH_KILL is not set
# CONFIG_HUSH_WAIT is not set
# CONFIG_HUSH_COMMAND is not set
# CONFIG_HUSH_TRAP is not set
# CONFIG_HUSH_TYPE is not set
# CONFIG_HUSH_TIMES is not set
# CONFIG_HUSH_READ is not set
# CONFIG_HUSH_SET is not set
# CONFIG_HUSH_UNSET is not set
# CONFIG_HUSH_ULIMIT is not set
# CONFIG_HUSH_UMASK is not set
# CONFIG_HUSH_GETOPTS is not set
# CONFIG_HUSH_MEMLEAK is not set
#
@ -1194,6 +1194,6 @@ CONFIG_FEATURE_REMOTE_LOG=y
# CONFIG_FEATURE_SYSLOGD_CFG is not set
# CONFIG_FEATURE_SYSLOGD_PRECISE_TIMESTAMPS is not set
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
CONFIG_FEATURE_IPC_SYSLOG=y
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
# CONFIG_FEATURE_KMSG_SYSLOG is not set

View File

@ -3,7 +3,7 @@
// do once (remember /etc/profile gets sources multiple times!)
if( !window['/etc/profile.js'] ){
const isoterminal = document.querySelector('[isoterminal]').components.isoterminal.isoterminal
const isoterminal = document.querySelector('[isoterminal]').components.isoterminal.term
const scene = document.querySelector('a-scene')

View File

@ -38,22 +38,14 @@ test -d /dev/browser || {
# listen for shell cmds passed to v86 from browser
# (via isoterminal.exec(...))
stty raw < /dev/ttyS1
#cat /dev/ttyS1 | xargs -I{} /bin/sh -c 'logger "isoterminal.exec({})"; {}'
mkfifo /var/run/ttyS1
echo "source /etc/profile" >> /var/run/ttyS1
cat /dev/ttyS1 > /var/run/ttyS1 &
/bin/sh < /var/run/ttyS1
}
setup_listen_homedir(){
sleep 4 # wait for inode of /mnt/root to become live (due to move_root_to_9pfs)
infinite inotifyd echo /mnt/root | awk '
# listen for writes to rootdir and send them to DOM
/^[we] \/mnt\/root index\.html/ { system("cat "$2"/"$3" | grep -vE \"^#!\" > /dev/browser/html") }
/^[we] \/mnt\/root index\.js/ { system("cat "$2"/"$3" | grep -vE \"^#!\" > /dev/browser/js") }
'
/mnt/root/bin/watchfs &
}
move_root_to_9pfs
@ -62,5 +54,5 @@ test -d /dev/browser || {
setup_network
setup_overlayfs
setup_incoming_cmds &
setup_listen_homedir &
setup_listen_homedir
}

View File

@ -4,9 +4,9 @@ alias exitVR='js "document.querySelector(\"a-scene\").enterVR()"'
alias exitAR='js "document.querySelector(\"a-scene\").enterAR()"'
# (new)user friendlyness
alias vi='echo "HINT: type :q (and press enter) to quit\n[press a key]";read;vi';
alias mg='echo "HINT: type Ctrl+c Ctrl-x to quit\n[press a key]";read;me';
alias nano='echo "HINT: type Ctrl+x to quit\n[press a key]" ;read;nano';
alias vi='echo -e "HINT: type :q (and press enter) to quit\n[press a key]";read;vi';
alias mg='echo -e "HINT: type Ctrl+c Ctrl-x to quit\n[press a key]";read;mg';
alias nano='echo -e "HINT: type Ctrl+x to quit\n[press a key]" ;read;nano';
# start index.js
test -f index.js && chmod +x index.js && ./index.js | grep -v undefined

View File

@ -1,24 +1,25 @@
#!/bin/js
(async function(){
if( args[1] == undefined ) return "usage: codemirror <file>"
await AFRAME.utils.require({
AFRAME.utils.require({
codemirrorjs: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.58.1/codemirror.js",
codemirrorcss: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/codemirror.css",
cmtheme: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/theme/shadowfox.css"
})
.then( () => AFRAME.utils.require({
cmxml: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/xml/xml.js",
cmjavascript: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/javascript/javascript.js",
cmcss: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/css/css.js",
highlight: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/htmlmixed/htmlmixed.js",
codemirrorAF: "com/codemirror.js"
})
await AFRAME.utils.require({
cmxml: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/xml/xml.js",
cmjavascript: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/javascript/javascript.js",
cmcss: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/css/css.js",
highlight: "https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.35.0/mode/htmlmixed/htmlmixed.js",
codemirrorAF: "com/codemirror.js"
})
document.querySelector("a-entity#root").innerHTML += `<a-entity codemirror='file: ${args[1]}'></a-entity>`
})()
)
.then( () => {
let el = document.createElement("a-entity")
el.setAttribute("codemirror", `file: ${args[1]}`)
document.querySelector("a-scene").appendChild(el)
})
return "" // empty stdout(put)

View File

@ -2,7 +2,7 @@
source /etc/profile.sh
javascript='
const isoterminal = document.querySelector("[isoterminal]").components.isoterminal.isoterminal
const isoterminal = document.querySelector("[isoterminal]").components.isoterminal.term
isoterminal.save()
return "[OK] xrsh state saved\n"
'

View File

@ -0,0 +1,9 @@
#!/bin/sh
infinite inotifyd echo /mnt/root | awk '
# listen for writes to rootdir and send them to DOM
/^[ce] \/mnt\/root index\.html/ { system("cat "$2"/"$3" | grep -vE \"^#!\" > /dev/browser/html") }
/^[ce] \/mnt\/root index\.js/ { system("cat "$2"/"$3" | grep -vE \"^#!\" > /dev/browser/js") }
'

View File

@ -0,0 +1,8 @@
#!/bin/sh
# intialize global funcs
/root/index.js &> /dev/null
# initialize scene
/root/index.html &> /dev/null

View File

@ -3,3 +3,11 @@
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0.05 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<!--
<a-box position="0 1.4 -0.5" scale="0.2 0.2 0.2" color="#FF00AA" grabbable></a-box>
-->
<!-- for [lowerlevel] THREE.js code see ~/index.js -->

View File

@ -1,2 +1,17 @@
#!/bin/js
console.log("/root/index.js: hello world")
function doTHREE(){
const scene = AFRAME.scenes[0]
const object = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshBasicMaterial({ color: 0xff0000 })
);
object.position.set(0.3, 1.4, -0.4)
object.scale.set(0.2,0.2,0.2)
scene.add(object);
}
//doTHREE()
// for [higherlevel] AFRAME markup see ~/index.html

View File

@ -69,7 +69,7 @@ The following files are loaded during boot (via `/etc/profile`)
# Calling terminal from javascript
```javascript
const term = document.querySelector('[isoterminal]').components.isoterminal.isoterminal
const term = document.querySelector('[isoterminal]').components.isoterminal.term
term.exec("ls -la")
```

BIN
dist/v86-linux.iso vendored

Binary file not shown.

View File

@ -8,7 +8,7 @@ make menuconfig
test -d output/busybox-1.33.0 || mkdir -p output/busybox-1.33.0
cp /buildroot-v86/.config.busybox output/busybox-1.33.0/.config
make busybox-menuconfig
cp output/busybox-1.33.0/.config /buildroot-v86/.config.busybox
cp output/build/busybox-1.33.0/.config /buildroot-v86/.config.busybox
make linux-menuconfig
make savedefconfig