Skip to content

Instantly share code, notes, and snippets.

View ao-kenji's full-sized avatar

Kenji Aoyama ao-kenji

View GitHub Profile
@ao-kenji
ao-kenji / obsd-luna88k-aic-cbus.diff
Last active August 17, 2020 12:12
OpenBSD/luna88k Work in progress: NEC PC-9801-100 aic(4) on cbus(4)
Index: sys/arch/luna88k/cbus/aic6360_cbus.c
===================================================================
RCS file: sys/arch/luna88k/cbus/aic6360_cbus.c
diff -N sys/arch/luna88k/cbus/aic6360_cbus.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ sys/arch/luna88k/cbus/aic6360_cbus.c 17 Aug 2020 11:55:33 -0000
@@ -0,0 +1,2102 @@
+/* $OpenBSD: aic6360.c,v 1.37 2020/07/20 14:41:13 krw Exp $ */
+/* $NetBSD: aic6360.c,v 1.52 1996/12/10 21:27:51 thorpej Exp $ */
+
Connected to /dev/ttyU0 (speed 9600)
Hardware Power ON
Master CPU online
Master Version: 0000.0000.1700.11a0
Slave Version: 0000.0000.1700.11a0
CPU E$ (M) 0000.0000.0040.0000 (S) 0000.0000.0040.0000
Button Power ON
Master CPU online
Master Version: 0000.0000.1700.11a0
--- drivers/blazer_usb.c.orig Fri Feb 28 06:17:32 2014
+++ drivers/blazer_usb.c Sun Nov 2 20:09:29 2014
@@ -185,7 +185,7 @@
/* Write data in 8-byte chunks */
ret = usb_control_msg(udev, USB_ENDPOINT_OUT + USB_TYPE_CLASS + USB_RECIP_INTERFACE,
- 0x09, 0x2, 0, &tmp[i], 8, 1000);
+ 0x09, 0x200, 0, &tmp[i], 8, 1000);
if (ret <= 0) {
(C) Copyright Omron Corporation 1989, 1990, 1991, 1992
ROM Version 1.31, 112 Megabytes RAM, 3 CPUs
Memory Check: 3Port passed, main skipped.
Auto-booting...
Booting sd(0,16,0) boot
OpenBSD/luna88k (LUNA-88K2) boot 0.6
Press return to boot now, any other key for boot menu
booting sd(16,0)bsd - starting in 4 seconds.
@ao-kenji
ao-kenji / luna88k-boot.Makefile.diff
Last active April 29, 2020 23:36
For boot test by motorola srec format on ttya
Index: sys/arch/luna88k/stand/boot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/stand/boot/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- sys/arch/luna88k/stand/boot/Makefile 10 Dec 2019 11:28:13 -0000 1.12
+++ sys/arch/luna88k/stand/boot/Makefile 29 Apr 2020 23:33:03 -0000
@@ -60,6 +60,8 @@
${PROG}: ${LDSCRIPT} ${OBJS} ${LIBS}
${LD} ${LINKFORMAT} -x -o ${PROG}.elf ${OBJS} ${LIBS}
@ao-kenji
ao-kenji / LUNA88K2-ROMmonitor-help-boot
Last active April 26, 2020 14:15
LUNA88K2 ROM monitor: h b (help boot)
ROM Monitor
0>h
********** HELP MESSAGE **********
b : loads and executes target program
d : memory dump
c : memory modify
f : fill memory
dr : dump register
cr : modify register
z : set/delete break point
--- /dev/null Tue Oct 13 20:50:15 2020
+++ Makefile.bsd-wrapper Tue Oct 13 20:47:17 2020
@@ -0,0 +1,13 @@
+#
+# nanotodon for OpenBSD: Makefile
+#
+
+PROG = nanotodon
+SRCS = config.c messages.c nanotodon.c
+CFLAGS += -std=gnu99 -I/usr/local/include -DSUPPORT_XDG_BASE_DIR \

How to use nanotodon on OpenBSD

0. What is nanotodon?

Nanotodon is text-based Mastodon client developed by kagura1050(Takaki Yoda).

nanotodon

1. Install required libraries

We can use net/curl and devel/json-c in OpenBSD packages collection.

@ao-kenji
ao-kenji / get-data-from-tr-72w.md
Last active June 9, 2019 02:57
おんどとり TR-72W から計測値を取得する方法

おんどとり TR-72W から計測値を取得する方法

株式会社ティアンドデイ (https://www.tandd.co.jp/) の旧機種 おんどとり TR-72W から、コマンドラインで計測値を取得する方法。 以前スクリプトを書いていたのですが、ディスククラッシュで失ってしまったので、gistバックアップしておきます。

% curl http://${IPADDR}/B/crrntdata/cdata.txt
#1
MachineCode=2
Index: dev/usb/usb_quirks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_quirks.c,v
retrieving revision 1.86
diff -u -r1.86 usb_quirks.c
--- dev/usb/usb_quirks.c 4 Dec 2016 10:12:35 -0000 1.86
+++ dev/usb/usb_quirks.c 15 Dec 2018 00:36:52 -0000
@@ -69,6 +69,8 @@
{ USB_VENDOR_WELTREND, USB_PRODUCT_WELTREND_HID, ANY, { UQ_HID_IGNORE }},
{ USB_VENDOR_SILABS, USB_PRODUCT_SILABS_EC3, ANY, { UQ_HID_IGNORE }},