メッセージ欄

分類 【NetBSD】 で検索

一覧で表示する

Armadillo-210
2007/10/25(木) 28:12 NetBSD はてブ情報 はてブに登録 はてブ数

Armadillo-210を動かそうといろいろ再開しています。
  • 独り立ちできること (mdで起動する)
  • NFS mountできること (NFSを使えば機能を拡張できる)
  • リモートログインできること (telnetでもいいから欲しい)
  • kernel regionを拡張しないこと (64k x 23 = 1,507,328bytes以下に収める)
いささか削りすぎたkernel+ramdiskがやっとこできました。

また、Mac OS Xでのhermitも動きました。が、なぜか最初の一回目だけしか正常動作しません。なので、hermit使うたびにUSB serialを抜き刺ししていたりします。あ、ちなみにhermitへのパッチはNetBSDにあてたのと同じです。
-r--r--r--   1 tokuda  tokuda  1501621 Oct 26 03:50 netbsd-ARMADILLO210_TINY.bin.gz
lessをmoreにかえたり、mount_ffsを復活させてもう一回作り直そう。

あとはtelnetdが動くようにしないと、ってinetdが必要ってことか!?

./telnetd -debug 23 とかで動かした。
macbook:~ tokuda$ telnet 192.168.100.210
Trying 192.168.100.210...
Connected to 192.168.100.210.
Escape character is '^]'.


4.4 BSD UNIX () (ttyp0)

/usr/bin/login: m
telnetd: /usr/bin/login: No such file or directory.
Connection closed by foreign host.
macbook:~ tokuda$ 
4.4 BSD UNIXって! そんなことより/usr/bin/loginも必要とな。

loginつくってmaster.passwdを手書きしたらloginできたよ。
macbook:~/NetBSD/s/20071014/src/distrib/utils/x_login tokuda$ !te
telnet 192.168.100.210
Trying 192.168.100.210...
Connected to 192.168.100.210.
Escape character is '^]'.


4.4 BSD UNIX () (ttyp0)

login: tokuda
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

$ ls
bin        dev        etc        kern       libexec    mnt        mnt2       sbin       targetroot tmp        usr        var
$ pwd
/
$ 
マルチユーザで動かすの、やっぱし大変そうかのぉ。/etc/rc, /etc/rc.subrとかをコピーして. /etc/rcとかやったらrcorder, dateがありまへんと怒られました。

そもそもなんでinitが/etc/rcを呼ばないのかな。initのソースをみたらLETS_GET_SMALLとかいうのがあるぞ。こいつが定義されてるのかな。

NetBSD/mpc860を作るときのメモ
2007/10/08(月) 24:48 NetBSD はてブ情報 はてブに登録 はてブ数

なにはなくとも、まずは20070526-UTCなソースを準備します。

macppc-070526.tar.gzをテンポラリで展開し、hfs関連を削除しておきます。
具体的には二つのディレクトリ(sbin/mount_hfs, sys/fs/hfs)を削除します。

20070526-UTCなソースにrm -rf sys/arch/powerpc,macppcします。

hfs抜きのmacppc-070526.tar.gzを展開します。

mpc860-070526.tar.gzを展開します。

etc, distrib関連のファイルを作成します。
  • distrib/sets/lists/base/md.mpc860
  • distrib/sets/lists/comp/md.mpc860
  • etc/etc.mpc860/MAKEDEV.conf
  • etc/etc.mpc860/Makefile.inc
  • etc/etc.mpc860/ttys
tools/Makefile.disklabelにパッチをあてます。reloc.hがちゃんとコピーされるようにするものです。
--- ./tools/Makefile.disklabel.orig     2007-09-26 02:36:32.000000000 +0900
+++ ./tools/Makefile.disklabel  2007-09-26 02:40:01.000000000 +0900
@@ -12,6 +12,8 @@
 
 _ARCH_INCS+=   ews4800mips/include/pdinfo.h ews4800mips/include/vtoc.h
 
