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 / wlswitch
Created March 21, 2015 01:07
A wireless lan switch script for OpenBSD.
#!/bin/sh
#
# Copyright (c) 2015 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
-- console log on LUNA-88K2
OpenBSD/luna88k (aurora.in.nk-home.net) (console)
login: wdc0 at pcmcia0 function 0 "KME, KXLC005, 00" port 0x190/8,0x396/2wdc0: KME_HACK
: INT1 (irq 5)
wdcattach: KME_HACK reg=41, val=0x81
wdc0:0: before reset, st0=0x0, st1=0x0
wdc0:0: wdcwait_reset() end, st0=0x0, er0=0x1, st1=0x30<DWF,DSC>, er1=0x30, reset time=0 msec
wdc0:0: after reset, ret_value=0x3
(C) Copyright Omron Corporation 1989, 1990, 1991, 1992
ROM Version 1.37, 112 Megabytes RAM, 2 CPUs
Memory Check: 3Port passed, main skipped.
Autoboot aborted
ROM Monitor
0>^C
0>d 91000000 9100ffff
91000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
91000fa0: ff ff 00 60 ff ff ff ff ff ff ff ff ff ff ff ff |...`............|
diff --git a/draw.h b/draw.h
index 541688d..914272e 100644
--- a/draw.h
+++ b/draw.h
@@ -25,7 +25,7 @@ static inline void draw_line(struct framebuffer *fb, struct terminal *term, int
struct cell_t *cellp;
for (col = term->cols - 1; col >= 0; col--) {
- margin_right = (term->cols - 1 - col) * CELL_WIDTH;
+ margin_right = (term->cols - 1 - col) * CELL_WIDTH + term->rpad;
#!/usr/local/bin/wish8.5
#
# Tk front-end for sayaka-chan
#
set HOME $env(HOME)
set SAYAKA $HOME/bin/sayaka
proc tweet {} {
global SAYAKA message
0>d 91000000 9100ffff
91000000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
91000180: ff ff ff ff ff ff ff ff 00 ff ff ff 00 ff ff ff |................|
91000190: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
910003e0: 00 82 ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| <<-- PCMCIA controller
910003f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
91000c50: 1f ff 10 ff 07 0f ff ff 01 ff 00 ff 00 ff 0f 0f |................|
@ao-kenji
ao-kenji / patch-Utilities_KWIML_ABI.h.in
Last active March 20, 2016 00:01
OpenBSD: ports/devel/cmake/patches/patch-Utilities_KWIML_ABI.h.in: need to add m88k definition:-<
--- Utilities/KWIML/ABI.h.in.orig Sun Mar 20 08:41:07 2016
+++ Utilities/KWIML/ABI.h.in Sun Mar 20 08:38:35 2016
@@ -386,6 +386,10 @@
#elif defined(__m68k__) || defined(M68000)
# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+/* Motorola 88k */
+#elif defined(__m88k__) || defined(__mc88100__)
+# define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
+
@ao-kenji
ao-kenji / gcc-m88k-defines
Last active March 20, 2016 00:49
OpenBSD/luna88k gcc pre-defines (output of 'gcc -E -dM -xc /dev/null')
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __OpenBSD__ 1
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 0
#define __unix__ 1
#define __SIZE_TYPE__ long unsigned int
#define __ELF__ 1
@ao-kenji
ao-kenji / xp.c.diff
Last active August 19, 2016 11:18
xp test code embedded in OpenBSD/luna88k's bootloader, diff to tsutsui's https://gist.github.com/tsutsui/fbe476093483ceacd79f62a3db8cebf4
--- xp.c.luna68k Thu Aug 18 22:01:49 2016
+++ xp.c Thu Aug 18 21:59:35 2016
@@ -29,7 +29,7 @@
#include "samachdep.h"
#include "status.h"
-#include "xp-psg-data.c"
+#include "xp-data.c"
#define XP_SHM_ADDRESS 0x71000000
@ao-kenji
ao-kenji / boot.diff
Last active August 19, 2016 11:17
xp test code embedded in OpenBSD/luna88k's bootloader, diff to OpenBSD tree.
? sys/arch/luna88k/stand/boot/xp-data.c
? sys/arch/luna88k/stand/boot/xp.c
Index: sys/arch/luna88k/stand/boot/Makefile
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/stand/boot/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- sys/arch/luna88k/stand/boot/Makefile 23 Feb 2014 20:01:04 -0000 1.6
+++ sys/arch/luna88k/stand/boot/Makefile 19 Aug 2016 11:11:30 -0000
@@ -34,6 +34,7 @@