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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32708 invoked from network); 27 Jul 2022 08:03:32 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 27 Jul 2022 08:03:32 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id CA06940139; Wed, 27 Jul 2022 18:03:23 +1000 (AEST) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by minnie.tuhs.org (Postfix) with ESMTPS id DAAD440123 for ; Wed, 27 Jul 2022 18:03:04 +1000 (AEST) Received: by mail-wm1-f41.google.com with SMTP id j29-20020a05600c1c1d00b003a2fdafdefbso582737wms.2 for ; Wed, 27 Jul 2022 01:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4O/CYmtWt7XVbwcqoXuqRiCoMb4aAAIDdTVl6vaQ5jU=; b=BUvVEzpaM+L5LqlFqqAC4Fn9ro0uqSMXG5mcJdaNcDXuCwVfivPDhUM3eXOZFbGH2m 4eOzujkp2o1huVa0U2jgQMkSYRKkPwOEDF/utAAupl4r7YK+PQOCt+J0C/6LhI7UHggQ 1d08bdZnJuWOO0OhNTf9v10d6UDe8Ml1nMAgjQ8wVtKiHtCWvkIAzfsvkWst0V/Wv4pD Dgz57k7+SFNmHcE7rTvSQTxEF8XNcs7YSZprgpOql/yWuLMu8h9xv8buTMdI9NE35idd NHzZy/xy1lyTWGwsk+pXCuZyNwW8kw/cQZDZ51ALyD56Qd42p1kVelFXv3GFioYyh9ZV Vn3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4O/CYmtWt7XVbwcqoXuqRiCoMb4aAAIDdTVl6vaQ5jU=; b=Fpp0eV1e0x9Xi19XbXSZiOo5qKpzk9DnCwnfPJTGqPWSOEFgCHkSprFRplk8ZisxIL Tp97ZB7JttGxeS8TGRbMHY9TPVKv0U0CHsNk2l0AYb8ObkQhX3uC9yBiL1v3lVQW465E 32vfKt8ObShFrd+e0iwYXRDM23VJJ7kOLcumt+v+IJL/fbmque9k1XbyhNj06CbQGYIf If8Bz5+kqJo/GyWQL7w8nzouB96lofuuud6VHpvzk7SgoVIRO/jQs2oFjnIATH+XdGvz n+IZBEQcfH6PL8sC3CwkebIzEMdV2ErXL4NRVh3hfYXm5W7FriFPbxYrlamunSiiwQra zagA== X-Gm-Message-State: AJIora+tRDU6WsCW8VxPU5PAO7evH1EuoRiiwy+NcqnQ8i9/UBVDRgUC rM13ZhaQaLZKpfURHBCjHIpdy43B/80Ra8BYy/I= X-Google-Smtp-Source: AGRyM1uDnhQWK/H+aFerErf97qTc2lU1PWUhWGRaC0saVeqB7OrtY0j5iJy8JcKaDfnsbW98CpCnMSGGlE/PgISF3yo= X-Received: by 2002:a05:600c:a188:b0:3a3:1802:e327 with SMTP id id8-20020a05600ca18800b003a31802e327mr2097134wmb.41.1658908923006; Wed, 27 Jul 2022 01:02:03 -0700 (PDT) MIME-Version: 1.0 References: <20220711234729.2E9F418C096@mercury.lcs.mit.edu> In-Reply-To: From: Gavin Tersteeg Date: Wed, 27 Jul 2022 03:02:01 -0500 Message-ID: To: Noel Chiappa Content-Type: multipart/alternative; boundary="00000000000012139405e4c4d5e4" Message-ID-Hash: CWHOWWLYZBNNU3ZSW7XAKRDPP5D3QMCE X-Message-ID-Hash: CWHOWWLYZBNNU3ZSW7XAKRDPP5D3QMCE X-MailFrom: gctersteeg@gmail.com 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 CC: tuhs@tuhs.org X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: LSX issues and musing List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --00000000000012139405e4c4d5e4 Content-Type: text/plain; charset="UTF-8" Well, it has been almost 2 weeks since my last post on this thread. Since there is so little information about LSX online, I might as well post all that I have done / noticed. First things first, the kernel building issue was as simple as I was expecting. All of the build scripts are meant for an external V6 system, and do not work on LSX itself. I forgot that the LSX linker defaults to 040000 instead of 0 which obviously broke my kernel. Setting the "-a" flag on the linker and fixing config stuff in param.h, header.s, and mch.s was all that was needed to make it work. Next up was converting the userspace from 16K to 20K. I tried to use an external compiler as little as possible and was mostly successful doing so. "ed.c" needed to be broken up into 2 different files, but everything else worked. The only thing that needed to be cross compiled was the C compiler itself. As it turns out, the stock C compiler that LSX comes with does not have enough "OSSIZ" in order to build the 2nd pass of the compiler. Interestingly enough, compiling it with the full space only makes the 2nd pass go up to 23K-ish size. It just barely fits in the userspace, but it does work. I don't know why the original creators of the root image didn't start with this. Speaking of the C compiler, mounting the "cc.dsk" file from the archives on LSX is a bad idea. Unlike every other image, it is formatted for 500 blocks instead of 400. Trying to write to this filesystem will cause the swap space to get overwritten, which is generally not a good thing. After the kernel and userspace were working, I went ahead and started making modifications to the kernel. The first goal involved re-adding the RAW tty mode. Turns out, this was super simple and only took like 10 minutes of copying "if" statements. After that, my custom V6 screen editor compiled and worked flawlessly. Finally, tonight I was able to get a RK05 driver to work alongside the default RX01 driver. This one was a little bit more of a challenge, as all of the block device switch code has been ripped out of LSX. Device drivers also work slightly differently, as some driver support functions are removed and "buf.h" is set up to only use 8-bit dev IDs. After adding back a simplified "bdevsw[]", some modifications to "bio.c", and a whole lot of tinkering I was able to get RK0 auto-mounted on "/mnt". Should make moving lots of files *much* easier, plus it will facilitate my future plans for the project. I think my next goal is to add back the "mount" and "umount" syscalls. I got about 2200 bytes free of kernel space, so that should be more than enough room to add those functions in. After that, i'll just need to write a RX02 driver and make the jump over to real hardware. Of course, the mystery swap bug still persists. Thanks for reading, Gavin On Fri, Jul 15, 2022 at 3:07 AM Gavin Tersteeg wrote: > Well, I have spent a few more days tentatively messing around with LSX, > and I have noticed a few things. > > First off, the C compiler is not the only program to have occasional > issues. Sometimes the "mv" command also fails with the > oh-so-descriptive "?" error. By the looks of it, this error is caused by > something going wrong with a fork() and subsequent wait() syscall. That > recurring error in the C compiler is also caused by the 2nd pass of the C > compiler not being able to find a temporary file created by the 1st pass. > If the 1st pass was failing to run, then that would explain why the 2nd > pass isn't able to find that temporary file. This has me guessing that > there may be something wrong with fork() or exec(). Whenever it is, it > doesn't dumpster memory or blow up the filesystem. For all I know, it may > be an emulation issue too, but I have no way of testing it right now. > > The current kernel I am building is under 16KB at the moment. My goal is > to be able to recreate the stock (semi?) functional kernel, and then do > modifications from there. This goal has not been reached, as this kernel > simply crashes on startup. It is either a HALT instruction or a stack issue > depending on if the kernel has been stripped or not. I bet I am building it > wrong again :/, it doesn't need to be reloc'd after the "ld -X" does it? > > Has anyone actually been able to get a system to build with the archived > LSX disks? I have poured over the config files many times, but I feel like > I am missing something painfully obvious... > > On Mon, Jul 11, 2022 at 6:47 PM Noel Chiappa > wrote: > >> > From: Paul Ruizendaal >> >> > Note that LSX only holds one process in core and swaps other >> processes >> > (NPROC = 3) out to floppy. It reportedly took several hours for the >> > Terak to self-compile LSX from source. >> >> If one is working in a simulator, and not a real hardware PDP-11, there's >> a >> 'trick' one can use to make life a lot easier - for MINI-UNIX, at least; >> I'll >> comment on LSX below. >> >> As I report in the MINI-UNIX Computer History Wiki article: "MINI-UNIX >> uses >> the same file system as V6; this allows MINI-UNIX packs to be 'mounted' >> on V6 >> systems (either real, or simulated), which is very convenient for working >> on >> them." So just spin up a V6 in the simulator, mount the LSX/MINI-UNIX >> pack, >> and away you go. The V6 toolchain can be used to compile/link kernels; to >> link user commands one will need to import the LSX/MINI-UNIX loader >> (which, >> since V6 is source compatible with LSX/MINI-UNIX, is trivial). >> >> LSX is potentially more complex, as it supports _two different_ file >> system >> formats: the standard V6 one, and a 'contiguous' one which is very similar >> to the V6 one (rdwri.c has no conditionals on CONTIG; not so alloc.c, >> though), but is not fully compatible. So non-contiguous LSX file systems >> can be mounted under V6, but not contiguous ones. >> >> Noel >> > --00000000000012139405e4c4d5e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Well, it has been almost 2 weeks since my last post on thi= s thread. Since there is so little information about LSX online, I might as= well post all that I have done / noticed.

