いまさらな感じもしますが(^^;、Mobile Gear II(MC/R450)に NetBSD/hpcmipsをインストールして、システム手帳代わりに利用しております。 あくまでも備忘録ですが、御役に立てればと思います。
| 2004/02/27 | NEC Mobile Gear II MC/R450 | 25,000円 |
| 2004/03/02 | コンパクトフラッシュ(ハギワラシスコム)HPC-CF1GV(1GB) | 21,480円 |
| 2004/09/24 | コンパクトフラッシュ(トランセンド)TS2GCF45(2GB)(現在) | 20,500円 |
| 2004/03/06 | 増設RAM(16MB) MC/MB4 | 11,500円 |
| 2004/03/10 | コレガ PCMCIA Ether II PCC-T | 200円 |
| 2006/03/10 | MobileGearII for DoCoMo | 8,250円 |
| 2006/04/15 | NEC Mobile Gear II MC/R300 | 12,700円 |
mcr450# fdisk /dev/wd0
Disk: /dev/wd0d
NetBSD disklabel disk geometry:
cylinders: 1985 heads: 16 sectors/track: 63 (1008 sectors/cylinder)
BIOS disk geometry:
cylinders: 1985 heads: 16 sectors/track: 63 (1008 sectors/cylinder)
Partition table:
0: sysid 11 (Primary DOS with 32 bit FAT)
start 63, size 6993 (3 MB), flag 0x80
beg: cylinder 0, head 1, sector 1
end: cylinder 6, head 15, sector 63
1: sysid 169 (NetBSD)
start 7056, size 1993824 (973 MB), flag 0x0
beg: cylinder 7, head 0, sector 1
end: cylinder 960, head 15, sector 63
2: <UNUSED>
3: <UNUSED>
mcr450# disklabel /dev/wd0 # /dev//wd0d: type: unknown disk: mydisk label: flags: bytes/sector: 512 sectors/track: 63 tracks/cylinder: 16 sectors/cylinder: 1008 cylinders: 1985 total sectors: 2000880 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize cpg/sgs] a: 1729728 7056 4.2BSD 1024 8192 86 # (Cyl. 7 - 1722) b: 264096 1736784 swap # (Cyl. 1723 - 1984) c: 1993824 7056 unused 0 0 # (Cyl. 7 - 1984) d: 2000880 0 unused 0 0 # (Cyl. 0 - 1984)
$ dmesg hpcapm: battery life 50% hpcapm: suspend req hpcapm: set power state SUSPEND...
$ cat >localetest.c <<_EOF_
#include <stdio.h>
#include <locale.h>
main()
{
if (setlocale(LC_ALL, "") == NULL){
fprintf(stderr, "== setlocale error ==\n");
exit(1);
}
printf("setlocale LC_ALL = (%-s)\n", setlocale(LC_ALL, NULL));
}
_EOF_
$ cc -o localetest localetest.c
$ LC_ALL=ja_JP.eucJP ./localetest
setlocale LC_ALL = (C/C/C/C/C/ja_JP.eucJP)
$ LC_ALL=C ./localetest
setlocale LC_ALL = (C)
...というように、LC_ALL=ja_JP.eucJP時のsetlocaleの戻り値が「C/C/C/C/C/ja_JP.eucJP」と
いうふうになってます。ちなみに、Linux(glibc-2.3.2)では「ja_JP.eucJP」が返ります。
で、googleで検索してみると
こんな情報がありました。ようはNetBSDのlocaleの仕様なんですが、対応できてない
アプリケーションがいっぱあるような気が...。
(追記)と、上記でNetBSDのsetlocaleの仕様がおかしいように書いたのですが、Linuxでも、
$ unset LC_ALL $ unset LANG $ LC_CTYPE=ja_JP.eucjp; export LC_CTYPE $ ./localetest setlocale LC_ALL = (LC_CTYPE=ja_JP.eucjp;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=C;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C)みたいに返ってきました。ようは、すべての「LC_ほにゃらら」が同じ設定でなければ、 内容を列挙した形で(NetBSDとLinuxではびみょーにフォーマットが違いますが...)返される のが仕様のようです。で、NetBSD-1.6.2の場合はLC_ALLでlocaleを設定しても、全て同じに 設定出来ない(LC_MESSAGESのみOK)ので、列挙されて返ると...いうことのようです。
ですので、setlocale(LC_ALL, NULL)の戻り値が「ja_JP.eucJP」を期待するようなアプリケーションは 注意が必要です。
options SYSVMSG # System V-like message queues options SYSVSEM # System V-like semaphores #options SEMMNI=10 # number of semaphore identifiers #options SEMMNS=60 # number of semaphores in system #options SEMUME=10 # max number of undo entries per process #options SEMMNU=30 # number of undo structures in system options SYSVSHM # System V-like memory sharing #options SHMMAXPGS=1024 # 1024 pages is the default
##com* at vr4102ip? addr 0x0c000000 size 0x20 unit VRSIU pwctl PWCTL_COM0 サイズが 0x20 は間違いらしい... com* at vr4102ip? addr 0x0c000000 size 0x08 unit VRSIU pwctl PWCTL_COM0
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 1.6.2 (MCR450) #6: Thu Jan 27 17:29:57 JST 2005
root@mcr450:/usr/src/sys/arch/hpcmips/compile/MCR450
NEC MC-R530 (NEC VR4121 rev1.2 168.521MHz)
total memory = 49152 KB
avail memory = 42036 KB
using 640 buffers containing 2560 KB of memory
mainbus0 (root)
cpu0 at mainbus0: NEC VR4100 CPU (0xc60) Rev. 6.0 with software emulated floating point
cpu0: 16KB/16B direct-mapped L1 Instruction cache, 32 TLB entries
cpu0: 8KB/16B direct-mapped write-back L1 Data cache
vr4102ip0 at mainbus0
vrbcu0 at vr4102ip0 addr 0x0b000000-001f
vrbcu0: cpu 168.521MHz, bus 28.086MHz, ram 56.173MHz
vrcmu0 at vr4102ip0 addr 0x0b000060-007f
vrgiu0 at vr4102ip0 addr 0x0b000100-011f
button1 at vrgiu0 port=3 id=13 active=high sense=edge
button2 at vrgiu0 port=2 id=16 active=high sense=edge
pwctl0 at vrgiu0 port=46 id=0 on=1
pwctl3 at vrgiu0 port=44 id=6 on=1
vrdmaau0 at vr4102ip0 addr 0x0b000020-0037
vrdcu0 at vr4102ip0 addr 0x0b000040-004b
com0 at vr4102ip0 addr 0x0c000000-0007: ns16550a, working fifo <-- このメッセージで認識されていることを確認
vrrtc0 at vr4102ip0 addr 0x0b0000c0-00df
vrkiu0 at vr4102ip0 addr 0x0b000180-019f
hpckbd0 at vrkiu0
wskbd0 at hpckbd0: console keyboard
vrpmu0 at vr4102ip0 addr 0x0b0000a0-00bf
vrdsu0 at vr4102ip0 addr 0x0b0000e0-00e7
vrled0 at vr4102ip0 addr 0x0b000240-024f
vrpiu0 at vr4102ip0 addr 0x0b000120-013f, 0x0b0002a0-02bf
wsmouse0 at vrpiu0 mux 0
mqvideo0 at vr4102ip0 addr 0x0a000000-7fffff: MQ200 Rev.00 video controller, console
mqvideo0: framebuffer address: 0xaa180100
hpcfb0 at mqvideo0: 640x240 pixels, 65536 colors, 80x24 chars
wsdisplay0 at hpcfb0 kbdmux 1: console (std, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
vrc4172pwm0 at vr4102ip0 addr 0x15003880-3885
vraiu0 at vr4102ip0 addr 0x0b000160-017f
audio0 at vraiu0: half duplex
vrisab0 at vrgiu0: ISA port 0x14000000-0x18000000 mem 0x10000000-0x14000000
isa0 at vrisab0
pcic0 at isa0 port 0x3e0-0x3e1 iomem 0x70000-0x73fff irq 589827
pcic0: controller 0 (Intel 82365SL Revision 1) has sockets A and B
pcic0: controller 1 (Intel 82365SL Revision 1) has socket A only
pcmcia0 at pcic0 controller 0 socket 0
pcmcia1 at pcic0 controller 0 socket 1
pcmcia at pcic0 controller 1 socket 0 not configured
btnmgr0 at mainbus0
wskbd1 at btnmgr0 mux 1
wskbd1: connecting to wsdisplay0
hpcapm0 at mainbus0: pseudo power management module
apmdev0 at hpcapm0: Power Management spec V1.2
pcic0: using irq 589827 for socket events
wdc1 at pcmcia0 function 0 port 0x14000300-0x1400030f
wd0 at wdc1 channel 0 drive 0:
wd0: drive supports 1-sector PIO transfers, LBA addressing
wd0: 1946 MB, 3954 cyl, 16 head, 63 sec, 512 bytes/sect x 3985632 sectors
wd0: drive supports PIO mode 4
wi0 at pcmcia1 function 0: MELCO, WLI-PCM-L11, Version 01.01
wi0: port 0x14000340-0x1400037fpcmcia1: card irq 3
802.11 address 00:02:2d:01:28:17
wi0: using Lucent Technologies, WaveLAN/IEEE
wi0: Lucent Firmware: Station (4.52.1)
boot device: wd0
root on wd0a dumps on wd0b
pcmcia0: card irq 3
pcmcia0: card irq 3
pcmcia0: card irq 3
pcmcia0: card irq 3
root file system type: ffs
pcmcia1: card irq 3
hpcapm: battery life 80%
hpcapm: battery state high
カーネル再構築は上記を参照してください。
`#define StandardDefines -DCSRG_BASED' を以下に修正する `#define StandardDefines -DCSRG_BASED -DX_LOCALE'
(追記)アプリケーションでの、setlocale(LC_ALL, NULL)の戻り値を「ja_JP.eucJP」決め打ちに してよければ、libcのロケールを使っても、なんとかなるかもしれない...。
wscons=YES wscons_flags="" # setup wscons from wscons.conf
ttyE1 "/usr/libexec/getty std.9600" vt100 on secure ttyE2 "/usr/libexec/getty std.9600" vt100 on secure
# Add local overrides below
#
hostname=mcr450
defaultroute="192.168.0.100"
sshd=YES sshd_flags=""
lpd=YES lpd_flags="-s" # -s "secure" unix domain only
rpcbind=YES rpcbind_flags="-l" # -l logs libwrap
mountd=YES mountd_flags="" # NFS mount requests daemon
nfs_client=YES # enable client daemons
nfs_server=YES # enable server daemons
nfsd_flags="-6tun 4"
wscons=YES wscons_flags="" # setup wscons from wscons.conf
up 192.168.0.45 netmask 0xffffff00
nameserver 192.168.0.100 search artie.or.jp
lp|remote printer in home:\ :lp:\ :rm=192.168.0.1:\ :rp=lp:\ :sd=/var/spool/output/lph:\ :lf=/var/spool/output/lph/log:
/usr/local/lib /usr/local/netpbm/lib /usr/lib /usr/X11R6/lib
# User privilege specification root ALL=(ALL) ALL m-ito ALL=NOPASSWD: /sbin/mount /mnt/cf,/sbin/umount /mnt/cf,/etc/rc.d/network start,/etc/rc.d/network stop
/ -ro -maproot=root -network 192.168.0.0 -mask 255.255.255.0
/dev/wd0a / ffs rw,softdep,noatime,nodevmtime 1 1 /dev/wd0b none swap sw 0 0 /dev/wd1e /mnt/cf msdos rw,noauto 0 0
keycode 11 = 2 quotedbl keycode 15 = 6 ampersand keycode 16 = 7 apostrophe keycode 17 = 8 parenleft keycode 18 = 9 parenright keycode 19 = 0 keycode 20 = minus equal keycode 21 = asciicircum asciitilde keycode 34 = at grave keycode 35 = bracketleft braceleft keycode 47 = semicolon plus keycode 48 = colon asterisk keycode 49 = keycode 51 = bracketright braceright keycode 123 = backslash underscore keycode 133 = backslash bar !! !! Swap Caps_Lock and Control_L !! !remove Lock = Caps_Lock !remove Control = Control_L !keysym Control_L = Caps_Lock !keysym Caps_Lock = Control_L !add Lock = Caps_Lock !add Control = Control_L
! ! < xterm > ! XTerm*ScrollBar: on XTerm*SaveLines: 400 *XTerm*ttyModes: intr ^C erase ^? kill ^U XTerm*termName: xterm XTerm*font: s5x8 XTerm*background: #ffffed ! ! < kterm-6.2.0 > ! KTerm*ScrollBar: on KTerm*SaveLines: 400 *KTerm*ttyModes: intr ^C erase ^? kill ^U KTerm*termName: kterm KTerm*font: s5x8 KTerm*boldFont: s5x8 KTerm*romanKanaFont: s5x8 KTerm*romanKanaBoldFont: s5x8 KTerm*kanjiFont: elisa KTerm*kanjiBoldFont: elisa KTerm*VT100*translations: #override Ctrl<Key>O: begin-conversion(_JAPANESE_CONVERSION) KTerm*allowSendEvents: true KTerm*KanjiMode: euc KTerm*background: #ffffed ! ! < kinput2 > ! Kinput2*sendbackKeyPress: true ! ! < tk8.0.5jp > ! *tkKanjiConversionProtocol: kinput2 *tkKinputStartKeys: <Control-o> *tkKinputStyle(Text): over *tkKinputStyle(Entry): over
make clean CPPFLAGS=-I/usr/local/include/libpng ./configure --enable-shared make make install
-- パッチ ここから --
*** configure.ORG Fri Mar 5 09:30:37 2004
--- configure Fri Mar 5 07:58:32 2004
***************
*** 7477,7529 ****
fi
fi
! for ac_header in wctype.h
! do
! as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
! echo "$as_me:7483: checking for $ac_header" >&5
! echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
! if eval "test \"\${$as_ac_Header+set}\" = set"; then
! echo $ECHO_N "(cached) $ECHO_C" >&6
! else
! cat >conftest.$ac_ext <<_ACEOF
! #line 7489 "configure"
! #include "confdefs.h"
! #include <$ac_header>
! _ACEOF
! if { (eval echo "$as_me:7493: \"$ac_cpp conftest.$ac_ext\"") >&5
! (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
! ac_status=$?
! egrep -v '^ *\+' conftest.er1 >conftest.err
! rm -f conftest.er1
! cat conftest.err >&5
! echo "$as_me:7499: \$? = $ac_status" >&5
! (exit $ac_status); } >/dev/null; then
! if test -s conftest.err; then
! ac_cpp_err=$ac_c_preproc_warn_flag
! else
! ac_cpp_err=
! fi
! else
! ac_cpp_err=yes
! fi
! if test -z "$ac_cpp_err"; then
! eval "$as_ac_Header=yes"
! else
! echo "$as_me: failed program was:" >&5
! cat conftest.$ac_ext >&5
! eval "$as_ac_Header=no"
! fi
! rm -f conftest.err conftest.$ac_ext
! fi
! echo "$as_me:7518: result: `eval echo '${'$as_ac_Header'}'`" >&5
! echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
! if test `eval echo '${'$as_ac_Header'}'` = yes; then
! cat >>confdefs.h <<EOF
! #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
! EOF
!
! fi
! done
for ac_header in wchar.h
do
--- 7477,7529 ----
fi
fi
! #DEL_for ac_header in wctype.h
! #DEL_do
! #DEL_as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
! #DEL_echo "$as_me:7483: checking for $ac_header" >&5
! #DEL_echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
! #DEL_if eval "test \"\${$as_ac_Header+set}\" = set"; then
! #DEL_ echo $ECHO_N "(cached) $ECHO_C" >&6
! #DEL_else
! #DEL_ cat >conftest.$ac_ext <<_ACEOF
! #DEL_#line 7489 "configure"
! #DEL_#include "confdefs.h"
! #DEL_#include <$ac_header>
! #DEL__ACEOF
! #DEL_if { (eval echo "$as_me:7493: \"$ac_cpp conftest.$ac_ext\"") >&5
! #DEL_ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
! #DEL_ ac_status=$?
! #DEL_ egrep -v '^ *\+' conftest.er1 >conftest.err
! #DEL_ rm -f conftest.er1
! #DEL_ cat conftest.err >&5
! #DEL_ echo "$as_me:7499: \$? = $ac_status" >&5
! #DEL_ (exit $ac_status); } >/dev/null; then
! #DEL_ if test -s conftest.err; then
! #DEL_ ac_cpp_err=$ac_c_preproc_warn_flag
! #DEL_ else
! #DEL_ ac_cpp_err=
! #DEL_ fi
! #DEL_else
! #DEL_ ac_cpp_err=yes
! #DEL_fi
! #DEL_if test -z "$ac_cpp_err"; then
! #DEL_ eval "$as_ac_Header=yes"
! #DEL_else
! #DEL_ echo "$as_me: failed program was:" >&5
! #DEL_ cat conftest.$ac_ext >&5
! #DEL_ eval "$as_ac_Header=no"
! #DEL_fi
! #DEL_rm -f conftest.err conftest.$ac_ext
! #DEL_fi
! #DEL_echo "$as_me:7518: result: `eval echo '${'$as_ac_Header'}'`" >&5
! #DEL_echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
! #DEL_if test `eval echo '${'$as_ac_Header'}'` = yes; then
! #DEL_ cat >>confdefs.h <<EOF
! #DEL_#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
! #DEL_EOF
! #DEL_
! #DEL_fi
! #DEL_done
for ac_header in wchar.h
do
-- パッチ ここまで --
./configure
make
make install
-- パッチ ここから --
*** Makefile.ORG Fri Apr 28 00:17:22 2006
--- Makefile Mon May 1 16:11:10 2006
***************
*** 1,7 ****
# Linux
CC=c++
LIBS=-lcanna -ltermcap
! CFLAGS=-O2 -g
# Solaris 2.6J
#CC=c++
--- 1,7 ----
# Linux
CC=c++
LIBS=-lcanna -ltermcap
! CFLAGS=-O2 -g -I/usr/local/canna/include
# Solaris 2.6J
#CC=c++
*** pty.C.ORG Thu Apr 27 23:58:38 2006
--- pty.C Mon May 1 16:17:17 2006
***************
*** 11,16 ****
--- 11,19 ----
char Pty::endstr[] = "";
char Pty::endmsg[] = "";
+ static char nullstr[] = "";
+ static char *Tgetstr(char *id, char **area);
+
// コンストラクタだよん
Pty::Pty(int ac, char** av, char* amsg, char* emsg)
{
***************
*** 30,54 ****
char* pt = funcstr;
// スタンドアウト (反転)
! so = tgetstr("so", &pt);
adjstr(so);
! se = tgetstr("se", &pt);
adjstr(se);
// アンダーライン (下線)
! us = tgetstr("us", &pt);
adjstr(us);
! ue = tgetstr("ue", &pt);
adjstr(ue);
// カーソル位置の保存,保存した位置への復帰
! sc = tgetstr("sc", &pt);
adjstr(sc);
! rc = tgetstr("rc", &pt);
adjstr(rc);
// カーソル位置から行の最後までを削除する
! ce = tgetstr("ce", &pt);
adjstr(ce);
// ステータスラインを持っているかどうか
--- 33,57 ----
char* pt = funcstr;
// スタンドアウト (反転)
! so = Tgetstr("so", &pt);
adjstr(so);
! se = Tgetstr("se", &pt);
adjstr(se);
// アンダーライン (下線)
! us = Tgetstr("us", &pt);
adjstr(us);
! ue = Tgetstr("ue", &pt);
adjstr(ue);
// カーソル位置の保存,保存した位置への復帰
! sc = Tgetstr("sc", &pt);
adjstr(sc);
! rc = Tgetstr("rc", &pt);
adjstr(rc);
// カーソル位置から行の最後までを削除する
! ce = Tgetstr("ce", &pt);
adjstr(ce);
// ステータスラインを持っているかどうか
***************
*** 62,72 ****
// ステータスラインへ移動,戻る
if (hs) {
! ts = tgoto(tgetstr("ts", &pt), 0, 0);
adjstr(ts);
! fs = tgetstr("fs", &pt);
adjstr(fs);
! ds = tgetstr("ds", &pt);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
--- 65,75 ----
// ステータスラインへ移動,戻る
if (hs) {
! ts = tgoto(Tgetstr("ts", &pt), 0, 0);
adjstr(ts);
! fs = Tgetstr("fs", &pt);
adjstr(fs);
! ds = Tgetstr("ds", &pt);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
***************
*** 74,98 ****
}
}
else {
! char* cs = tgoto(tgetstr("cs", &pt), tgetnum("li") - 2, 0);
adjstr(cs);
if (cs) {
write(1, ce, strlen(ce));
write(1, cs, strlen(cs));
}
! char* cl = tgetstr("cl", &pt);
adjstr(cl);
if (cl) {
write(1, cl, strlen(cl));
strcat(endstr, cl);
}
! ds = tgoto(tgetstr("cs", &pt), tgetnum("li") - 1, 0);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
strcat(endstr, ce);
}
! ts = tgoto(tgetstr("cm", &pt), 0, tgetnum("li") - 1);
adjstr(ts);
fs = rc;
}
--- 77,101 ----
}
}
else {
! char* cs = tgoto(Tgetstr("cs", &pt), tgetnum("li") - 2, 0);
adjstr(cs);
if (cs) {
write(1, ce, strlen(ce));
write(1, cs, strlen(cs));
}
! char* cl = Tgetstr("cl", &pt);
adjstr(cl);
if (cl) {
write(1, cl, strlen(cl));
strcat(endstr, cl);
}
! ds = tgoto(Tgetstr("cs", &pt), tgetnum("li") - 1, 0);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
strcat(endstr, ce);
}
! ts = tgoto(Tgetstr("cm", &pt), 0, tgetnum("li") - 1);
adjstr(ts);
fs = rc;
}
***************
*** 133,138 ****
--- 136,149 ----
fail();
}
if (child) {
+ #if defined(__NetBSD__)
+ //
+ // 起動してもなぜか直に終了してしまう原因はexecしたshellが
+ // 起動しきる前に、その疑似端末のマスタ側を読み込もうとし
+ // ていたかららしい。
+ //
+ sleep(1);
+ #endif
close(0);
int cc;
int ret;
***************
*** 165,170 ****
--- 176,190 ----
dup2(slave, 1);
dup2(slave, 2);
close(slave);
+ #if defined(__NetBSD__)
+ //
+ // CTRL-C(SIGINT)等のシグナルが効かなかった原因は、疑似端末の
+ // スレーブが制御端末として設定できていなかったかららしい。
+ //
+ // stdin(=疑似端末のスレーブ)を制御端末とする
+ //
+ ioctl(0, TIOCSCTTY, 0);
+ #endif
if (ac > 1)
execvp(av[1], &av[1]);
else
***************
*** 334,358 ****
tgetent(buff, term);
char funcstr[BUFSIZ];
char* pt = funcstr;
! char* cs = tgoto(tgetstr("cs", &pt), tgetnum("li") - 2, 0);
adjstr(cs);
if (cs) {
write(1, ce, strlen(ce));
write(1, cs, strlen(cs));
}
! char* cl = tgetstr("cl", &pt);
adjstr(cl);
if (cl) {
write(1, cl, strlen(cl));
strcpy(endstr, cl);
}
! ds = tgoto(tgetstr("cs", &pt), tgetnum("li") - 1, 0);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
strcat(endstr, ce);
}
! ts = tgoto(tgetstr("cm", &pt), 0, tgetnum("li") - 1);
adjstr(ts);
}
--- 354,378 ----
tgetent(buff, term);
char funcstr[BUFSIZ];
char* pt = funcstr;
! char* cs = tgoto(Tgetstr("cs", &pt), tgetnum("li") - 2, 0);
adjstr(cs);
if (cs) {
write(1, ce, strlen(ce));
write(1, cs, strlen(cs));
}
! char* cl = Tgetstr("cl", &pt);
adjstr(cl);
if (cl) {
write(1, cl, strlen(cl));
strcpy(endstr, cl);
}
! ds = tgoto(Tgetstr("cs", &pt), tgetnum("li") - 1, 0);
adjstr(ds);
if (ds) {
strcat(endstr, ds);
strcat(endstr, ce);
}
! ts = tgoto(Tgetstr("cm", &pt), 0, tgetnum("li") - 1);
adjstr(ts);
}
***************
*** 364,367 ****
--- 384,402 ----
ioctl(wfd, TIOCSWINSZ, (char*) &win);
signal(SIGWINCH, (SIG_PF) winchange);
+ }
+
+ //
+ // termcapエントリが貧弱な場合core dumpするのを防ぐ為のtgetstr代替
+ //
+ static char *Tgetstr(char *id, char **area)
+ {
+ static char *str;
+
+ str = tgetstr(id, area);
+ if (str == (char *)NULL){
+ return(nullstr);
+ }else{
+ return(str);
+ }
}
*** pty.H.ORG Fri Apr 28 00:16:03 2006
--- pty.H Mon May 1 16:11:10 2006
***************
*** 15,21 ****
#include <sys/file.h>
#include <sys/signal.h>
#include <sys/wait.h>
! #if defined(sun)
#include <curses.h>
#else
#include <term.h>
--- 15,21 ----
#include <sys/file.h>
#include <sys/signal.h>
#include <sys/wait.h>
! #if defined(sun) || defined(__NetBSD__)
#include <curses.h>
#else
#include <term.h>
-- パッチ ここまで --
make
cp canfep /usr/local/bin/
-- パッチ ここから -- *** ./src/Makefile.in.ORG Sat Mar 27 12:09:14 2004 --- ./src/Makefile.in Sat Mar 27 12:09:14 2004 *************** *** 116,122 **** /* Some machines don't find the standard C libraries in the usual place. */ #ifndef ORDINARY_LINK #ifndef LIB_STANDARD ! #define LIB_STANDARD -lc #endif #else #ifndef LIB_STANDARD --- 116,123 ---- /* Some machines don't find the standard C libraries in the usual place. */ #ifndef ORDINARY_LINK #ifndef LIB_STANDARD ! /* #define LIB_STANDARD -lc */ ! #define LIB_STANDARD -lc /usr/lib/crtend.o #endif #else #ifndef LIB_STANDARD *************** *** 221,227 **** #ifdef COFF_ENCAPSULATE #define START_FILES pre-crt0.o /usr/local/lib/gcc-crt0.o #else /* ! defined (COFF_ENCAPSULATE) */ ! #define START_FILES pre-crt0.o /lib/crt0.o #endif /* ! defined (COFF_ENCAPSULATE) */ #else /* ! defined (NO_REMAP) */ #define START_FILES ecrt0.o --- 222,229 ---- #ifdef COFF_ENCAPSULATE #define START_FILES pre-crt0.o /usr/local/lib/gcc-crt0.o #else /* ! defined (COFF_ENCAPSULATE) */ ! /* #define START_FILES pre-crt0.o /lib/crt0.o */ ! #define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crtbegin.o #endif /* ! defined (COFF_ENCAPSULATE) */ #else /* ! defined (NO_REMAP) */ #define START_FILES ecrt0.o -- パッチ ここまで --
CC="gcc -I/usr/local/include -I/usr/local/include/libpng" LDFLAGS=-L/usr/local/lib ./configure make make install
INSTALL=/usr/bin/install ./configure make make install
-- パッチ ここから --
*** config.guess.ORG Wed Mar 10 06:24:00 2004
--- config.guess Wed Mar 10 05:52:43 2004
***************
*** 121,126 ****
--- 121,129 ----
hkmips:OpenBSD:*:*)
echo mips-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
+ hpcmips:NetBSD:*:*)
+ echo mips-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
pmax:OpenBSD:*:*)
echo mipsel-unknown-openbsd${UNAME_RELEASE}
exit 0 ;;
-- パッチ ここまで --
./configure --enable-shared --enable-static
make
make install
LDFLAGS=-L/usr/local/lib ./configure make make install madplay -R 8000 foo.mp3
-- パッチ ここから --
*** ./src/io-curses.c.ORG Mon Nov 29 12:21:38 2004
--- ./src/io-curses.c Mon Nov 29 10:19:29 2004
***************
*** 58,64 ****
--- 58,68 ----
#include "key.h"
#include "input.h"
#include "info.h"
+ #if defined(__NetBSD__)
+ #include <curses.h>
+ #else
#include <term.h>
+ #endif
#define MIN_WIN_HEIGHT (cwin->flags&WIN_EDGES ? 2 : 1)
#define MIN_WIN_WIDTH (cwin->flags&WIN_EDGES ? 6 : 1)
***************
*** 387,393 ****
--- 391,401 ----
io_init_windows (LINES, COLS, 1, 2, 1, 1, 1, 1);
// io_init_windows (Global->scr_lines, Global->scr_cols, 1, 2, 1, 1, 1, 1);
info_rows = 1;
+ #if defined(__NetBSD__)
+ print_width = COLS; /* Make ascii print width == terminal width. */
+ #else
print_width = columns; /* Make ascii print width == terminal width. */
+ #endif
}
void
***************
*** 705,711 ****
--- 713,723 ----
return;
getyx (stdscr, yy, xx);
move (Global->status, 0);
+ #if defined(__NetBSD__)
+ wid = COLS - 2;
+ #else
wid = columns - 2;
+ #endif
if (mkrow != NON_ROW)
{
-- パッチ ここまで --
./configure
make
make install
./configure --prefix=/usr/local make make install
-- パッチ ここから --
*** sunaudio.c.ORG Fri Mar 19 10:42:01 2004
--- sunaudio.c Fri Mar 19 10:39:00 2004
***************
*** 31,37 ****
--- 31,39 ----
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+ #ifndef __NetBSD__
#include <stropts.h>
+ #endif
#include <malloc.h>
#include <unistd.h>
#include <stdlib.h>
***************
*** 170,176 ****
--- 172,182 ----
return(ST_EOF);
}
/* Flush any data in the buffers - its probably in the wrong format */
+ #ifdef __NetBSD__
+ ioctl(fileno(ft->fp), AUDIO_FLUSH, 0);
+ #else
ioctl(fileno(ft->fp), I_FLUSH, FLUSHR);
+ #endif
/* Change to non-buffered I/O*/
setvbuf(ft->fp, NULL, _IONBF, sizeof(char) * ft->file.size);
sigintreg(ft); /* Prepare to catch SIGINT */
-- パッチ ここまで --
./configure
make
make install
-- パッチ ここから --
*** tpctl.h.ORG Sat Apr 3 17:18:04 2004
--- tpctl.h Sat Apr 3 17:17:48 2004
***************
*** 29,34 ****
--- 29,44 ----
* POSSIBILITY OF SUCH DAMAGE.
*/
+ /* get device id for calibration */
+ #define WSMOUSE_ID_TYPE_UIDSTR 0
+ #define WSMOUSE_ID_MAXLEN 256
+ #define WSMOUSEIO_GETID _IOWR('W', 38, struct wsmouse_id)
+ struct wsmouse_id {
+ u_int type;
+ u_int length;
+ u_char data[WSMOUSE_ID_MAXLEN];
+ };
+
#ifndef __TPCTL_H__
#define __TPCTL_H__
-- パッチ ここまで --
/usr/bin/make
cp tpctl /usr/local/sbin/
cp tpctl.8 /usr/local/man/man8/
-- パッチ ここから --
*** rw/rwTable.c.ORG Sun Mar 7 20:26:46 2004
--- rw/rwTable.c Sun Mar 7 20:38:07 2004
***************
*** 232,238 ****
--- 232,240 ----
RWGetMsg()
{
#if defined(BSD4_4)
+ #if !defined(__NetBSD__)
__const extern char *__const sys_errlist[];
+ #endif
#else
#ifndef __GLIBC__
#ifndef SYS_ERRLIST_DEFINED
*** misc.h.ORG Sun Mar 7 20:06:21 2004
--- misc.h Sun Mar 7 20:08:06 2004
***************
*** 23,29 ****
long random(void);
#endif
! #if !defined(linux) & !defined(__EMX__) & !defined(__FreeBSD__) & !defined(__CYGWIN__)
#if defined(BSD4_4) || defined(HPArchitecture) || defined(SGIArchitecture) || defined(_AIX) || defined(_SCO_DS)
void srandom(unsigned int);
#else
--- 23,29 ----
long random(void);
#endif
! #if !defined(linux) & !defined(__EMX__) & !defined(__FreeBSD__) & !defined(__CYGWIN__) & !defined(__NetBSD__)
#if defined(BSD4_4) || defined(HPArchitecture) || defined(SGIArchitecture) || defined(_AIX) || defined(_SCO_DS)
void srandom(unsigned int);
#else
*** Local.config.ORG Mon Mar 8 01:57:18 2004
--- Local.config Mon Mar 8 01:59:51 2004
***************
*** 84,90 ****
#ifdef HavePNG
PNG_LIB = -L/usr/lib -lpng -lz
! PNG_INCLUDE = -I/usr/include/png
#endif
XCOMM If you are running SunOS and get an error with the following undefined
--- 84,90 ----
#ifdef HavePNG
PNG_LIB = -L/usr/lib -lpng -lz
! PNG_INCLUDE = -I/usr/local/include/libpng
#endif
XCOMM If you are running SunOS and get an error with the following undefined
-- パッチ ここまで --
xmkmf
make Makefiles
make
make install
make install.man
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"
#
# canvas.tk - simple memo writing tool ver. 0.01 by m.ito
# 2004.03.12 create
#
# usage : canvas.tk window_width window_height canvas_width canvas_height
#
#font create f10 -compound {a10 k10} -size 16
#font create f10 -compound {a10 k10}
font create f10 -compound {s5x8 elisa}
#font create f10 -compound {a14 k14}
bind Text <Control-o> {kinput_start %W over}
bind Entry <Control-o> {kinput_start %W over}
set bgcolor "#ffffff"
set fgcolor "#000000"
set pen_width 1
set vcwidth [lindex $argv 0]
set vcheight [lindex $argv 1]
set rcwidth [lindex $argv 2]
set rcheight [lindex $argv 3]
set log_idx -1
frame .line01
pack .line01 -side top -fill both -expand 1
button .line01.but1 -text "Save" -font f10 -command {
set file [tk_getSaveFile -initialdir ~/.canvas -initialfile canvas.cnv -defaultextension .cnv]
if { $file != "" } {
set fd [open $file "w"]
for { set j 0 } { $j <= $log_idx } { incr j } {
puts $fd $log($j)
}
close $fd
}
}
pack .line01.but1 -side left -fill both -expand 1
button .line01.but1_1 -text "Load" -font f10 -command {
set file [tk_getOpenFile -initialdir ~/.canvas -initialfile canvas.cnv -defaultextension .cnv]
if { $file != "" } {
set fd [open $file "r"]
set log_idx -1
gets $fd rec
while { ![eof $fd] } {
incr log_idx
set log($log_idx) $rec
eval $rec
gets $fd rec
}
close $fd
}
}
pack .line01.but1_1 -side left -fill both -expand 1
button .line01.but1_2 -text "Print" -font f10 -command {
set file [tk_getSaveFile -initialdir ~/.canvas -initialfile canvas.ps -defaultextension .ps]
#
# gs -sPAPERSIZE=a4 canvas.ps
# gs -sPAPERSIZE=a4 -r77 canvas.ps
# gs -g640x908 -r77 canvas.ps
#
# gs -dNOPAUSE -g640x908 -sDEVICE=jpeg -sOutputFile=canvas.jpg -q -r77 -dBATCH canvas.ps
# gs -dNOPAUSE -sPAPERSIZE=a4 -sDEVICE=jpeg -sOutputFile=canvas.jpg -q -dBATCH canvas.ps
#
if { $file != "" } {
.line02.can postscript -file "$file" -colormode color -x 0 -y 0 -width $rcwidth -height $rcheight -pageanchor sw -pagex 0 -pagey 0 -pagewidth 210m -pageheight 298m
}
}
pack .line01.but1_2 -side left -fill both -expand 1
button .line01.but2 -text "\[1\]" -font f10 -command {
set pen_width 1
.line01.but2 configure -text "\[1\]"
.line01.but3 configure -text "3"
.line01.but4 configure -text "5"
.line01.but5 configure -text "30"
}
pack .line01.but2 -side left -fill both -expand 1
button .line01.but3 -text "3" -font f10 -command {
set pen_width 3
.line01.but2 configure -text "1"
.line01.but3 configure -text "\[3\]"
.line01.but4 configure -text "5"
.line01.but5 configure -text "30"
}
pack .line01.but3 -side left -fill both -expand 1
button .line01.but4 -text "5" -font f10 -command {
set pen_width 5
.line01.but2 configure -text "1"
.line01.but3 configure -text "3"
.line01.but4 configure -text "\[5\]"
.line01.but5 configure -text "30"
}
pack .line01.but4 -side left -fill both -expand 1
button .line01.but5 -text "30" -font f10 -command {
set pen_width 30
.line01.but2 configure -text "1"
.line01.but3 configure -text "3"
.line01.but4 configure -text "5"
.line01.but5 configure -text "\[30\]"
}
pack .line01.but5 -side left -fill both -expand 1
button .line01.but6 -text "\[B\]" -font f10 -command {
set fgcolor "#000000"
.line01.but6 configure -text "\[B\]"
.line01.but7 configure -text "R"
.line01.but8 configure -text "W"
}
pack .line01.but6 -side left -fill both -expand 1
button .line01.but7 -text "R" -font f10 -command {
set fgcolor "#ff0000"
.line01.but6 configure -text "B"
.line01.but7 configure -text "\[R\]"
.line01.but8 configure -text "W"
}
pack .line01.but7 -side left -fill both -expand 1
button .line01.but8 -text "W" -font f10 -command {
set fgcolor "#ffffff"
.line01.but6 configure -text "B"
.line01.but7 configure -text "R"
.line01.but8 configure -text "\[W\]"
}
pack .line01.but8 -side left -fill both -expand 1
button .line01.but9 -text "Clear" -font f10 -command {
.line02.can delete all
set log_idx -1
}
pack .line01.but9 -side left -fill both -expand 1
button .line01.but10 -text "Exit" -font f10 -command {
exec kill [pid]
}
pack .line01.but10 -side left -fill both -expand 1
frame .line02
pack .line02 -side top -fill both -expand 1
canvas .line02.can \
-scrollregion "0 0 $rcwidth $rcheight" \
-width $vcwidth \
-height $vcheight \
-background $bgcolor \
-xscrollcommand ".line03.hs set" \
-yscrollcommand ".line02.vs set"
scrollbar .line02.vs -command ".line02.can yview"
pack .line02.can -side left -fill both -expand 1
pack .line02.vs -side left -fill both -expand 1
frame .line03
pack .line03 -side top -fill both -expand 1
scrollbar .line03.hs -orient horiz -command ".line02.can xview"
pack .line03.hs -side left -fill both -expand 1
bind .line02.can <Button-1> {
set x [.line02.can canvasx %x]
set y [.line02.can canvasy %y]
}
bind .line02.can <B1-Motion> {
set nx [.line02.can canvasx %x]
set ny [.line02.can canvasy %y]
set kyori_no_2jo [expr (($x - $nx) * ($x - $nx)) + (($y - $ny) * ($y - $ny))]
if { $kyori_no_2jo > 16 && $kyori_no_2jo < 900 } {
.line02.can create line $x $y $nx $ny \
-fill $fgcolor \
-width $pen_width
incr log_idx
set log($log_idx) ".line02.can create line $x $y $nx $ny -fill $fgcolor -width $pen_width"
set x $nx
set y $ny
}
}
up 192.168.0.45 netmask 0xffffff00
インストールは、幾つかのファイルに別れているので、ちょっと分かりにくいかもしれませんが、PDA のようなリソースの限られたデバイスで利用する場合に、必要最低限の機能を選択してインストール出 来るようにそのようなスタイルになっているのだと思います。
私は以下の手順でインストールしました...
続きはmatchbox window manager on NetBSD/hpcmipsから。
NetBSD-3.1 with MC-R450のお話し は又の機会にしたいと思ってます。もうしばらく お待ち下さい(MPlayer-1.0rc1を動かしてみた話なんか面白いかも...)。
NetBSD-1.6.2 with MC/R300でも面白いネタがあって、実は昨日(2007/6/21)Xvncをbuild する事に成功しました(^o^)/。といっても2000年辺りの情報をかき集めて、最新のvncソースに 適応させただけなのですが...。今、情報の整理をしているのでもうすぐ公開できると思います。
これでmgvncviewerの復活ができれば、モノクロモバ(MC-R3xx)でX Window Systemの利用が できるようになるのですが...鋭意作業していきたいと思います。
2007/6/23 mgvncviewer のbuildに成功しました。モノクロモバ(MC/R300)上でXvncを動かし、 さらに同一機上でmgvncviewerを起動することにより、モノクロモバ(MC/R300)上で X Window Systemの稼働が実現しました。ただ、私が探した限りではmgvncviewerの実装 が2種類有って、今回成功したのは1種類だけですので、もう1種類の方も試してから build情報を紹介したいと思ってます。もう少しお待ち下さい。
2007/06/26 X Window System for MC/R300 on NetBSD/hpcmipsからどうぞ!。