From owner-freebsd-mips@FreeBSD.ORG Fri Feb 15 13:05:06 2008 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D92C16A418 for ; Fri, 15 Feb 2008 13:05:06 +0000 (UTC) (envelope-from NZ182401@ncr.com) Received: from ncrusout3.NCR.COM (tan25.ncr.com [192.127.94.25]) by mx1.freebsd.org (Postfix) with ESMTP id 16F5513C459 for ; Fri, 15 Feb 2008 13:05:05 +0000 (UTC) (envelope-from NZ182401@ncr.com) Received: from susday2540.corp.ncr.com (localhost [127.0.0.1]) by ncrusout3.NCR.COM (8.13.8/8.13.8) with ESMTP id m1FClWlg025887 for ; Fri, 15 Feb 2008 07:47:32 -0500 (EST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 15 Feb 2008 07:45:58 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: RE: FreeBSD/MIPS project status update Thread-Index: Achv0LY4+eINkI53Rr6mUnBX3/n4uA== From: "Zhao, Ning" To: Subject: RE: FreeBSD/MIPS project status update X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2008 13:05:06 -0000 Hi All, I am interested in FreeBSD MIPS and trying to build a kernel and load it on gxemul 0.4.1, failed with the following message: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D $ ~/bin/gxemul -e malta -C 4Kc -d /dev/null kernel GXemul 0.4.1 Copyright (C) 2003-2006 Anders Gavare Read the source code and/or documentation for other Copyright messages. Simple setup... net: simulating 10.0.0.0/8 (max outgoing: TCP=3D100, UDP=3D100) simulated gateway: 10.0.0.254 (60:50:40:30:20:10) using nameserver 192.168.157.2 machine "default": memory: 64 MB cpu0: 4Kc (I+D =3D 16+16 KB) machine: MALTA (evbmips, little endian) bootstring: kernel diskimage: /dev/null IDE DISK id 0, read/write, 0 MB (0 sectors) loading kernel starting cpu0 at 0x80129820 (gp=3D0x8046fd20) ------------------------------------------------------------------------ ------- entry: platform_start() cmd line: kernel =20 envp: memsize =3D 0x04000000 yamonrev =3D 02.06 memsize =3D 04000000 picache_stride =3D 4096 picache_loopcount =3D 4 pdcache_stride =3D 4096 pdcache_loopcount =3D 4 Installing exception vector: [0x80000000..0x80000080] <- [0x803f7998..0x803f7a14] Exception vector at 80000000 almost out of space Installing exception vector: [0x80000080..0x80000100] <- [0x803f7a88..0x803f7aa0] Installing exception vector: [0x80000100..0x80000180] <- [0x803f78bc..0x803f78d4] Installing exception vector: [0x80000200..0x80000280] <- [0x803f77e0..0x803f7818] Installing exception vector: [0x80000180..0x80000200] <- [0x803f77e0..0x803f7818] Physical memory chunk(s): 0x478f80 - 0x3ffffff, 62419072 bytes (15239 pages) Kernel page table maps 16384 4K pages and is 511K [ yamon_emul(): syscon: TODO ] Copyright (c) 1992-2007 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #3: Thu Feb 14 02:55:53 CST 2008 =20 mymtom@freebsd8.mymtom.cn:/usr/home/mymtom/obj/mips/usr/home/mymtom/src/ FreeBSD/p4/mips2/src/sys/MALTA cpu0: MIPS Technologies processor v1.128 MMU: Standard TLB, 16 entries L1 i-cache: 2 ways of 512 sets, 16 bytes per line L1 d-cache: 2 ways of 512 sets, 16 bytes per line nfslock: pseudo-device mem: null: nexus0: clock0: on nexus0 nexus_alloc_resource: entry (0x80683180, 0x80684d00, 1, 0x8044d350, 0x5, 0x5, 1, 2) nexus_alloc_resource: requested rid is 0 clock0: [FILTER] gt0: on nexus0 pcib0: on gt0 nexus_alloc_resource: entry (0x80683180, 0x80684b80, 1, 0x8044d2a0, 0, 0, 1, 6) nexus_alloc_resource: requested rid is -2142952456 pcib0: [FILTER] pci0: on pcib0 pci0: domain=3D-2142962040, physical bus=3D0 found-> vendor=3D0x11ab, dev=3D0x4620, revid=3D0x02 domain=3D-2142962040, bus=3D0, slot=3D0, func=3D0 class=3D06-00-00, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0003, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 = ns) found-> vendor=3D0x8086, dev=3D0x7110, revid=3D0x01 domain=3D-2142962040, bus=3D0, slot=3D9, func=3D0 class=3D06-01-00, hdrtype=3D0x00, mfdev=3D1 cmdreg=3D0x0003, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x40 (1920 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 = (0 ns) found-> vendor=3D0x8086, dev=3D0x7111, revid=3D0x01 domain=3D-2142962040, bus=3D0, slot=3D9, func=3D1 class=3D01-01-80, hdrtype=3D0x00, mfdev=3D0 cmdreg=3D0x0003, statreg=3D0x0000, cachelnsz=3D0 (dwords) lattimer=3D0x00 (0 ns), mingnt=3D0x00 (0 ns), maxlat=3D0x00 (0 = ns) uart0: <8250 or 16450 or compatible> on obio0 uart0: [FILTER] uart0: fast interrupt uart0: console (115200,n,8,1) pci0: at device 9.0 (no driver attached) atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376 at device 9.1 on pci0 ata0: on atapci0 atapci0: Reserved 0x8 bytes for rid 0x10 type 4 at 0x1f0 atapci0: Reserved 0x1 bytes for rid 0x14 type 4 at 0x3f6 Fatal trap type 2 in kernel mode: (TLBL) TLB (fetch) program counter =3D 0x80000020 return address =3D 0x80156424 bad virtual address =3D 0 cause =3D 0x8008 status =3D 0x20000002 current thread =3D 0x8046b5a0 current process =3D 0 (kernel) TODO: mips dyntrans alignment exception, size =3D 4, addr =3D 0000000020000002, pc =3D ffffffff80000020 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I try to build the kernel on FreeBSD 8.0-CURRENT and FreeBSD 6.2-RELEASE and load kernel on gxemul 0.4.1 and gxeuml 0.4.6.2 the result remain the same. The source code is from http://kanar.ci0.org/mips2.tar.gz by following the link: http://lists.freebsd.org/pipermail/freebsd-mips/2007-March/000165.html, and the build script is from http://wiki.freebsd.org/FreeBSD/mips I have try to find the what cause this problem, but failed. But found some problem in gt_pci.c, which cause the gxemul message: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [ 8259: TODO: Level triggered (MCA bus) ] [ 8259: WARNING: Bit 2 set ] [ 8259: TODO: Level triggered (MCA bus) ] [ 8259: WARNING: Bit 2 set ] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I compared gt_pci.c to NetBSD 4.0's pcib.c (sys/arch/evbmips/malta/pci/pcib.c, __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.12 2006/05/12 10:58:12 tsutsui Exp $")). According to pcib.c line 207 to line 239, I modify as the following: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/mips/mips32/malta/gt_pci.c.orig 2007-08-27 00:16:45.000000000 +0800 +++ sys/mips/mips32/malta/gt_pci.c 2008-02-13 20:54:19.000000000 +0800 @@ -285,15 +285,15 @@ ICW4_8086); /* mask all interrupts */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, + bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, sc->sc_imask & 0xff); /* enable special mask mode */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, OCW3_SEL | OCW3_ESMM | OCW3_SMM); /* read IRR by default */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, --- sys/mips/mips32/malta/gt_pci.c.orig 2007-08-27 00:16:45.000000000 +0800 +++ sys/mips/mips32/malta/gt_pci.c 2008-02-13 20:54:19.000000000 +0800 @@ -285,15 +285,15 @@ ICW4_8086); /* mask all interrupts */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, + bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, sc->sc_imask & 0xff); /* enable special mask mode */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, OCW3_SEL | OCW3_ESMM | OCW3_SMM); /* read IRR by default */ - bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 1, + bus_space_write_1(sc->sc_pciio, sc->sc_ioh_icu1, 0, OCW3_SEL | OCW3_RR); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D I think the third parameter is for bus_space_write_1 is PIC_OCW1(1) and PIC_OCW3(0). Thanks & Best Regards, mymtom