First things = first, the kernel building issue was as simple as I was expecting. All of t= he build scripts are meant for an external V6 system, and do not work on LS= X itself. I forgot that the LSX linker defaults to 040000 instead of 0 whic= h obviously broke my kernel. Setting the "-a" flag on the linker = and fixing config stuff in param.h, header.s, and mch.s was all that was ne= eded to make it work.

Next up was converting the u= serspace from 16K to 20K. I tried to use an external compiler as little as = possible and was mostly successful doing so. "ed.c" needed to be = broken up into 2 different files, but everything else worked. The only thin= g that needed to be cross compiled was the C compiler itself. As it turns o= ut, the stock C compiler that LSX comes with does not have enough=C2=A0&quo= t;OSSIZ" in order to build the 2nd pass of the compiler. Interestingly= enough, compiling it with the full space only makes the 2nd pass go up to = 23K-ish size. It just barely fits in the userspace, but it does work. I don= 't know why the original creators of the root image didn't start wi= th this.

Speaking of the C compiler, mounting the = "cc.dsk" file from the archives on LSX is a bad idea. Unlike ever= y other image, it is formatted for 500 blocks instead=C2=A0of 400. Trying t= o write to this filesystem will cause the swap space to get overwritten, wh= ich is generally not a good thing.

After the kerne= l and userspace were working, I went ahead and started making modifications= =C2=A0to the kernel. The first goal involved re-adding the RAW tty mode. Tu= rns out, this was super simple and only took like 10 minutes of copying &qu= ot;if" statements. After that, my custom V6 screen editor compiled and= worked flawlessly.

