FreeBSD/MIPS project status update

Zhao, Ning NZ182401 at ncr.com
Fri Feb 15 05:05:06 PST 2008


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:

================
$ ~/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=100, UDP=100)
        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 = 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=0x8046fd20)
------------------------------------------------------------------------
-------

entry: platform_start()
cmd line: kernel  
envp:
        memsize = 0x04000000
        yamonrev = 02.06
memsize = 04000000
  picache_stride    = 4096
  picache_loopcount = 4
  pdcache_stride    = 4096
  pdcache_loopcount = 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
 
mymtom at 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=-2142962040, physical bus=0
found-> vendor=0x11ab, dev=0x4620, revid=0x02
        domain=-2142962040, bus=0, slot=0, func=0
        class=06-00-00, hdrtype=0x00, mfdev=0
        cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
found-> vendor=0x8086, dev=0x7110, revid=0x01
        domain=-2142962040, bus=0, slot=9, func=0
        class=06-01-00, hdrtype=0x00, mfdev=1
        cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords)
        lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
found-> vendor=0x8086, dev=0x7111, revid=0x01
        domain=-2142962040, bus=0, slot=9, func=1
        class=01-01-80, hdrtype=0x00, mfdev=0
        cmdreg=0x0003, statreg=0x0000, cachelnsz=0 (dwords)
        lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (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     = 0x80000020
return address      = 0x80156424
bad virtual address = 0
cause               = 0x8008 <ExcCode=2,IPSW=0,IPHW=0,CE=0>
status              = 0x20000002 <CU=2,IM=0,EXL>
current thread      = 0x8046b5a0
current process     = 0 (kernel)
TODO: mips dyntrans alignment exception, size = 4, addr =
0000000020000002, pc = ffffffff80000020
================

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:
================
[ 8259: TODO: Level triggered (MCA bus) ]
[ 8259: WARNING: Bit 2 set ]
[ 8259: TODO: Level triggered (MCA bus) ]
[ 8259: WARNING: Bit 2 set ]
================

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:
================
--- 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);
================

I think the third parameter is for bus_space_write_1 is PIC_OCW1(1) and
PIC_OCW3(0).


Thanks & Best Regards,
mymtom


More information about the freebsd-mips mailing list