The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] LSX on the PDP-11/03 (LSI-11)
@ 2020-05-31 13:50 Paul Ruizendaal
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Ruizendaal @ 2020-05-31 13:50 UTC (permalink / raw)
  To: paul; +Cc: TUHS main list

> I've stumbled across LSX, and I have it running on SimH. I'm quite inexperienced with Unix, but it's something I want to learn well, having brushed against it at university in the '80s, and having played with Linux somewhat.

I think you will experience a sizeable learning curve. You will be working with Unix and C as it stood around 1975 and that is substantially different from what it was in the 80’s. That said, I know from personal experience that it is an intriguing journey and certainly not impossible to do.

> Some help would be nice, but more generally, is anyone on this list more than vaguely familiar with LSX, or 6th Edition itself?

Many on this list are familiar with 6th edition. The best way to learn the internals of 6th edition is the “Lions’ book”:
https://www.amazon.com/Lions-Commentary-Unix-John/dp/1573980137

Coming from today’s perspective (or a 1980’s one), you will find the following key challenges:

- The version of C used for 6th edition is different from the 1980’s. Amongst other things the syntax of the assignment operators changed (not += but =+), the syntax for initialisation changed (not 'int a = 3', but 'int a 3’), the ‘long’ datatype (32 bit on a PDP-11) did not exist, the ‘void’ keyword did not exist, structs could not be assigned, passed or returned (only pointers to structs), etc.

- The stdio library did not exist yet, in its place there was the ‘portable i/o library’. This may be the hardest part to get used to.

- The file system was 16-bit based throughout. This has implications for stat(), lseek() did not exist (its precursor seek() used additional whence values to move the file pointer in 512 byte increments), etc.


When it comes to LSX, there are a few people who have experience with it on the this list (that I know of - there may be many more).

First of all, Heinz Lycklama, the original creator of LSX, appears to read this list from time to time.

Second, Leonid Broukhis and Serge Vakulenko (who managed to recover the LSX sources 20 years ago) might be reading the list. They took the trouble to port LSX to the Soviet BK-0010 computer, an LSI-11 type system some 15 years ago:
https://github.com/sergev/bkunix
You can stand on their shoulders, as they already took the trouble to convert the kernel source from 1975 C to 1980’s C and to create a stdio compatible library for it; they are using the 2.11BSD C compiler, which generates tighter code than the 1975 compiler — hence they could squeeze a bit more functionality in.

Third, I found the BK-0010 port some 5 years ago and used that as base to create a version that would run on a small TI990 clone:
http://www.stuartconner.me.uk/mini_cortex/mini_cortex.htm
This work later evolved into a stock 6th edition kernel and is now a curious mix of stuff dating from 1975 to 1985.

Your main challenge will be that neither the BK-0010 work nor my work will run on your hardware as-is. I think you have two possible paths forward. The first is to learn C and the library as it stood in 1975, the second is to take the BK-0010 code and to make it run on a stock LSI-11 again.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [TUHS] LSX on the PDP-11/03 (LSI-11)
  2020-05-31  6:26 Paul Riley
  2020-05-31 12:34 ` ron
@ 2020-06-01 16:41 ` Heinz Lycklama
  1 sibling, 0 replies; 5+ messages in thread
From: Heinz Lycklama @ 2020-06-01 16:41 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 1661 bytes --]

Paul, I'm surprised that copies of the LSX system are still around.
I'm assuming that you acquired only the binary code, and not the
source code. The LSX system source code could be compiled
on an LSX system running on floppy disks. I see you are getting
your C compiler issues addressed by others already.

Heinz Lycklama
Author of LSX at Bell Labs

On 5/30/2020 11:26 PM, Paul Riley wrote:
> I've managed to acquire a PDP-11/03 with twin floppy drives (Sykes 
> Datatronics RX01 or RX02 equivalents, not sure yet which).
>
> I've stumbled across LSX, and I have it running on SimH. I'm quite 
> inexperienced with Unix, but it's something I want to learn well, 
> having brushed against it at university in the '80s, and having played 
> with Linux somewhat.
>
> I have some interest in Forth, but I don't like the block system of 
> early forths such as FigForth, and I plan to create a new Forth based 
> on FigForth, but supporting external source files.
>
> Anyway, I've tried compiling Hello World on LSX, and I get "1: 
> External definition syntax" error. Some help would be nice, but more 
> generally, is anyone on this list more than vaguely familiar with LSX, 
> or 6th Edition itself?
>
> void main () {
>         printf("Hello World!");
> }
>
> It seems that the 7th Edition was the beginning of the standard 
> library in C, and that this is missing in LSX. I'm not sure if printf 
> is an intrinsic function in (6th Edition) C, or if it's from a library.
>
> My questions are a bit random, but looking to converse with others 
> with LSX experience.
>
> Paul
>
> *Paul Riley*
>
> Email: paul@rileyriot.com <mailto:paul@rileyriot.com>
>
>