Finally, tonight I was able to= get a RK05 driver to work alongside the default RX01 driver. This one was = a little bit more of a challenge, as all of the block device switch code ha= s been ripped out of LSX. Device drivers also work slightly=C2=A0differentl= y, as some driver support functions are removed and "buf.h" is se= t up to only use 8-bit dev IDs. After adding back a simplified=C2=A0"b= devsw[]", some modifications to "bio.c", and a whole lot of = tinkering I was able to get RK0 auto-mounted on "/mnt". Should ma= ke moving lots of files *much* easier, plus it will facilitate my future pl= ans for the project.

I think my next goal is to ad= d back the "mount" and "umount" syscalls. I got about 2= 200 bytes free of kernel space, so that should be more than enough room to = add those functions in. After that, i'll just need to write a RX02 driv= er and make the jump over to real hardware. Of course, the mystery swap bug= still persists.

Thanks for reading,
Gav= in

On Fri, Jul 15, 2022 at 3:07 AM Gavin Tersteeg <gctersteeg@gmail.com> wrote:
Well, I have s= pent a few more days=C2=A0tentatively messing around with LSX, and I have n= oticed a few things.

First off, the C compiler is not th= e only program to have occasional issues. Sometimes the "mv" comm= and also fails with the oh-so-descriptive=C2=A0"?" error. By the = looks of it, this error is caused by something going wrong with a fork() an= d subsequent wait() syscall. That recurring error in the C compiler is also= caused by the 2nd pass of the C compiler not being able to find a temporar= y file created by the=C2=A01st pass. If the 1st pass was failing to run, th= en that would explain why the 2nd pass isn't able to find=C2=A0that tem= porary file. This has me guessing that there may be something wrong with fo= rk() or exec(). Whenever it is, it doesn't dumpster memory or blow up t= he filesystem. For all I know, it may be an emulation issue too, but I have= no way of testing it right now.

The current ke= rnel I am building is under 16KB at the moment. My goal is to be able to re= create the stock (semi?) functional kernel, and then do modifications from = there. This goal has not been reached, as this kernel simply crashes on sta= rtup. It is either a HALT instruction or a stack issue depending on if the = kernel has been stripped or not. I bet I am building it wrong again :/, it = doesn't need to be reloc'd after the "ld -X" does it?

Has anyone actually been able to get a system to buil= d with the archived LSX disks? I have poured over the config files many tim= es, but I feel like I am missing something painfully=C2=A0obvious...
<= /div>

On Mon, Jul 11, 2022 at 6:47 PM Noel Chiappa <jnc@mercury.lcs.mit.edu&g= t; wrote:
=C2=A0= =C2=A0 > From: Paul Ruizendaal

=C2=A0 =C2=A0 > Note that LSX only holds one process in core and swaps o= ther processes
=C2=A0 =C2=A0 > (NPROC =3D 3) out to floppy. It reportedly took several = hours for the
=C2=A0 =C2=A0 > Terak to self-compile LSX from source.

If one is working in a simulator, and not a real hardware PDP-11, there'= ;s a
'trick' one can use to make life a lot easier - for MINI-UNIX, at l= east; I'll
comment on LSX below.

As I report in the MINI-UNIX Computer History Wiki article: "MINI-UNIX= uses
the same file system as V6; this allows MINI-UNIX packs to be 'mounted&= #39; on V6
systems (either real, or simulated), which is very convenient for working o= n
them." So just spin up a V6 in the simulator, mount the LSX/MINI-UNIX = pack,
and away you go. The V6 toolchain can be used to compile/link kernels; to link user commands one will need to import the LSX/MINI-UNIX loader (which,=
since V6 is source compatible with LSX/MINI-UNIX, is trivial).

LSX is potentially more complex, as it supports _two different_ file system=
formats: the standard V6 one, and a 'contiguous' one which is very = similar
to the V6 one (rdwri.c has no conditionals on CONTIG; not so alloc.c,
though), but is not fully compatible. So non-contiguous LSX file systems can be mounted under V6, but not contiguous ones.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 Noel
--00000000000012139405e4c4d5e4--