Skip to content

Commit 849beec

Browse files
authored
fix: x86 not booting locally (#1959)
* fix: x86 not booting locally * use cross instead of the host cargo
1 parent 5cad75e commit 849beec

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

src/emulator/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Puter Emulator
2+
3+
To run locally:
4+
1. Build the image in `image/`:
5+
- `./build-epoxy.sh` or provide a musl+i686 epoxy in `assets/`
6+
- `./build.sh`
7+
2. Build the v86 frontend: `npm run start-webpack`
8+
3. Build and run a local epoxy in `submodules/epoxy-tls/server/` or some other wisp server for the guest networking
9+
4. Run Puter and log in as admin, then open the `puter-linux` app via URL
10+
5. Optionally open the Terminal app if you want to test out the v86 integration

src/emulator/image/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ RUN apk add --update \
1515
passwd -d root && \
1616
chsh -s /bin/bash
1717

18-
RUN apk add neofetch
1918
# programming language tools
2019
RUN apk add --no-cache \
2120
nodejs npm \

src/emulator/image/build-epoxy.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
if ! which cross >/dev/null 2>&1; then
5+
echo "install https://github.com/cross-rs/cross to build epoxy with the simple script"
6+
exit 1
7+
fi
8+
9+
cd ../../../submodules/epoxy-tls/server/ || exit 1
10+
# -lgcc is needed for __ffsdi2
11+
RUSTFLAGS="-Clink-args=-lgcc" cross build --release --target i686-unknown-linux-musl --features twisp
12+
cp ../target/i686-unknown-linux-musl/release/epoxy-server ../../../src/emulator/image/assets/

src/emulator/src/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ const bench_20ms = async (ctx) => {
202202

203203
window.onload = async function()
204204
{
205+
try {
206+
await puter.fs.mkdir(puter.appDataPath)
207+
} catch {}
208+
205209
const modules = {};
206210
modules.bench = (await WebAssembly.instantiateStreaming(
207211
fetch('./static/bench.wasm'))).instance.exports;
@@ -213,7 +217,9 @@ window.onload = async function()
213217
} catch (e) {}
214218

215219
if ( ! emu_config ) {
220+
console.log("writing emu config")
216221
await puter.fs.write('config.json', JSON.stringify({}));
222+
console.log("writing emu config1")
217223
emu_config = {};
218224
}
219225

0 commit comments

Comments
 (0)