+_ARCH_INCS+=   powerpc/include/reloc.h mpc860/include/reloc.h
+
 _INCS=         disktab.h
 _SYSINCS=      bootblock.h \
                disklabel.h disklabel_acorn.h disklabel_gpt.h dkbad.h
Makefile.mpc860.diffにパッチをあてます。toolsで作ったものを使うように変更します。
--- ./sys/arch/mpc860/conf/Makefile.mpc860.orig 2007-09-21 22:54:39.000000000 +0900
+++ ./sys/arch/mpc860/conf/Makefile.mpc860      2007-09-26 03:03:01.000000000 +0900
@@ -17,19 +17,19 @@
 # DEBUG is set to -g if debugging.
 # PROF is set to -pg if profiling.
 
-AR?=   ar
-AS?=   as
-CC?=   cc
-CPP?=  cpp
-LD?=   ld
-LORDER?=lorder
-MKDEP?=        mkdep
-NM?=   nm
-OBJCOPY?=objcopy
-RANLIB?=ranlib
-SIZE?= size
-STRIP?=        strip
-TSORT?=        tsort -q
+AR=    ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-ar
+AS=    ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-as
+CC=    ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-gcc
+CPP=   ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-cpp
+LD=    ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-ld
+LORDER=${TOOLDIR}/bin/nblorder
+MKDEP= ${TOOLDIR}/bin/nbmkdep
+NM=    ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-nm
+OBJCOPY=${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-objcopy
+RANLIB=${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-ranlib
+SIZE=  ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-size
+STRIP= ${TOOLDIR}/bin/${MACHINE_ARCH}--netbsd-strip
+TSORT= ${TOOLDIR}/bin/nbtsort -q
 
 COPTS?= -O2 -pipe
 
@@ -127,7 +127,7 @@
 %LOAD
 
 assym.h: ${PPC}/mpc860/genassym.cf
-       genassym ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
+       ${TOOLDIR}/bin/nbgenassym ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
            < ${PPC}/mpc860/genassym.cf > assym.h.tmp && \
        mv -f assym.h.tmp assym.h
 
@@ -188,7 +188,7 @@
 .if ${SFILES} != ""
        ${MKDEP} -a -- ${AFLAGS} ${CPPFLAGS} ${SFILES}
 .endif
-       genassym ${MKDEP} -f assym.dep -- ${CFLAGS} \
+       ${TOOLDIR}/bin/nbgenassym ${MKDEP} -f assym.dep -- ${CFLAGS} \
          ${CPPFLAGS} < ${PPC}/mpc860/genassym.cf
        @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
        @rm -f assym.dep
ad.powerpcにパッチです。checkflistを通すためにごりごり書いています。
--- ./distrib/sets/lists/comp/ad.powerpc.orig   2007-10-03 10:30:50.000000000 +0900
+++ ./distrib/sets/lists/comp/ad.powerpc        2007-10-01 02:30:20.000000000 +0900
@@ -6,7 +6,6 @@
 ./usr/include/powerpc/ansi.h                   comp-c-include
 ./usr/include/powerpc/aout_machdep.h           comp-c-include
 ./usr/include/powerpc/asm.h                    comp-c-include
-./usr/include/powerpc/atomic.h                 comp-c-include
 ./usr/include/powerpc/bat.h                    comp-obsolete           obsolete
 ./usr/include/powerpc/bswap.h                  comp-c-include
 ./usr/include/powerpc/bus.h                    comp-obsolete           obsolete
@@ -20,11 +19,6 @@
 ./usr/include/powerpc/frame.h                  comp-c-include
 ./usr/include/powerpc/hid.h                    comp-obsolete           obsolete
 ./usr/include/powerpc/hid_601.h                        comp-obsolete           obsolete
-./usr/include/powerpc/ibm4xx                   comp-c-include
-./usr/include/powerpc/ibm4xx/cpu.h             comp-c-include
-./usr/include/powerpc/ibm4xx/pmap.h            comp-c-include
-./usr/include/powerpc/ibm4xx/pte.h             comp-obsolete           obsolete
-./usr/include/powerpc/ibm4xx/tlb.h             comp-c-include
 ./usr/include/powerpc/ieee.h                   comp-c-include
 ./usr/include/powerpc/ieeefp.h                 comp-c-include
 ./usr/include/powerpc/int_const.h              comp-c-include
@@ -32,6 +26,7 @@
 ./usr/include/powerpc/int_limits.h             comp-c-include
 ./usr/include/powerpc/int_mwgwtypes.h          comp-c-include
 ./usr/include/powerpc/int_types.h              comp-c-include
+./usr/include/powerpc/ipkdb.h          comp-c-include
 ./usr/include/powerpc/kcore.h                  comp-c-include
 ./usr/include/powerpc/limits.h                 comp-c-include
 ./usr/include/powerpc/lock.h                   comp-c-include
@@ -47,18 +42,10 @@
 ./usr/include/powerpc/mpc6xx/sr_601.h          comp-obsolete           obsolete
 ./usr/include/powerpc/mpc6xx/vmparam.h         comp-obsolete           obsolete
 ./usr/include/powerpc/mutex.h                  comp-c-include
-./usr/include/powerpc/oea                      comp-c-include
-./usr/include/powerpc/oea/bat.h                        comp-c-include
-./usr/include/powerpc/oea/hid.h                        comp-c-include
-./usr/include/powerpc/oea/hid_601.h            comp-c-include
-./usr/include/powerpc/oea/pmap.h               comp-c-include
-./usr/include/powerpc/oea/pte.h                        comp-c-include
-./usr/include/powerpc/oea/sr_601.h             comp-c-include
-./usr/include/powerpc/oea/vmparam.h            comp-c-include
 ./usr/include/powerpc/param.h                  comp-c-include
 ./usr/include/powerpc/pcb.h                    comp-c-include
+./usr/include/powerpc/pio.h                    comp-c-include
 ./usr/include/powerpc/pmap.h                   comp-c-include
-./usr/include/powerpc/pmc.h                    comp-c-include
 ./usr/include/powerpc/proc.h                   comp-c-include
 ./usr/include/powerpc/profile.h                        comp-c-include
 ./usr/include/powerpc/psl.h                    comp-c-include
@@ -69,7 +56,6 @@
 ./usr/include/powerpc/rwlock.h                 comp-c-include
 ./usr/include/powerpc/setjmp.h                 comp-c-include
 ./usr/include/powerpc/signal.h                 comp-c-include
-./usr/include/powerpc/spr.h                    comp-c-include
 ./usr/include/powerpc/stdarg.h                 comp-c-include
 ./usr/include/powerpc/trap.h                   comp-c-include
 ./usr/include/powerpc/types.h                  comp-c-include
build.shにパッチをあてます。mpc860を追加するだけです。
--- ./build.sh.orig     2007-09-21 10:05:31.000000000 +0900
+++ ./build.sh  2007-09-21 22:54:10.000000000 +0900
@@ -336,7 +336,7 @@
                MACHINE_ARCH=powerpc64
                ;;
 
-       amigappc|bebox|evbppc|ibmnws|macppc|mvmeppc|ofppc|pmppc|prep|sandpoint)
+       amigappc|bebox|evbppc|ibmnws|macppc|mpc860|mvmeppc|ofppc|pmppc|prep|sandpoint)
                MACHINE_ARCH=powerpc
                ;;
 
