From owner-freebsd-current@freebsd.org Thu Sep 21 03:14:46 2017 Return-Path: Delivered-To: freebsd-current@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 1CC7DE0DFE3 for ; Thu, 21 Sep 2017 03:14:46 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id ED38265C1B for ; Thu, 21 Sep 2017 03:14:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id EC165E0DFDF; Thu, 21 Sep 2017 03:14:45 +0000 (UTC) Delivered-To: current@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 EB897E0DFDE for ; Thu, 21 Sep 2017 03:14:45 +0000 (UTC) (envelope-from asomers@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 6C9B565C1A for ; Thu, 21 Sep 2017 03:14:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id l196so4508177lfl.1 for ; Wed, 20 Sep 2017 20:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=x2Q9FYF9JawJtYHsElSFQ5NMnQO3b8J9h9CnpnvHlIw=; b=lxE9+bc4qA/UOsn3nrIo8fwGNuVV9zZm8pk3JEMbxUOyQyA629bLWBtgrOFoUsUD07 WfbtxxZXJBqAmxapeyytoGY1NsmoQUuFPdB2nqmHGHgNSyhiW99y2YMlIddPnq/zRM2f P5e5vf0s6koxcY1XJshxFILut+rJ8PrbBFAin1jhYH1qwv1rkTXOAsfE1VmzC1ojpUJ3 NtzWR20f0nydXG0qIOip9H6IddkP0Pu1zVO3NdocfxGVBBUAS+kIkdby8cJHnp8OZ8bI 7kPAS4J8J5IxNCH6f2iT+gBI2BsfGtLG7sWevqrdZOcmKR/yDe8wryq31mwM7hQVP8l0 cwEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=x2Q9FYF9JawJtYHsElSFQ5NMnQO3b8J9h9CnpnvHlIw=; b=rdRZx6D4clP0xqFILBamxn/n5Ghmkf5E+fZaaXCUAIoUtXzB1gglNIfK+wIMzbcNUL VXTJt6ZT4TPEql/1k1gQb5PstQTyde2kAhT51px9xNHltVrBvdTubOiUSVCeAGcPyRAI dDp0cqKyBFCIWAn8KhL8sHCKUlEDsIXaMfyKX37weJYGdndVXxadMTtr0x2PotmleSlL GIRGcgFI2jh87/5jBDxGlRaoz+MZlFIomb0n4JTRbMcYaoaIQYUAwTieO46CBmuEABhn V3uQXS4NkvtY7jpCAtPabdAOPtNXJajJZ2b5yyBRVNwp24L8O5qJxEDxoToqmqr6q3Gf wu+w== X-Gm-Message-State: AHPjjUhluRzutLSa1ApKcgzcELjQRHE3Ea0sM4lu81M0Fbuvk/rARepy Bc+W5bfL5T/LhVkvJb3Dj1NgacHwTwOWPVKAD0QSSQ== X-Google-Smtp-Source: AOwi7QDUottKywPkN643VJs9P5hIdZmVQG7e/w3KsiSaR1XnE31uChWPdX5ilqOZezHNjcg5itFTsfd+pyCjsGIH3qA= X-Received: by 10.46.27.6 with SMTP id b6mr311830ljb.123.1505963683142; Wed, 20 Sep 2017 20:14:43 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.26.6 with HTTP; Wed, 20 Sep 2017 20:14:42 -0700 (PDT) In-Reply-To: References: From: Alan Somers Date: Wed, 20 Sep 2017 21:14:42 -0600 X-Google-Sender-Auth: 2o8LdKGzZrjxdDv06kU_QhnceLg Message-ID: Subject: Re: Pre-filled RAM disk. To: Jon Brawn Cc: "current@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 03:14:46 -0000 On Wed, Sep 20, 2017 at 8:50 PM, Jon Brawn wrote: > Wotcha! > > I work for Arm for my sins, and in my spare time I=E2=80=99ve been playin= g with FreeBSD. In my day job I work with the CPU core validation team, and= one of the things we do is take the hardware design of a new core and run = it on a machine called an emulator. This emulator isn=E2=80=99t the same th= ing as QEMU, nor is it just an FPGA, it=E2=80=99s something in the middle -= you compile the hardware design and download it to the emulator, and it ca= n then run programs on your design at about 1MHz. Which is lovely. Our main= bread and butter is to take such a design and get it to boot Arm Linux, a = very cut down version, and then run some tests hosted in the Linux environm= ent. These tests would typically thrash the snot out of some particular asp= ect of the architecture, such as memory sharing amongst multiple processor = cores. Now, we would like to use other operating systems that behave differ= ently to Linux, there are some obvious candidates that I=E2=80=99m not goin= g to talk about for legal reasons, but one that was suggested was using Fre= eBSD under emulation. > > So, what is needed is someway of telling the operating system that it is = going to use a ram disk for its root filesystem, and that the ram disk is g= oing to be at a fixed physical address in the memory map. That way we can p= re-load root from a file in the emulation environment. In the Linux environ= ment we would package the kernel, it=E2=80=99s DRB and the root filesystem = memory image inside a light-weight bootloader wrapper, load that at the rig= ht offset into the emulator=E2=80=99s memory map, and twang the virtual res= et line of the emulated processor. There=E2=80=99s some magic jiggery poker= y to get console output from what the OS thinks is an AMBA UART, but that= =E2=80=99s about size of it. > > So, what does FreeBSD have to offer in the way of ramdisk functionality? > > Jon. Cool project! There is something called MFSBSD which is basically exactly what you want. It creates a small ramdisk and boots from that. It's often used for stuff like booting from PXE, CD, or USB. I don't know if you can force it to be located at a specific memory address, though. It's normally used in combination with a bootloader. http://mfsbsd.vx.sk/ -Alan