From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPyEA-0007yt-Nx for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:27:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPyE6-0005vM-I8 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:27:18 -0400 Received: from smtp.codeaurora.org ([198.145.11.231]:35979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPyE6-0005uu-9a for qemu-devel@nongnu.org; Fri, 05 Sep 2014 14:27:14 -0400 Message-ID: <540A007D.6090500@codeaurora.org> Date: Fri, 05 Sep 2014 14:27:09 -0400 From: Christopher Covington MIME-Version: 1.0 References: <5408AC44.3000701@codeaurora.org> <5409EB5C.1060407@huawei.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] HelloWord kernel for qemu-system-aarch64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Semion Prihodko Cc: Claudio Fontana , QEMU Developers On 09/05/2014 01:52 PM, Semion Prihodko wrote: > This is tricky to deepen in this large code base. It looks strange that > there's no simple concrete tutorial like we have for all other CPU > architectures (e.g. in osdev.org ). AArch64 hasn't really changed the PL011 UART (nor GIC, nor VirtIO-MMIO, n= or semihosting, although maybe DCC a little) as far as I recall. The UART functions from the following article are probably reusable. http://wiki.osdev.org/ARM_Integrator-CP_IRQTimerAndPIC Among other things, AArch64 is pretty new compared to the other architect= ures on osdev.org. If you get something going, maybe you can write the tutoria= l. Christopher > 05 =D0=A1=D0=B5=D0=BD 2014 =D0=B3. 19:57 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7= =D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Claudio Fontana" > > =D0=BD= =D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: >=20 > On 05.09.2014 16 :50, Semion Prihodko wrote: > > Let's discard semihosting. I have aarch64-linux-gnu-* toolchain a= nd > > qemu-system-aarch64 emulator. How can I build a minimal kernel wh= ich > > outputs Hello World! via serial port and run it on the emulator? > > >=20 > If you run qemu with the "virt" platform, you can write to the UART= at > 0x9000000 > to get a character out, works very early. >=20 > You could check the AArch64 port of the OSv Operating System, has a= simple > boot loader > you can look at (arch/aarch64/preboot.S and arch/aarch64/boot.S) > and the pl011 device you find in drivers/pl011.cc >=20 > https://github.com/cloudius-systems/osv/wiki/AArch64 >=20 > Good luck, >=20 > Claudio >=20 > > > > 2014-09-04 21:15 GMT+03:00 Christopher Covington >: > > > >> Hi Semion, > >> > >> On 09/04/2014 09:40 AM, Semion Prihodko wrote: > >>> Still don't know how to build/run a simple Hello World kernel o= n > >>> qemu-system-aarch64? > >>> > >>> Guys, this is a very basic thing, please provide concrete steps= . Thanks. > >> > >> Here you go. Start at the wget. > >> > >> http://lists.gnu.org/archive/html/qemu-devel/2014-07/msg03487.ht= ml > >> > >> Angel semihosting isn't implemented upstream so a text hello wor= ld won't be > >> trivial, although given enough time it should be possible to imp= lement > >> Angel > >> semihosting for A64 in QEMU, implement DCC in QEMU and Newlib/li= bgloss or > >> implement PL011 UART or VirtIO-MMIO console in Newlib/libgloss. > >> > >> Some of the bootloaders and firmwares out there (bootwrapper, AR= M trusted > >> firmware, UEFI/Tianocore) may have examples of using the PL011 U= ART. > >> > >> Christopher > >> > >> -- > >> Employee of Qualcomm Innovation Center, Inc. > >> Qualcomm Innovation Center, Inc. is a member of Code Aurora Foru= m, > >> hosted by the Linux Foundation. > >> >=20 --=20 Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by the Linux Foundation.