From owner-freebsd-mips@FreeBSD.ORG Wed Jul 11 02:46:24 2012 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 0D73F106566B for ; Wed, 11 Jul 2012 02:46:24 +0000 (UTC) (envelope-from ambrosehua@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 95D0E8FC08 for ; Wed, 11 Jul 2012 02:46:23 +0000 (UTC) Received: by weyx56 with SMTP id x56so528943wey.13 for ; Tue, 10 Jul 2012 19:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=raWNGM6C11bxcvGN7aAwtXJnIsTtYTso8bbnK2COOtg=; b=emQLuM6xcpxZ6EoG5bQ1F23sT5iahlfuysqW6O4R0UoMSS3cIE683m+cyOwTrGyc6C SY0+m5vmxkhtmYh770TxL00nb9R0NorxeE81ZRtJAHMBNDYSqgVlAZ+MX9Kp8LNTMUTj lwFovQIyGnLMDCQ4ApEpF970mBIglbEApCkI4+dbk/Wg3My4wM1JP8UW5vzdsjhJCsdu /tW1a3OMKoZIHdty4JxiVqOpVwqPaHcxgyqfxFOn7KpH17wkT+IJMnZ4WniroIXcJHot eYGdOcq8GGsRux3er/hy6jRcmi/Leb0gNvj6ec0rQammUBc6C2Ruguy7XkxJ3V5rPYbR 16TA== MIME-Version: 1.0 Received: by 10.180.98.228 with SMTP id el4mr25946572wib.17.1341974782379; Tue, 10 Jul 2012 19:46:22 -0700 (PDT) Received: by 10.223.144.216 with HTTP; Tue, 10 Jul 2012 19:46:22 -0700 (PDT) Date: Wed, 11 Jul 2012 10:46:22 +0800 Message-ID: From: Paul Ambrose To: freebsd-mips@FreeBSD.org Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Cc: Subject: Porting FreeBSD to Loongson 3A (RS780e) 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: Wed, 11 Jul 2012 02:46:24 -0000 I received my Loongson 3A box(http://www.lemote.com/products/computer/fulong/348.html) 9 days ago. It has Loongson 3A processor, 4 cores at 900Mhz( 64KB L1D + 64KB L1I per-core and 4MB L2 cache shared=A3=A9 , MIPS64r2 with GS64 SIMD extension and pre-installed with a RHEL6-derived distribution. The hardware configuration is here: CPU: 4 GS64 cores, 900Mhz, mips64r2-compatible; MEM: 2x 2GB DDR3 800Mhz; chipset=A3=BA AMD RS780e + SB710=A3=BB Hardrive=A3=BA320GB sata2 x1 =A3=A8 2 SATA SLOT=A3=A9=A3=BB Etherent=A3=BA relteak 8168=A3=BB Display=A3=BA built-in Radeaon 3200 with 128MB mem supporting DVI + VGA=A3= =BB Bios: PMON I did some test and some research, it seems stable, so I want to port FreeBSD to this box. Now I have a few question. No.1: Does freebsd mips toolchain support mips64r2 with little-endian? the source code indicate that there is only one mips64 little-endian board, MALTA64, other mips64 board are big-endian, Loongson 3A only support little-endian and 64bit-address. No.2: I cross-build malta64 on my x86-box, I have no idea whether malta64 use ldscript.mips or ldscript.mips.mips64, and where is the kernel image loaded? [ambrosehua@lateaxfreebsd MALTA64] readelf -h kernel ELF Header: Magic: 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00 Class: ELF64 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - FreeBSD ABI Version: 0 Type: EXEC (Executable file) Machine: MIPS R3000 Version: 0x1 Entry point address: 0x80001160 Start of program headers: 64 (bytes into file) Start of section headers: 5103792 (bytes into file) Flags: 0x60000001, noreorder, mips64 Size of this header: 64 (bytes) Size of program headers: 56 (bytes) Number of program headers: 5 Size of section headers: 64 (bytes) Number of section headers: 27 Section header string table index: 24 and Where does this 0x80001160 come from? If this 0x80001160 is from KERNLOADADDR(0X80001000)+SIZEOF_HEADERS, where is SIZEOF_HEADERS?