From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, LOTS_OF_MONEY,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2169 invoked from network); 31 Aug 2023 18:47:25 -0000 Received: from tb-ob21.topicbox.com (173.228.157.67) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2023 18:47:25 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob21.topicbox.com (Postfix) with ESMTP id 4D8A5285C0 for ; Thu, 31 Aug 2023 14:47:21 -0400 (EDT) (envelope-from bounce.mM2edf6c6413ee49aaee761281.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id F24A523B538D; Thu, 31 Aug 2023 14:47:20 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:from:date:in-reply-to :mime-version:content-type:content-transfer-encoding:list-help :list-id:list-post:list-subscribe:reply-to:list-unsubscribe; s= sysmsg-1; t=1693507640; bh=R/zdIcYFZ3rCLR7hLTTs6klP44ndXM70AXJwI UpRyqo=; b=OW1JzRy9YuxNNYF+GJEv/DMI49an3ftHeUcgnjjvKqpOV+714ede4 lvb7IN8YxRyMUX2vhb0zs+2nMyv7RftftLQJMyrWTrZP1JTDagf0mzBsBMCZIYPi U4UqE3kaQnXj62FoBg9DXJ8LQ1UzsVpKbUV+HTb/MB0n/KIXKsZkVI= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1693507640; b=PMbjR1nbM8KKhL1oOpGBLyQzyID+eXwD0gTs6Svy4/2RYDDaDp kMy8oQL7H0Ej9fKo4na/N25uh1Qk1iaWoqn5LIHPtaevEk84o/1SaA8uFMyPpKh3 SgaDHLzk/HrpkmIzanBnpunnU1OWKku1ehLZqLv4RGa9TwBsKzHwAKA8Y= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; iprev=pass smtp.remote-ip=46.235.227.24 (mx2.mythic-beasts.com); spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-aligned-from=domain_pass (Domain match); x-me-sender=none; x-ptr=pass smtp.helo=mx2.mythic-beasts.com policy.ptr=mx2.mythic-beasts.com; x-return-mx=pass header.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-return-mx=pass smtp.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=message-id :to:subject:from:date:in-reply-to:mime-version:content-type :content-transfer-encoding:list-help:list-id:list-post :list-subscribe:reply-to:list-unsubscribe; s=dkim-1; t= 1693507640; x=1693594040; bh=slrrnRNj+2JgoUZRd2bkZ9QMfJKZlDwns9x dc2kEv7g=; b=qGccp6BAaSMEiIfaujpV/VXhN4waOz1tDPnE7b/eyVvCIK3xeDS ZmEY/XVuHfl9SPTYgwdreRBbyZ1n8hEnyzXEPlvXtiMzOws/v6Eo0aMaMW51h8RF Ipb3RhwR2zQrNUd0NAzcFl6sSznUNm0OYHkN3PvTN4ofr6wBt4hNo+2Y= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 9BEC7277F1EA for <9fans@9fans.net>; Thu, 31 Aug 2023 14:47:10 -0400 (EDT) (envelope-from miller@hamnavoe.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 1A0B91949AE; Thu, 31 Aug 2023 14:47:10 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1693507630; b=INY/7cFCy2VrpZhSksRStRLOwzG+PFweK0wBRs5g13xbPP7Hmh dagMyiNMa/MM+COjcQrioeKtuqOEd8nWzmZs8ZZU7UCk4aR1TxSqTxsIwBYVwVOG f5y6/fnUycYg0UagRArPoX/lFbKWW4TdRMmEBHJfKmqDvPcGSeRqto/JT5yk/nnn vdUZ5fTjSFEISsOLDoVhMFHs32qsgy+rof58JPbaT3jtlSH4o3LaMSqk+ra9yjP2 tgoJbZqB2Qb8jpPr0aDcFG3XVA5vy6A23o+pEi/ftLBPgePZO9dM7icfI//f4WV/ axh6xR/KHreJVLrPwDVCEmEzbmSGCdSwdo6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=message-id:to:subject:from:date:in-reply-to :mime-version:content-type:content-transfer-encoding; s=arcseal; t=1693507630; bh=+QhOfj27E6jives/ACoWx3t+hYYPOY2dLj3OY3JpJwA=; b= p6Vx8uLALqcBM20iadRYyIv8+QlIXeVp3Dvl2P3ZMrd5AK3ImSVItSjz62wEypr2 TSEvk5RmNE9XVtIHuoo5bzdbGRK43MzS4GaTyebEEoMluX3Giwu8yKEKQrBFPuSa xs3yHAAIbqv38mO3/ZVbZWNIt6SNqG1J+oXOUu+WeSSBjE+KiDBTfnsoPVlAEnEd nkiZIi+2rCklaZWVgHHV2T8QUbmtitGJOe6p6FKBBhenYwDdS4mzuHlPxA4QYUAN lfhM8wcAc+vfyER8ywEFuAdqJthB0Ep+Kf4saUDT2i0OCY4cEUfk5jwwYvxZHTtC 0Of3cbDUyUFPD/DjjPrz8w== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC did not pass); dkim=none (no signatures found); dmarc=none policy.published-domain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,d=none,d.eval=none) policy.policy-from=p header.from=hamnavoe.com; iprev=pass smtp.remote-ip=46.235.227.24 (mx2.mythic-beasts.com); spf=pass smtp.mailfrom=miller@hamnavoe.com smtp.helo=mx2.mythic-beasts.com; x-aligned-from=domain_pass (Domain match); x-me-sender=none; x-ptr=pass smtp.helo=mx2.mythic-beasts.com policy.ptr=mx2.mythic-beasts.com; x-return-mx=pass header.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-return-mx=pass smtp.domain=hamnavoe.com policy.is_org=yes (MX Records found: mx1.mythic-beasts.com,mx2.mythic-beasts.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedviedrudegtddgudeftdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkffvuf fhffgjgggtgfesthekjhdttddtjeenucfhrhhomheptfhitghhrghrugcuofhilhhlvghr uceolehfrghnsheshhgrmhhnrghvohgvrdgtohhmqeenucggtffrrghtthgvrhhnpedutd duffefleekgedtheektedtffeggeelleejgefhieetleejtdethfffledukeenucfkphep geeirddvfeehrddvvdejrddvgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epihhnvghtpeegiedrvdefhedrvddvjedrvdegpdhhvghlohepmhigvddrmhihthhhihgt qdgsvggrshhtshdrtghomhdpmhgrihhlfhhrohhmpeeomhhilhhlvghrsehhrghmnhgrvh hovgdrtghomheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (hamnavoe.com: Sender is authorized to use 'miller@hamnavoe.com' in 'mfrom' identity (mechanism 'include:_spf.mythic-beasts.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="miller@hamnavoe.com"; helo=mx2.mythic-beasts.com; client-ip=46.235.227.24 Received: from mx2.mythic-beasts.com (mx2.mythic-beasts.com [46.235.227.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Thu, 31 Aug 2023 14:47:09 -0400 (EDT) (envelope-from miller@hamnavoe.com) Received: by mailhub-hex-d.mythic-beasts.com with esmtpsa (TLS1.2) tls TLS_RSA_WITH_AES_256_CBC_SHA (Exim 4.94.2) (envelope-from ) id 1qbmhA-00AJZA-Ca for 9fans@9fans.net; Thu, 31 Aug 2023 19:47:08 +0100 Message-ID: To: 9fans@9fans.net Subject: Re: [9fans] RPi in QEMU From: Richard Miller <9fans@hamnavoe.com> Date: Thu, 31 Aug 2023 19:47:06 +0100 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BlackCat-Spam-Score: 1 Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: cd8a2350-482e-11ee-ba38-d97bff8b7b06 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNWRhNTQ2NzA5N2U0ZWFiMi1NMmVkZjZjNjQxM2VlNDlhYWVlNzYx?= =?UTF-8?B?MjgxPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M2edf6c6413ee49aaee761281:1:7p-J05Qo1PGBSqbXbjtfqcu2SYVtix1-P5RHxVgR5Ls don.bailey@gmail.com: > So to get this back on the track of RPI emulated in QEMU =E2=80=A6 has an= yone successfully used the Miller image with Q? After a bit of experimentation, I have done so, for some value of "successf= ully". A few tweaks are required first, because QEMU's emulation of Pi hardware and firmware is not as faithful as it might be: - binary kernel file is loaded at 0x10000, not 0x8000 - the watchdog timer doesn't work (or isn't there) - system timer behaviour is a bit peculiar - emulation of the SDMMC in multi-block mode is spectacularly slow (transfers take not milliseconds but seconds) After tweaking as shown below, a QEMU-compatible kernel can be built with mk CONF'=3D'pi2 9pi2.qemu and run with something like qemu-system-arm -M raspi2b -kernel 9pi2.qemu -serial stdio \ -drive file=3D9pi.img,if=3Dsd,format=3Draw \ -append 'readparts=3D1 console=3D1 *ncpu=3D1 nobootprompt=3Dlocal!/dev/= sdM0/fossil' For convenience I've put a kernel file on /n/sources/contrib/miller/9pi2.qe= mu However ... - the DWC usb host adapter of the Pi2/3 does not work the way Plan 9 expects - therefore there's no functioning usb - therefore I don't know how to attach a keyboard, mouse or network interfa= ce If anybody wants to debug this further I'm happy to collaborate, but I'm not sufficiently motivated to do it myself. Diffs against files in /n/sources/contrib/miller/9/bcm, which I think are identical to 9legacy 9/bcm sources): mkfile: 85a86,90 > $p$CONF.qemu:DQ: $CONF.$O $OBJ $LIB > $CC $CFLAGS '-DKERNDATE=3D'`{date -n} $CONF.c > echo '# linking kernel for QEMU' > $LD -s -l -o $target -H6 -R4096 -T0x80010000 $OBJ $CONF.$O $LIB >=20 mem.h: 48c48 < #define KTZERO (KZERO+0x8000) /* kernel text star= t */ --- > #define KTZERO (KZERO+0x10000) /* kernel text star= t */ archbcm2.c: 225c225 < addclock0link(wdogfeed, HZ); --- > //addclock0link(wdogfeed, 1000); sdmmc.c: 25c25 < Multiblock =3D 1, --- > Multiblock =3D 0, clock.c: 35c35 < MinPeriod =3D 10, --- > MinPeriod =3D 100, 124c124 < u32int t0, t1, tstart, tend; --- > u32int t0, t1, tstart; 142d141 < tend =3D tstart + 10000; 145c144 < }while(tn->clo !=3D tend); --- > }while(tn->clo - tstart < 10000); ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T5da5467097e4eab2-M2edf6= c6413ee49aaee761281 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription