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 / dmesg-luna88k2-up
Last active December 21, 2015 03:09
OpenBSD/luna88k dmesg, uni-processor kernel, on LUNA-88K2.
[ no symbol table formats found ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
Copyright (c) 1995-2013 OpenBSD. All rights reserved. http://www.OpenBSD.org
OpenBSD 5.4-current (GENERIC) #114: Thu Aug 15 19:53:54 JST 2013
aoyama@aurora.in.nk-home.net:/usr/src/sys/arch/luna88k/compile/GENERIC
real mem = 117440512 (112MB)
avail mem = 111919104 (106MB)
mainbus0 at root: OMRON LUNA-88K2, 33MHz
@ao-kenji
ao-kenji / x11perf-luna88k2-mono.log
Created September 14, 2013 08:24
x11perf log of OpenBSD/luna88k monochrome Xorg server, running on LUNA-88K2 GENERIC (non-multiprocessor) kernel.
x11perf - X11 performance program, version 1.2
The X.Org Foundation server version 11401000 on :0
from aurora.in.nk-home.net
Fri Sep 13 22:47:58 2013
Sync time adjustment is 5.8911 msecs.
600000 reps @ 0.0091 msec (110000.0/sec): Dot
600000 reps @ 0.0090 msec (111000.0/sec): Dot
600000 reps @ 0.0090 msec (111000.0/sec): Dot
@ao-kenji
ao-kenji / lcdcls.c
Created September 27, 2013 14:41
lcdcls.c - clear the LCD character display on OpenBSD/luna88k
/*
* Copyright (c) 2013 Kenji Aoyama
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
@ao-kenji
ao-kenji / openbsd-nut-omron-ups
Last active December 25, 2015 12:29
A trial of OpenBSD/amd64 with OMRON UPS BY35S, using nut (Network UPS Tools; http://www.networkupstools.org/).
% sudo /usr/local/bin/blazer_usb -DDDDD -a by35s
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5)
0.000000 send_to_all: SETINFO driver.parameter.port "auto"
0.000084 send_to_all: SETINFO driver.parameter.vendorid "0590"
0.000096 send_to_all: SETINFO driver.parameter.productid "0080"
0.000108 send_to_all: SETINFO driver.parameter.subdriver "ippon"
0.000148 debug level is '5'
0.000740 No appropriate HID device found
0.000763 No supported devices found. Please check your device availability with 'lsusb'
and make sure you have an up-to-date version of NUT. If this does not help,
% sudo /usr/local/bin/blazer_usb -DDDD -a by35s
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5)
0.000000 debug level is '4'
0.171836 Checking device (10DE/0000) (000/001)
0.172024 - VendorID: 10de
0.172032 - ProductID: 0000
0.172038 - Manufacturer: NVIDIA
0.172044 - Product: EHCI root hub
0.172049 - Serial Number: unknown
0.172055 - Bus: 000
#### Linux ####
loris% sudo ./omupschat
bus 0, device 0, VendorID:0x0590, ProductID:0x0080, at (002/004)
** Target device found
bus 0, device 1, VendorID:0x0e0f, ProductID:0x0002, at (002/003)
bus 0, device 2, VendorID:0x0e0f, ProductID:0x0003, at (002/002)
bus 0, device 3, VendorID:0x1d6b, ProductID:0x0001, at (002/001)
bus 1, device 4, VendorID:0x1d6b, ProductID:0x0002, at (001/001)
Q1
@ao-kenji
ao-kenji / nut-2.6.5-obsd-omron-ups.patch
Last active December 26, 2015 01:19
A quick hack to Network UPS Tools(NUT) "blazer_usb" driver to use OMRON UPS on NetBSD/OpenBSD.
--- nut-2.6.5/drivers/blazer_usb.c.orig Wed Aug 1 02:38:59 2012
+++ nut-2.6.5/drivers/blazer_usb.c Mon Oct 21 00:04:22 2013
@@ -173,8 +173,8 @@
static int ippon_command(const char *cmd, char *buf, size_t buflen)
{
- char tmp[64];
- int ret;
+ char tmp[64], tmp2[64];
+ int ret, len1;
trantor% sudo ./blazer_usb -DDDD -a by35s
Password:
Network UPS Tools - Megatec/Q1 protocol USB driver 0.09 (2.6.5)
0.000000 debug level is '4'
0.147968 Checking device (10DE/0000) (000/001)
0.148313 - VendorID: 10de
0.148321 - ProductID: 0000
0.148327 - Manufacturer: NVIDIA
0.148333 - Product: EHCI root hub
0.148339 - Serial Number: unknown
@ao-kenji
ao-kenji / omron-ups-on-bsd.md
Last active May 23, 2020 23:59
How to use OMRON UPS on OpenBSD/NetBSD - USB接続のオムロン製UPSをOpenBSD/NetBSDで使うためのメモ。

オムロン製UPSをOpenBSD/NetBSDで使うためのメモ

-- How to use OMRON UPS on OpenBSD/NetBSD --

0.概要

OpenBSDマシンに、USB接続のオムロン製UPSを接続して、自動シャットダウンできるように設定する方法のメモです。 NetBSDでもUPSと通信できることは確認しましたので、同様に設定できると思います。

1. 検証に使用した機材

@ao-kenji
ao-kenji / omron-ups-by35s-ugen.obsd.diff
Created October 26, 2013 02:23
[Merged into original tree] A patch to recognize OMRON UPS BY35S as a ugen(4) device on OpenBSD-5.3.
Index: sys/dev/usb/usb_quirks.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/usb_quirks.c,v
retrieving revision 1.66
diff -u -r1.66 usb_quirks.c
--- sys/dev/usb/usb_quirks.c 31 Jan 2012 21:13:32 -0000 1.66
+++ sys/dev/usb/usb_quirks.c 26 Oct 2013 00:24:10 -0000
@@ -156,6 +156,7 @@
{ USB_VENDOR_MUSTEK2, USB_PRODUCT_MUSTEK2_PM800, ANY, { UQ_BAD_HID }},
{ USB_VENDOR_OMRON, USB_PRODUCT_OMRON_BX35F, ANY, { UQ_BAD_HID }},