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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7469 invoked from network); 11 Oct 2022 19:33:28 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 11 Oct 2022 19:33:28 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob1.topicbox.com (Postfix) with ESMTP id 412072C3BC for ; Tue, 11 Oct 2022 15:33:26 -0400 (EDT) (envelope-from bounce.mM2f414023b6a6afb2ebeda37e.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 3D6FE98EBA4; Tue, 11 Oct 2022 15:33:26 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=ht7VJBzB header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=rminnich@gmail.com smtp.helo=mail-lf1-f47.google.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=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:list-help:list-id:list-post :list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1665516806; bh=3wMjp+N1hSgepi9I +fI2tIXlKMbg8uIddszqIgHj/vw=; b=m6RmONUMCm6X2yuNz1qmGWsNsCS4qq7w IIlJ2dTZd6ejAmN4R8O6fhw7zyOuHBCf3r5ySfis8sF2G7oXe+Uhr3AforEflp0G mIZkoWdPfFzCVn7Jq6oe7GwnNdFX2J9yZWm34pLas794wBnCb7v9aS5zHWZNKzZm sr2MvYuXFC8= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1665516806; b=D2nz/8DCHqbKaXPEpiBbIyHo/lRBrOQW8JuAqEE4tQRv5dLYWo HZZB7gpM/ImOkX6QlG+cYGPXDhtcnZFVTShEloLTDHmBsmvk/yjn7BiCBL9iCqOD sSVLwSNm/pA41EoNcooVRnoKzZDzsNSUCdbM0M0QYIaJmTjIAoslh0b8Q= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=ht7VJBzB header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=rminnich@gmail.com smtp.helo=mail-lf1-f47.google.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 Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=ht7VJBzB header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.47 (mail-lf1-f47.google.com); spf=pass smtp.mailfrom=rminnich@gmail.com smtp.helo=mail-lf1-f47.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=b8qZy9GF; x-me-sender=none; x-ptr=pass smtp.helo=mail-lf1-f47.google.com policy.ptr=mail-lf1-f47.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.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= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; t=1665516806; x=1665603206; bh=kaVHcwO4cZdFLhj1BloXv4Q27HYXMa+I Cwpl4dO14MA=; b=CYj97+h7DrZu/AwAmH9eugsLNVwbo9+iVIOY4AfLz2OugW95 BgYzjCiPSLDTtWTnGJlo/eXt+PL9QRhGhbwRByo4Ll6Mim2LMRsH4J4RGW931WSg QTUNnWLhWFrYLxnMS339LzkVRresExDMd5MMAHWI1ayE0ggZ8+vNyF5NXa8= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 93A0298E66B for <9fans@9fans.net>; Tue, 11 Oct 2022 15:33:05 -0400 (EDT) (envelope-from rminnich@gmail.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 228815521EF; Tue, 11 Oct 2022 15:33:05 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1665516785; b=Vmq802whx5DWLNRTvUNrV5mF9J5+HcCV+p1Bd0pimLQpzwT5uy qNlj947CsSz26TZT+u4rIDXA4TNv5QO4yhBBuevGa+r2FZQmpxzEdjMOyEz1j9E2 UiJLTM9sWFmLqgZkYx6OcTpPOxmRgECQzP5kVoSDUlfA7EX3El8Sq5dNqQB9R1RI w/3koZOEY7LSxSaffBMa1IMFD5Vwi5ueMJ2ZqMJYPl+zgXW6DrzvM4yZHDd/yP4x AiO/I1gsNteqWKgamUgL3eeyWYtYMEZln0GVTYWXuFLqacaCG9kuF0J2Qb+6EcLV w7/zckSrgtpseFi24RSEhZKdpqou1LaV2WNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=arcseal; t=1665516785; bh=XWsoDJubmDO0yKZj8oHvxBvkwvwczizckfRQD8zVnmg=; b=xvlZV48oIq5b VqZOsjpsKzat9OQq5MoaC6d2o1mUQxbDFs5BjbYJm27Y5omxsPZC0jTRQLTWDpQK wt/a1i2VU8SDLiCH1LfAt+cvyVxRrQkTwMetIUnLCr5FPLf+8PhfhhD2yy19uCgZ ZyuKcvbnJNGoZGTp/uyqbL/iS1g0wixhgLEeu/NaQtfUmm9xNMsRhYhcODz3U/TJ YAacZA+APgOGIm8g/YgO1Yk3kOP7NYeVi7uNWxRjMs2v1/ag1CX4MudNKNs+rDFT iR3CVvNnV8fTnIn1pFFl4dyYA+3+dLlIfKCqNoOMlmAo1LA5w0PTJDApO+RzQ95V EXMuI7pnEw== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=ht7VJBzB header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.47 (mail-lf1-f47.google.com); spf=pass smtp.mailfrom=rminnich@gmail.com smtp.helo=mail-lf1-f47.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=b8qZy9GF; x-me-sender=none; x-ptr=pass smtp.helo=mail-lf1-f47.google.com policy.ptr=mail-lf1-f47.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.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: gggruggvucftvghtrhhoucdtuddrgedvfedrfeejiedgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjg fhfffkuffvtgesrgdtreertddtjeenucfhrhhomheprhhonhcumhhinhhnihgthhcuoehr mhhinhhnihgthhesghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepteelieevle efvdffjeekvdfgteevudeiffffueehjeejheefgfeggeekkeekgedtnecuffhomhgrihhn pehgihhthhhusgdrtghomhdpnhgvthhlihgsrdhorhhgpdgrrhgthhhivhgvrdhorhhgpd hsfihttghhrdgtohhmpdhquhhinhhtihhlvgdrnhgvthdpghhoohhglhgvrdgtohhmpdht ohhpihgtsghogidrtghomhenucfkphepvddtledrkeehrdduieejrdegjeenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvtdelrdekhedrudeijedrgeej pdhhvghlohepmhgrihhlqdhlfhduqdhfgeejrdhgohhoghhlvgdrtghomhdpmhgrihhlfh hrohhmpeeorhhmihhnnhhitghhsehgmhgrihhlrdgtohhmqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'rminnich@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="rminnich@gmail.com"; helo=mail-lf1-f47.google.com; client-ip=209.85.167.47 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (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>; Tue, 11 Oct 2022 15:33:04 -0400 (EDT) (envelope-from rminnich@gmail.com) Received: by mail-lf1-f47.google.com with SMTP id m19so21284588lfq.9 for <9fans@9fans.net>; Tue, 11 Oct 2022 12:33:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XWsoDJubmDO0yKZj8oHvxBvkwvwczizckfRQD8zVnmg=; b=b8qZy9GFu0zFO4qF1WKzycIytZ4wT4PdGqxrzvS7yWc2YBvwC1PAHiIEHilaadDxo6 Rqdxkcb6z470SRASZf2HKSw4m550gC7RpfBR87xObUswY8wxUNDSWDi0Eunu8JYX6MZq 0kNKpOFfseaXNWazSgzvT2ZJ/3E2PnSbdqmQzW1Cal4V/06ws60IxpsJvZj1EnRKdle3 ebccgQrATQyCb6LnMFexLSq0jB3v+K4byu5MCPlHe21mEOF72fDJOQk9JbErd8MzMgz9 VnpH7LCi7Xj6jEuG+zvMcQydqZ0v9cOSeqMjRajXxPeoVzzi2gh/AYL0cf+1NyYufaXn PhUw== X-Gm-Message-State: ACrzQf1ItjSvb1b0sYyKrA/E/chU+Lc+cJfgrYQsiGdSKiLmreUURxCD ArveK676Oe3IM2pKZjhRXyKtasHpo3hd4vImfgQJWt/Usk+nGw== X-Google-Smtp-Source: AMsMyM4vi4CJdOzVphIeD6s2STNnnwVIkK2pUIJSkHVCghJGztbpC2qJv4QRR8icMrFybdZnknUi5lqIQwHEGulLL5E= X-Received: by 2002:a05:6512:ba9:b0:4a2:5db3:8c4e with SMTP id b41-20020a0565120ba900b004a25db38c4emr8920436lfv.664.1665516782005; Tue, 11 Oct 2022 12:33:02 -0700 (PDT) MIME-Version: 1.0 References: <1dfd0e13-8435-4c8c-8f59-440751c3c4da@riseup.net> In-Reply-To: From: ron minnich Date: Tue, 11 Oct 2022 12:32:50 -0700 Message-ID: Subject: Re: [9fans] How can I compile c code written for plan9 in ANIS C compiler To: 9fans <9fans@9fans.net> Content-Type: multipart/alternative; boundary=00000000000028b4a305eac758a4 Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 8aba268e-499b-11ed-84e5-d37e5e2d5ab3 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UNDIyMzc4ZmMyNTc4NzcyMC1NMmY0MTQwMjNiNmE2YWZiMmViZWRh?= =?UTF-8?B?MzdlPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: 7bit List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M2f414023b6a6afb2ebeda37e:1:HHUIRqfsADKKe6wnU9OMueRmXMKgMKwtmh6JBk7RWnE --00000000000028b4a305eac758a4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable we used the coccinnelle tool (spatch) to convert about 1.4M lines of Plan 9 code to C11 for harvey. It was not perfect, but it did get a lot right. This even got pretty complex: in amd64 Plan 9, r14 and r15 are dedicated to up and mach. This is not portable, so we wanted to make it explicit. So in any function that used up, for example, we had an spatch to add Proc *up =3D externup(); declaration to those functions. spatch is powerful. references to m-> where replaced with machp(). We also removed the embedded lock structs, with spatches like this: @ @ expression E; @@ -incref(E) +incref(&E->ref) This actually *maybe* found a bug, in which there was an ambiguity when a struct contained two embedded lock (e.g. Lock and Qlock) types and the compiler had to pick the right one to apply the lock/unlock to. It looked to us like Plan 9 might have picked the wrong one, but we were never sure. anyway, this is one path to converting plan 9 code. Or you can just go to https://github.com/Harvey-OS/harvey/tree/GPL-C11, where it already is done. On Mon, Oct 10, 2022 at 1:52 AM Steve Simon wrote: > re: p9p for windows > > Sean Quinlan did a p9p-line port for windows called 9pm, It was seen (it > seems) as a port of sam with some simple command line tools > rather than a complete plan9 toolkit. its available here: > https://netlib.org/research/ as sam.exe > > There was an attempt at a p9p for windows by Russ Cox, it was a very > elegant solution having a p9p dll but suffererd from fragility > (a bug in the dll took all your p9p applications down), and split brain > problems (p9p applications understood plan9 style binds and mounts, > native windows applications did not. As a result development stalled. > > Its possible that this could be re-awakened using a windows IFS > (Installable File System) driver to allow windows applications to see a > plan9 style file structure (the 9: drive :-) and perhaps starting p9p as a > windows service. This sounds neat but would be a considerable > amount of work. > > This is available here: > https://web.archive.org/web/20070221202050/http://swtch.com/usr/local/pla= n9/9pm/README > > There was a later implementation by Michael Teichgr=C3=A4ber which is a > complete port of plan9ports to windows, in a similar style to the > posix implementations, this works very well, though, like outher p9p > implementations it has a bit of a split brain feel to it. > > This is here: https://github.com/knieriem/pf9 > > I took a rather different approach as I used plan9 as my desktop for years > but needed windows for some work related applications. > > I did a minimal port of the plan9 command line applications to wondows and > wrote a cpu(1) line client and server which allowed me to > warp a plan9 terminal to MS windows, in the same directory but running > rc(1); I also used remote desktop to get a modern web browser. > This was very comfortable environment for what i needed. > > This is here http://www.quintile.net/magic/webls?dir=3D/quintile.net/pkg > 9win.tbz > > These days I work on a Mac so plan9ports does all I need, and sadly I > hardly ever touch real plan9 any more :-( > > -Steve > > > > > I think there are two ports of plan 9 utilities to windows, one of them > includes old (2nd ed?), and other one is a more modern port. > > > > https://code.google.com/archive/p/plan9port-windows >=20 >=20 ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T422378fc25787720-M2f414= 023b6a6afb2ebeda37e Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --00000000000028b4a305eac758a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
we used the coccinnelle tool (spatch) to conve= rt about 1.4M lines of Plan 9 code to C11 for harvey. It was not perfect, b= ut it did get a lot right.

This even got pretty comple= x: in amd64 Plan 9, r14 and r15 are dedicated to up and mach. 
This is not portable, so we wanted to make it explicit. So in any functi= on that used up, for example, we had an spatch to add Proc *up =3D ext= ernup(); declaration to those functions. spatch is powerful. references to = m-> where replaced with machp(). 

=
We also removed the embedded lock structs, with spatches like this:
@  @
expression E;
@@
-incref(E)
+incref(&= amp;E->ref)

This actually *maybe* found= a bug, in which there was an ambiguity when a struct contained two em= bedded lock (e.g. Lock and Qlock) types and the compiler had to pick the ri= ght one to apply the lock/unlock to. It looked to us like Plan 9 might have= picked the wrong one, but we were never sure.

a= nyway, this is one path to converting plan 9 code. Or you can just go to&nb= sp;https://git= hub.com/Harvey-OS/harvey/tree/GPL-C11, where it already is done.
<= div>


On Mon, Oct 10, 2022 at 1:52 AM Steve Si= mon <steve@quintile.net> wr= ote:
re: p9p f= or windows

Sean Quinlan did a p9p-line port for windows called 9pm, It was seen (it se= ems) as a port of sam with some simple command line tools
rather than a complete plan9 toolkit. its available here: https://netlib= .org/research/ as sam.exe

There was an attempt at a p9p for windows by Russ Cox, it was a very elegan= t solution having a p9p dll but suffererd from fragility
(a bug in the dll took all your p9p applications down), and split brain pro= blems (p9p applications understood plan9 style binds and mounts,
native windows applications did not. As a result development stalled.
=
Its possible that this could be re-awakened using a windows IFS (Installabl= e File System) driver to allow windows applications to see a
plan9 style file structure (the 9: drive :-) and perhaps starting p9p as a = windows service. This sounds neat but would be a considerable
amount of work.

This is available here: https://web.archive.org/web/20070221202050/http://swtch.com/usr= /local/plan9/9pm/README

There was a later implementation by Michael Teichgräber which is a com= plete port of plan9ports to windows, in a similar style to the
posix implementations, this works very well, though, like outher p9p implem= entations it has a bit of a split brain feel to it.

This is here: https://github.com/knieriem/pf9

I took a rather different approach as I used plan9 as my desktop for years = but needed windows for some work related applications.

I did a minimal port of the plan9 command line applications to wondows and = wrote a cpu(1) line client and server which allowed me to
warp a plan9 terminal to MS windows, in the same directory but running rc(1= ); I also used remote desktop to get a modern web browser.
This was very comfortable environment for what i needed.

This is here http://www.quintile.net/magi= c/webls?dir=3D/quintile.net/pkg      9win.tbz

These days I work on a Mac so plan9ports does all I need, and sadly I hardl= y ever touch real plan9 any more :-(

-Steve



> I think there are two ports of plan 9 utilities to windows, one of the= m includes old (2nd ed?), and other one is a more modern port.
>
> https://code.google.com/archive/p/plan9port-= windows



------------------------------------------
9fans: 9fans
Permalink: https:= //9fans.topicbox.com/groups/9fans/T422378fc25787720-M486c49f45c4d27adb8d5b8= 91
Delivery options: https://9fans.topicbox.com/gro= ups/9fans/subscription
= --00000000000028b4a305eac758a4--