ip_compat.hにパッチをあてます。caddr_tの重複定義を回避するんですがよくわかりません。
--- ./sys/dist/ipf/netinet/ip_compat.h.orig     2007-09-26 08:30:22.000000000 +0900
+++ ./sys/dist/ipf/netinet/ip_compat.h  2007-10-01 04:39:47.000000000 +0900
@@ -737,7 +737,10 @@
 #  define      GETKTIME(x)     microtime((struct timeval *)x)
 #  define      IPF_PANIC(x,y)  if (x) { printf y; panic("ipf_panic"); }
 #if __NetBSD_Version__ >= 499001000
+#ifndef CADDR_T_DEFINED
+#define CADDR_T_DEFINED
 typedef unsigned char * caddr_t;
+#endif
 #  define      COPYIN(a,b,c)   copyin((a), (b), (c))
 #  define      COPYOUT(a,b,c)  copyout((a), (b), (c))
 #  define      BCOPYIN(a,b,c)  bcopy((a), (b), (c))
types.hへのパッチです。ip_compat.hと対です。
--- ./sys/arch/powerpc/include/types.h.orig     2007-09-26 08:31:26.000000000 +0900
+++ ./sys/arch/powerpc/include/types.h  2007-09-26 09:41:28.000000000 +0900
@@ -41,9 +41,12 @@
 #if defined(_KERNEL) || defined(_STANDALONE)
 #ifndef caddr_t
 typedef char *caddr_t;         /* core address */
