Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Feb 2008 07:45:58 -0500
From:      "Zhao, Ning" <NZ182401@ncr.com>
To:        <freebsd-mips@freebsd.org>
Subject:   RE: FreeBSD/MIPS project status update
Message-ID:  <E39B8E49B309CE47A0898D6C77DDCCDD0270793A@susday2540.corp.ncr.com>

next in thread | raw e-mail | index | archive | help
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: <memory>
null: <null device, zero device>
nexus0: <MIPS32 root nexus>
clock0: <Generic MIPS32 ticker> on nexus0
nexus_alloc_resource: entry (0x80683180, 0x80684d00, 1, 0x8044d350, 0x5,
0x5, 1, 2)
nexus_alloc_resource: requested rid is 0
clock0: [FILTER]
gt0: <GT64120 chip> on nexus0
pcib0: <GT64120 PCI bridge> on gt0
nexus_alloc_resource: entry (0x80683180, 0x80684b80, 1, 0x8044d2a0, 0,
0, 1, 6)
nexus_alloc_resource: requested rid is -2142952456
pcib0: [FILTER]
pci0: <PCI bus> 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: <bridge, PCI-ISA> at device 9.0 (no driver attached)
atapci0: <Intel PIIX4 UDMA33 controller> port
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376 at device 9.1 on pci0
ata0: <ATA channel 0> 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 <ExcCode=3D2,IPSW=3D0,IPHW=3D0,CE=3D0>
status              =3D 0x20000002 <CU=3D2,IM=3D0,EXL>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E39B8E49B309CE47A0898D6C77DDCCDD0270793A>