From owner-freebsd-arm@freebsd.org Tue Dec 27 21:48:22 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F3AC941EB for ; Tue, 27 Dec 2016 21:48:22 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12FDE1FCC for ; Tue, 27 Dec 2016 21:48:22 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id c13so194424520lfg.0 for ; Tue, 27 Dec 2016 13:48:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=D8R8aXM/hT8LGIhIW///awoST/XzNG95PcGDlDpQ4Xw=; b=o2/Y/h48IFRrQdlKMMh8iU3xFQobam3jNcS6684NsI5Y06Baaq5KDTCoKqZOt6Pgtf hxEeRGYzE18F+UBhXePLRl4ms8FncsNbMQNcBXQfillGQgdd+YE9Mv3CnVhghmM6dYNJ W9EJp+DVU6ctNJ6cQd+TdtI/+imwzB0FzswWMgSPCP6CPVbCGbfh+WDBfh3OsRUmSzoD +B9Lblj45AqayZwjWB+MvS0xcUCohNYiYs7TxuOjfxOhcX43/i4W4ymmeitM5sQtDS4w c2VmLqo9ULxxIfbxfE55poRsrFRs4IHxJQKf1NQrMqWRFg8yo+YWNbLVOKs96B92Tows 6lBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=D8R8aXM/hT8LGIhIW///awoST/XzNG95PcGDlDpQ4Xw=; b=pUmjqnyYr3zJOPBnlyxS6haRpu2H++Nuo9j4oxT1cdSp8sBPbx1KqLXSpgvQGo3G+v a89YgioRS/6byF8kDLAu99Di4hmxdI9kxVoJ8I0LaAO87H/maOc6fFHZcn9HLoIr1+tn CkPVc/gp++Cd8v8iEqcaF08nMmtn8+8w5pXvvuIvJ0zXCTYwvPIntdhqfLS00PsvajyB d4f/nYjhFzvlVL37ortV3+dCF3xBNi/s84P4E23TM2T1VyVNQ2FTMtgksfjAWJ/gCZK/ BRhENuohIVFxfBOkKh8isvjDZ83iTXS6quhgPKUvmJ4tP5i6RnfBo2hYpViqqHeR95Fs 9g2w== X-Gm-Message-State: AIkVDXIc93qtDjltsiQpldy2w89o9/cjRq+LBgRSSwkiZ6atPNXCXkPZe6GWFX/ZQUbxlw3bcb9nj8wvDWqIew== X-Received: by 10.46.72.18 with SMTP id v18mr12112476lja.12.1482875296715; Tue, 27 Dec 2016 13:48:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.0.194 with HTTP; Tue, 27 Dec 2016 13:48:16 -0800 (PST) From: Jason Harmening Date: Tue, 27 Dec 2016 13:48:16 -0800 Message-ID: Subject: loading 'VIRT' kernel in qemu To: freebsd-arm@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 21:48:22 -0000 Hi everyone, I'm making some tweaks to the armv6 pmap to mirror some recent i386 changes. I don't have arm hardware readily available, so I thought I'd give qemu a whirl instead of asking other people to test my changes for me. Since I need SMP but don't need any specific peripheral hw, the 'VIRT' kernel seems like my best bet. I've successfully booted mips[64] under qemu, so naively starting out w/ the same steps I use for mips: 1). build armv6 world and VIRT kernel, install world to temp directory 2). use makefs(8) to build a 4GB (little endian) fs image from temp dir 3). Run qemu: qemu-system-arm -M virt -kernel -hda -nographic -m 1024 ...fails immediately: qemu: fatal: Trying to execute code outside RAM or ROM at 0xc1000100 R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=00000000 R14=00000000 R15=c1000100 hmm, looks pretty close to KERNVIRTADDR. Most online docs for qemu-system-arm seem to assume a prebuilt linux kernel and initrd, the rest are...fragmented-to-nonexistent. I've seen a few hints that I might need to wrap the kernel image up along w/ u-boot, but the u-boot images seem to be very SoC-specific. Any help would be much appreciated, sorry for the n00b question. Thanks, Jason