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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25453 invoked from network); 30 Dec 2022 18:27:24 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 30 Dec 2022 18:27:24 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 8F9C24238E; Sat, 31 Dec 2022 04:26:45 +1000 (AEST) Received: from ewsoutbound.kpnmail.nl (unknown [195.121.94.167]) by minnie.tuhs.org (Postfix) with ESMTPS id 542354238E for ; Sat, 31 Dec 2022 04:26:40 +1000 (AEST) X-KPN-MessageId: 7965f8c6-886f-11ed-8796-005056abbe64 Received: from smtp.kpnmail.nl (unknown [10.31.155.40]) by ewsoutbound.so.kpn.org (Halon) with ESMTPS id 7965f8c6-886f-11ed-8796-005056abbe64; Fri, 30 Dec 2022 19:26:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=planet.nl; s=planet01; h=to:date:message-id:subject:mime-version:content-type:from; bh=5GtaLJb9upx1pJBUJSiB2Y2J6l0z0YsmkL3rgrlZbbs=; b=Mr0OmJoBCMFKGACa4e2YewtQZz2Tpbzz7TEYR7VHdyzWVYXaC4sml0oP0Jy0CZex537lCQcFW43no Evy/U36MmmWPDE3w/hjxntV1Px+Buib79ja67crCuLBgZ23YhiNBjqI8oLOkz1PZH+wM2DKhV9jlp4 6rdcdV60b2n3egNc= X-KPN-MID: 33|0dFlUd/RrHrPRDLtwGdPiQJ70G4u8J81NyqBS8OdCHBTSl0oJpgCs+dI7HpKpH2 v8oZiE77KrZFqAlSmqXkUEZR+l+CwhcDUgWR6obOq3Tg= X-KPN-VerifiedSender: Yes X-CMASSUN: 33|bumGtoxT0Z7AiYJhCOnKQkYVhlRCYrx5brxnLdP1ALHoqkNrQkbgKFfwYY5YCkR tjYG58ez3591sc/xMmHBTOQ== X-Originating-IP: 77.172.38.96 Received: from smtpclient.apple (77-172-38-96.fixed.kpn.net [77.172.38.96]) by smtp.kpnmail.nl (Halon) with ESMTPSA id 79b75a53-886f-11ed-927c-005056ab7584; Fri, 30 Dec 2022 19:26:28 +0100 (CET) From: Paul Ruizendaal Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Message-Id: <7C246577-E12E-4C15-B912-7EB9AABAC700@planet.nl> Date: Fri, 30 Dec 2022 19:26:28 +0100 To: The Eunuchs Hysterical Society X-Mailer: Apple Mail (2.3654.120.0.1.13) Message-ID-Hash: NPODM7R77Y6KBXQK2CNYTBIN2B3Y4RGQ X-Message-ID-Hash: NPODM7R77Y6KBXQK2CNYTBIN2B3Y4RGQ X-MailFrom: pnr@planet.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Xv6, Linux and SysIII on a RV32 FPGA system List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Having done the SysIII 64-bit port to a recent Risc-V chip, I realised = that whilst it is an interesting exercise bij itself -- and maybe even = useful to students and educators around the world -- it is not ideal as = a research tool for analysing Unix from the early 80=E2=80=99s. The = address size difference adds some superfluous porting, and the 100x = speed difference can hide critical algorithm constraints. Also the = complex IO devices are out of character. For a Risc-V 32 bit target I=E2=80=99ve settled on an FPGA = implementation from the University of Tokyo. I=E2=80=99ve somewhat = modified the system to work with the open source Yosys/NextPNR tool = chain. It now implements a Linux-capable SoC with a full MMU, a 4-way = cache and SD card driver in less than 4,000 lines of plain Verilog = (compiling to about 14K LUTs). In a way, the code has a 6th edition feel = to it: it covers a real and usable system and the code can be understood = in a couple of days -- or a semester for a student who is new to the = concepts involved. https://gitlab.com/r1809/rvsoc/-/tree/main/doc So far I have Linux and XV6 (https://gitlab.com/r1809/xv6-rv32) running, = but have not started on SysIII yet. Usefully for my use case this system is not very fast, completing an = instruction in on average 10 clocks. Still, when running at 40MHz it is = about 2 or 3 times as fast as a VAX11/780, which is similar to the = systems of the mid-80=E2=80=99s. Even at this speed, a single user = console Linux is surprisingly usable. By the way, funny to realise that = =E2=80=98Unix/Linux capable=E2=80=99 has been a marketing slogan for = system capability for 40 years now. There is a short video clip with a demonstration (but running at 100MHz) = here: https://youtu.be/Kt_iXVAjXcQ Due to its simple design, the main CPU only uses some 30% of the cache = memory bandwidth and it should not be all that hard to add a second CPU = to the system (the CPU already supports the Risc-V atomic operations), = and this could be a nice target for studying the early Unix = multi-processor designs (e.g. VAX/BSD & 3B2/SVR3). I find it an intriguing thought that the chip technology of the early = 80=E2=80=99s (let=E2=80=99s say the technology used for the Bellmac-32 = or M68K) would probably have sufficed to build a CPU similar to the one = used in this FPGA design. As the topic of this post is on a tangent from the focus of this list, I = would recommend that any follow-ups not related to the history of Unix = are sent off list.