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 / omron-ups-by35s-ugen.nbsd.diff
Last active December 26, 2015 14:19
A patch to recognize OMRON UPS BY35S as a ugen(4) device on NetBSD-6.1.2.
Index: dev/usb/usb_quirks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/usb_quirks.c,v
retrieving revision 1.74
diff -u -r1.74 usb_quirks.c
--- dev/usb/usb_quirks.c 11 Feb 2012 05:27:23 -0000 1.74
+++ dev/usb/usb_quirks.c 23 Oct 2013 11:48:57 -0000
@@ -61,6 +61,7 @@
{ USB_VENDOR_MGE, USB_PRODUCT_MGE_UPS2, ANY, { UQ_HID_IGNORE }},
{ USB_VENDOR_MICROCHIP, USB_PRODUCT_MICROCHIP_PICKIT1,
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <dev/wscons/wsconsio.h>
uint gtype;
uint gmode;
uint orig_gmode;
@ao-kenji
ao-kenji / cbus-on-luna88k.md
Last active July 18, 2021 14:20
How to use PC-98 extension bus (C-bus) on OMRON LUNA-88K / OMRON LUNA-88KのPC-98拡張バス(Cバス)についてのメモ

LUNA-88K2のPC-98拡張バス(Cバス)についてのメモ

-- How to use PC-98 extension bus (C-bus) on OMRON LUNA-88K2 --

0.概要

LUNA-88K2にはNEC PC-9801用の拡張ボードを装着することができるPC-98拡張バス(Cバス)が搭載されています。その(OSからの)使い方を説明します。

※重要※

@ao-kenji
ao-kenji / wsdisplay_test.c
Last active February 3, 2022 11:35
A test program to check the usage of 8bpp frame buffer on OpenBSD/luna88k.
/*
* test program for luna88k 4/8bpp frame buffer
*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
@ao-kenji
ao-kenji / obsd-luna88k-wsdisplayio-setgfxmode-x.diff
Created January 11, 2014 14:25
[Merged into original tree] Add LUNA88K quirks in X.Org wscons driver to co-exist colored wscons with monochrome X server, with the help of WSDISPLAYIO_SETGFXMODE ioctl supported kernel.
Index: driver/xf86-video-wsfb//src/wsfb_driver.c
===================================================================
RCS file: /cvs/xenocara/driver/xf86-video-wsfb/src/wsfb_driver.c,v
retrieving revision 1.30
diff -u -r1.30 wsfb_driver.c
--- driver/xf86-video-wsfb//src/wsfb_driver.c 15 Jul 2013 13:23:17 -0000 1.30
+++ driver/xf86-video-wsfb//src/wsfb_driver.c 11 Jan 2014 14:17:54 -0000
@@ -531,6 +531,22 @@
strerror(errno));
return FALSE;
@ao-kenji
ao-kenji / tw-on-obsd-m88k
Last active January 4, 2016 19:29
Ruby gems to use Tw (Twitter client on Ruby; http://shokai.github.io/tw/ ) on OpenBSD/m88k. This is "just work" set.
#!/bin/sh
# pkgsrc reference
gem19 install args_parser -v 0.2.0 # misc/ruby-args_parser
gem19 install parallel -v 0.8.2 # misc/ruby-parallel
gem19 install rainbow -v 1.1.4 # misc/ruby-rainbow
gem19 install hashie -v 1.2.0 # misc/ruby-hashie
gem19 install oauth -v 0.4.7 # security/ruby-oauth
gem19 install yajl-ruby -v 1.1.0 # textproc/ruby-yajl
gem19 install userstream -v 1.3.0 # net/ruby-userstream
@ao-kenji
ao-kenji / obsd-luna88k-mb89352.diff
Created April 5, 2014 08:07
Make closer to hp300 version.
Index: sys/arch/luna88k/dev/mb89352.c
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/dev/mb89352.c,v
retrieving revision 1.17
diff -u -r1.17 mb89352.c
--- sys/arch/luna88k/dev/mb89352.c 30 May 2011 20:01:29 -0000 1.17
+++ sys/arch/luna88k/dev/mb89352.c 5 Apr 2014 08:05:44 -0000
@@ -166,6 +166,7 @@
void spc_msgout (struct spc_softc *);
int spc_dataout_pio (struct spc_softc *, u_char *, int);
diff --git a/makefile b/makefile
index caf405f..4f2b5f9 100644
--- a/makefile
+++ b/makefile
@@ -4,8 +4,8 @@ CC ?= gcc
CFLAGS ?= -std=c99 -pedantic -Wall -Wextra -O3 -s -pipe
LDFLAGS ?=
-XCFLAGS ?= -std=c99 -pedantic -Wall -Wextra -I/usr/include/X11/ -O3 -s -pipe
-XLDFLAGS ?= -lX11
@ao-kenji
ao-kenji / yaft-luna88k-20140809.diff
Created August 9, 2014 21:26
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, take 1. 1bpp version.
diff --git a/conf.h b/conf.h
index 3aade0c..34d7f59 100644
--- a/conf.h
+++ b/conf.h
@@ -2,10 +2,17 @@
/* color: index number of color_palette[] (see color.h) */
enum {
+#if 0
DEFAULT_FG = 7,
@ao-kenji
ao-kenji / yaft-luna88k-8bpp-20140810.diff
Created August 10, 2014 03:56
yaft ( http://uobikiemukot.github.io/yaft/ ) on OpenBSD/luna88k, take 2. 8bpp version.
diff --git a/draw.h b/draw.h
index 9871ba3..9d69618 100644
--- a/draw.h
+++ b/draw.h
@@ -1,6 +1,8 @@
/* See LICENSE for licence details. */
static inline void draw_sixel(struct framebuffer *fb, int line, int col, uint8_t *bitmap)
{
+ /* XXX: Maybe need to re-write on LUNA */
+