feat/webworker: work in progress [might break]

This commit is contained in:
Leon van Kammen 2024-10-03 12:41:31 +02:00
parent 64ae2ffd0b
commit d72f7325ec
10 changed files with 1228 additions and 21 deletions

File diff suppressed because it is too large Load Diff

View File

@ -17,13 +17,13 @@ test -f "$1" && {
# and differentiate processes by prefixing output by PID's
# to parse it later with AWK, but it was very hairy
OUTPUT=/mnt/$PID
OUTPUT=/mnt/run/$PID # com/isoterminal/feat/javascript.js writes output here
touch $OUTPUT
echo -n "PID=$PID; $javascript" > /dev/browser/js
sleep 0.1
test -f $OUTPUT && {
cat $OUTPUT
rm $OUTPUT
}
# todo watch file
cat $OUTPUT
rm $OUTPUT
# should we use flock, an awesome way to make processes read/write the same file

View File

@ -30,6 +30,9 @@ help_tips(){
echo ""
echo 'TIPS'
echo '----'
echo 'text editors ' "type '<vi|mg|nano> <textfile>'"
echo 'programming languages ' "type 'ls ~/bin/helloworld*'"
echo 'run 64bit linux app ' "type 'blink <x86_64 binary>'"
echo 'js run ' "type 'js 'alert(\"hello\")'"
echo 'js console.log: ' "type 'console document.baseURI"
echo 'js function as cmd: ' "type 'alias $1=\"jsh $1\"' to run '$1 yo' as $1('yo')"
@ -38,7 +41,6 @@ help_tips(){
echo 'js capture console: ' "type 'tail -f /dev/browser/console'"
echo 'jsh<->sh hooks: ' "type 'chmod +x ~/hook.d/*/* && alert helloworld'"
echo 'include file into page' "type 'require <url.js|css>'"
echo 'create AFRAME a-entity' "type 'a_entity <componentname> [...]"
echo ''
echo 'type "help" or "man xrsh" to read the full manual'
ONBOARDING=1

View File

@ -15,4 +15,3 @@ if( !window['/etc/profile.js'] ){
window['/etc/profile.js'] = true
}

View File

@ -3,6 +3,7 @@
test -d /dev/browser || {
move_root_to_9pfs(){
mkdir /mnt/run # for javascript<->unix pids
test -d /mnt/root && return 0
mv /root /mnt/.
ln -fs /mnt/root /root
@ -15,14 +16,11 @@ test -d /dev/browser || {
}
setup_browser_dev(){
mkdir -p /dev/browser
echo 1 > /mnt/console.tty
ln -s /mnt/console.tty /dev/browser/tty
ln -fs /mnt/js /dev/browser/js
ln -fs /mnt/index.html /dev/browser/html
ln -fs /mnt/console /dev/browser/console
touch /mnt/console
touch /mnt/index.html
mkdir -p /mnt/dev/browser
touch /mnt/dev/browser/js
touch /mnt/dev/browser/html
touch /mnt/dev/browser/console
ln -fs /mnt/dev/browser /dev/browser
}
setup_network(){
@ -40,7 +38,11 @@ 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 'source /etc/profile; logger "isoterminal.exec({})"; {}'
#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(){

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";read;vi';
alias mg='echo "HINT: type Ctrl+c Ctrl-x to quit";read;me';
alias nano='echo "HINT: type Ctrl+x to quit" ;read;nano';
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';
# start index.js
test -f index.js && chmod +x index.js && ./index.js | grep -v undefined

Binary file not shown.

BIN
dist/v86-linux.iso vendored

Binary file not shown.

View File

@ -1,10 +1,15 @@
#!/bin/sh
#!/bin/bash
set -e
make BR2_EXTERNAL=/buildroot-v86 v86_defconfig
mkdir output/legal-info && touch output/legal-info/{host-licenses,licenses,buildroot.config}
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
make linux-menuconfig
make savedefconfig
make linux-savedefconfig