I wanted something more minimal for programming a CH32V003 so I had GPT 5.4 port https://github.com/cnlohr/ch32fun/tree/master/minichlink to pure Golang.
It works for flashing the minimal blink program at least and does it in 500ms.
I wanted something more minimal for programming a CH32V003 so I had GPT 5.4 port https://github.com/cnlohr/ch32fun/tree/master/minichlink to pure Golang.
It works for flashing the minimal blink program at least and does it in 500ms.
| FROM rust | |
| RUN apt update && apt install -y python3-pip | |
| RUN pip3 install flask | |
| RUN rustup target add wasm32-unknown-unknown | |
| WORKDIR /srv |
| def init(ctx): | |
| # Mount /proc filesystem. | |
| linux_mount("proc", "proc", "/proc", ensure_path = True) | |
| # Mount other filesystems. | |
| linux_mount("devtmpfs", "devtmpfs", "/dev", ensure_path = True) | |
| linux_mount("sysfs", "none", "/sys", ensure_path = True) | |
| linux_mount("cgroup2", "cgroup2", "/sys/fs/cgroup") | |
| linux_mount("bpf", "/bpf", "/sys/fs/bpf") | |
| linux_mount("debugfs", "debugfs", "/sys/kernel/debug", ignore_error = True) |
| import urllib.parse | |
| import urllib | |
| import requests | |
| import os.path | |
| import zlib | |
| import sqlite3 | |
| from struct import pack | |
| import csv | |
| import hashlib | |
| from subprocess import check_output |
| # structcompile.py | |
| # Joshua Scarsbrook (@jscarsbrook@infosec.exchange) | |
| # Very horrible code. | |
| # License: Apache-2.0 | |
| import argparse | |
| import pycparser # Install with pip install pycparser | |
| ast = pycparser.c_parser.c_ast |
| # iso 9660 | |
| type strA string | |
| type strD string | |
| struct int32_lsb_msb { | |
| lsb i32_le | |
| msb i32_be | |
| } |
| #!/bin/bash | |
| # SS_EEPROM (Chip Select) Pin 2 | |
| # 3.3v - | |
| # MISO (CIPO) Pin 0 | |
| # SCK (SCK) Pin 3 | |
| # GND - | |
| # MOSI (COPI) Pin 1 | |
| set -x |
| """ | |
| A cute little self-contained demo to demonstrate running Mini-Unix on a PDP-11. | |
| """ | |
| vm1 = main.add_vm( | |
| "vm1", | |
| ram = 512, | |
| arch = "host", | |
| accelerate = True, | |
| login_script = """ |
| Copyright 2023 Joshua D. Scarsbrook | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, |
| edge TypeScript/src/compiler/corePublic.ts:3:17 5xcrr910ss4 | |
| node TypeScript/src/compiler/corePublic.ts:3:17 255 255 255 2 | |
| edge TypeScript/src/compiler/corePublic.ts:7:17 5xcrr910ss4 | |
| node TypeScript/src/compiler/corePublic.ts:7:17 255 255 255 2 | |
| edge TypeScript/src/compiler/corePublic.ts:15:9 5xcrr910ss4 | |
| node TypeScript/src/compiler/corePublic.ts:15:9 255 255 255 2 | |
| edge TypeScript/src/compiler/corePublic.ts:29:12 5xcrr910ss4 | |
| node TypeScript/src/compiler/corePublic.ts:29:12 255 255 255 2 | |
| edge TypeScript/src/compiler/corePublic.ts:35:15 5xcrr910ss4 | |
| node TypeScript/src/compiler/corePublic.ts:35:15 255 255 255 2 |