+#ifndef CADDR_T_DEFINED
+#define CADDR_T_DEFINED
 #define caddr_t __caddr_t
 #endif
 #endif
+#endif
 
 #ifdef _KERNEL
 typedef struct label_t {
これでbuild.shでreleaseまで一直線のはず。

NetBSD/mpc860 久しぶりに動きました
2007/10/08(月) 24:23 NetBSD はてブ情報 はてブに登録 はてブ数

20070526-UTCなsource + macppc-070526.tar.gz + mpc860-070526.tar.gz + いくつかのパッチをあてることで数年ぶりにNetBSD/mpc860が更新されました。久しぶりすぎて本当に嬉しい。

SanDiskの256MbytesのCFにインストールして起動した様子は次のとおりです。
>> OpenBlockS Boot, Revision 1.2
>> (root@r1.home.tokuda.net, Tue Oct  4 02:57:22 UTC 2005)
1659188+100736 [110160+105435]=0x1e2884
 start=0x10000
ssym = 1bdab4, esym = 1fb000
NetBSD 4.99.20 (MPC860) #0: Thu Oct  4 10:39:09 JST 2007
        tokuda@MacBook.local:/Users/tokuda/NetBSD/s/20070526/src/sys/arch/mpc860/compile/MPC860
total memory = 16384 KB
avail memory = 13964 KB
mainbus0 (root)
cpu0 at mainbus0: 860 (Revision 0)
pbus0 at mainbus0
scc0 at pbus0: vec 9 (console)
fec0 at pbus0: vec 7 address 00:80:6d:47:29:d5
tqphy0 at fec0 phy 1: 78Q2120 10/100 media interface, rev. 11
tqphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sce0 at pbus0: vec 9 address 00:80:6d:47:29:d6
obus0 at mainbus0
wdc0 at obus0: vec 8 addr 0x80000010
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <SanDisk SDCFB-256>
wd0: 245 MB, 980 cyl, 16 head, 32 sec, 512 bytes/sect x 501760 sectors
boot device: wd0
root on wd0a dumps on wd0b
root file system type: ffs
Mon Oct  8 16:46:44 UTC 2007
Checking for botched superblock upgrades: done.
Starting file system checks:
/dev/rwd0a: file system is clean; not checking
Setting tty flags.
Setting sysctl variables:
^LStarting network.
Hostname: obs50
Configuring network interfaces: fec0.
add net default: gateway 192.168.100.1
Adding interface aliases:
Building databases: dev, utmp, utmpx done
Starting syslogd.
Checking for core dump...
savecore: no core dump (invalid dumplo)
Mounting all filesystems...
Clearing temporary files.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
/etc/rc: WARNING: No swap space configured!
Starting virecover.
Starting local daemons:.
Updating motd.
Starting inetd.
Starting cron.
Mon Oct  8 16:46:59 UTC 2007

NetBSD/mpc860 (obs50) (console)

login: tokuda
Password:
Last login: Mon Oct  8 16:44:18 2007 on tty??
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007
    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 4.99.20 (MPC860) #0: Thu Oct 4 10:39:09 JST 2007

Welcome to NetBSD!

This system is running a development snapshot of the NetBSD operating system,
also known as NetBSD-current.  It is highly possible for it to contain serious
bugs, regressions, broken features or other problems.  Please bear this in mind
and use the system with care.

You are encouraged to test this version as thoroughly as possible.  Should you
encounter any problem, please report it back to the development team using the
send-pr(1) utility (requires a working MTA).  If yours is not properly set up,
use the web interface at: http://www.NetBSD.org/Misc/send-pr.html

Thank you for helping us test and improve NetBSD.

% uname -a
NetBSD obs50 4.99.20 NetBSD 4.99.20 (MPC860) #0: Thu Oct  4 10:39:09 JST 2007  tokuda@MacBook.local:/Users/tokuda/NetBSD/s/20070526/src/sys/arch/mpc860/compile/MPC860 mpc860
%

1: Gao 『Hi, will the patch to support mpc860 to be public?』 (2009/09/05 8:32)

2: Hiroshi Tokuda 『>Hi, will the patch to support mpc860 to be public?macppc + m...』 (2009/09/23 11:00)

mpc860やっぱりinit動かず
2007/10/01(月) 24:31 NetBSD はてブ情報 はてブに登録 はてブ数


>> OpenBlockS Boot, Revision 1.2
>> (root@r1.home.tokuda.net, Tue Oct  4 02:57:22 UTC 2005)
net_open: client addr: 192.168.100.60
net_open: subnet mask: 255.255.255.0
net_open: server addr: 192.168.100.32
net_open: server path: /usr/MPC860
net_open: file name: /netbsd
Using IP address: 192.168.100.60
root addr=192.168.100.32 path=/usr/MPC860
1659188+100736 [110160+105435]=0x1e2884
 start=0x10000
ssym = 1bdab4, esym = 1fb000
NetBSD 4.99.20 (MPC860) #5: Mon Oct  1 04:58:30 JST 2007
        tokuda@MacBook.local:/Users/tokuda/NetBSD/s/20070525/src/sys/arch/mpc860/compile/MPC860
total memory = 16384 KB
avail memory = 13964 KB
mainbus0 (root)
cpu0 at mainbus0: 860 (Revision 0)
pbus0 at mainbus0
scc0 at pbus0: vec 9 (console)
fec0 at pbus0: vec 7 address 00:80:6d:47:29:d5
tqphy0 at fec0 phy 1: 78Q2120 10/100 media interface, rev. 11
tqphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
sce0 at pbus0: vec 9 address 00:80:6d:47:29:d6
obus0 at mainbus0
wdc0 at obus0: vec 8 addr 0x80000010
atabus0 at wdc0 channel 0
wd0 at atabus0 drive 0: <HITACHI_DK23AA-12>
wd0: 11513 MB, 23392 cyl, 16 head, 63 sec, 512 bytes/sect x 23579136 sectors
boot device: fec0
root on fec0
nfs_boot: trying DHCP/BOOTP
nfs_boot: BOOTP next-server: 192.168.100.32
nfs_boot: my_name=obs.tokuda.net
nfs_boot: my_addr=192.168.100.60
nfs_boot: my_mask=255.255.255.0
root on mini:/usr/MPC860
root file system type: nfs
warning: no /dev/console
panic: init died (signal 0, exit 12)
Stopped in pid 1.1 (init) at    netbsd:cpu_Debugger+0x14:       addi    1,1,16
db> 
db> bt
at panic+1cc
at exit1+874
at sys_exit+5c
at syscall_plain+14c
at cpu_switchto+750
db> 

久しぶりにmpc860完走
2007/10/01(月) 9:16 NetBSD はてブ情報 はてブに登録 はてブ数

先週から取り組んできたけど、やっと完走しました。

久しぶりすぎる。

ユーザランドまで動けばいいな。