[-- Attachment #2: Type: text/html, Size: 3482 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [TUHS] LSX on the PDP-11/03 (LSI-11)
  2020-05-31 12:34 ` ron
@ 2020-05-31 17:43   ` Warner Losh
  0 siblings, 0 replies; 5+ messages in thread
From: Warner Losh @ 2020-05-31 17:43 UTC (permalink / raw)
  To: Ronald Natalie; +Cc: TUHS main list

[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]

On Sun, May 31, 2020 at 6:34 AM <ron@ronnatalie.com> wrote:

>
> > Anyway, I've tried compiling Hello World on LSX, and I get "1: External
> > definition syntax" error. Some help would be nice, but more generally, is
> > anyone on this list more than vaguely familiar with LSX, or 6th Edition
> > itself?
> >
> > void main () {
> >         printf("Hello World!");
> > }
> >
> > It seems that the 7th Edition was the beginning of the standard library
> in
> > C, and that this is missing in LSX. I'm not sure if printf is an
> intrinsic
> > function in (6th Edition) C, or if it's from a library.
> >
>
> First off, VOID MAIN is not legal in any standard version of C.  Even when
> the language allows implementation defined extensions to the main
> signature, it must still return int.
>
> If you have a later version of language supported, you have to define
> printf rather than allowing it default define as an int returning
> function.
>
> Add #include <stdio.h>
>

Or, alternatively, LSX is really old. The compiler there likely doesn't
support 'void'.

From the lsx part of tuhs:

# cp /dev/tty8 addr.c
main() {
  int a;
  printf("main address: %u (0%o)\n", main, main);
  printf("stack address: %u (0%o)\n", &a, &a);
  printf("heap address: %u (0%o)\n", sbrk(0), sbrk(0));
}
^D
# cc addr.c
# a.out
main address: 16410 (040032)
stack address: 40934 (0117746)
heap address: 17920 (043000)

None of the disks appear to have a /usr/include. The only .h files look
like they were from the kernel.

Warner

[-- Attachment #2: Type: text/html, Size: 2209 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [TUHS] LSX on the PDP-11/03 (LSI-11)
  2020-05-31  6:26 Paul Riley
@ 2020-05-31 12:34 ` ron
  2020-05-31 17:43   ` Warner Losh
  2020-06-01 16:41 ` Heinz Lycklama
  1 sibling, 1 reply; 5+ messages in thread
From: ron @ 2020-05-31 12:34 UTC (permalink / raw)
  To: Paul Riley; +Cc: tuhs


> Anyway, I've tried compiling Hello World on LSX, and I get "1: External
> definition syntax" error. Some help would be nice, but more generally, is
> anyone on this list more than vaguely familiar with LSX, or 6th Edition
> itself?
>
> void main () {
>         printf("Hello World!");
> }
>
> It seems that the 7th Edition was the beginning of the standard library in
> C, and that this is missing in LSX. I'm not sure if printf is an intrinsic
> function in (6th Edition) C, or if it's from a library.
>

First off, VOID MAIN is not legal in any standard version of C.  Even when
the language allows implementation defined extensions to the main
signature, it must still return int.

If you have a later version of language supported, you have to define
printf rather than allowing it default define as an int returning
function.

Add #include <stdio.h>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [TUHS] LSX on the PDP-11/03 (LSI-11)
@ 2020-05-31  6:26 Paul Riley
  2020-05-31 12:34 ` ron
  2020-06-01 16:41 ` Heinz Lycklama
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Riley @ 2020-05-31  6:26 UTC (permalink / raw)
  To: tuhs

[-- Attachment #1: Type: text/plain, Size: 1162 bytes --]

I've managed to acquire a PDP-11/03 with twin floppy drives (Sykes
Datatronics RX01 or RX02 equivalents, not sure yet which).

I've stumbled across LSX, and I have it running on SimH. I'm quite
inexperienced with Unix, but it's something I want to learn well, having
brushed against it at university in the '80s, and having played with Linux
somewhat.

I have some interest in Forth, but I don't like the block system of early
forths such as FigForth, and I plan to create a new Forth based on
FigForth, but supporting external source files.

Anyway, I've tried compiling Hello World on LSX, and I get "1: External
definition syntax" error. Some help would be nice, but more generally, is
anyone on this list more than vaguely familiar with LSX, or 6th Edition
itself?

void main () {
        printf("Hello World!");
}

It seems that the 7th Edition was the beginning of the standard library in
C, and that this is missing in LSX. I'm not sure if printf is an intrinsic
function in (6th Edition) C, or if it's from a library.

My questions are a bit random, but looking to converse with others with LSX
experience.

Paul

*Paul Riley*

Email: paul@rileyriot.com

[-- Attachment #2: Type: text/html, Size: 1770 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-01 16:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31 13:50 [TUHS] LSX on the PDP-11/03 (LSI-11) Paul Ruizendaal
  -- strict thread matches above, loose matches on Subject: below --
2020-05-31  6:26 Paul Riley
2020-05-31 12:34 ` ron
2020-05-31 17:43   ` Warner Losh
2020-06-01 16:41 ` Heinz Lycklama

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).