I have been trying to understand why it is no longer possible to start the
Popracer package from the linux command line, or from the pop11 prompt,
though it works if read into the editor and compiled there.

I think the problem is due to faulty initialisation of terminal handling in
the early startup phase of V16, whose effects go far beyond Popracer.

I have tested popracer using the latest 32 bit poplog still available
here:

        https://www.cs.bham.ac.uk/research/projects/poplog/latest-poplog/

and it works as expected if run in the popracer directory as:

        pop11 main.p

but in poplog V16 that generates an endless loop repeatedly printing out
the 'Command' prompt (after some instructions have gone off the top of the
screen).

I've confirmed that the problem is not confined to popracer, as I'll try to
explain:

Some input processing invoked from the linux command line works as expected
in V16, e.g.

   % pop11 :"charin()=>"
   : A
   ** 65
   % pop11 :"charin()=>"
   : 0
   ** 48

But not this:

   % pop11 :"readline()=>"

prints the end of stream indicator:

        ** <termin>

Whereas if I use the latest 32 bit poplog (v15.65), available from

        http://www.cs.bham.ac.uk/research/projects/poplog/latest-poplog

then readline()=> behaves as expected -- the '?' input prompt is printed, a
line of text read in, made into a list, and printed out:

        %  pop11 :"readline()=>"
        ? the cat is on the mat
        ** [the cat is on the mat]

However readline works in V16 if readline if it is invoked AFTER the pop11
prompt has been printed (i.e. after Setpop, not on the linux command line):

    % pop11

    Sussex Poplog (Version 16.0 Thu 23 Jan 20:46:14 GMT 2020)
    Copyright (c) 1982-1999 University of Sussex. All rights reserved.

    Setpop
    : readline()=>
    ? this should work
    ** [this should work]

POPRACER EVIDENCE

Popracer should start like this (running the old poplog) given the command:

        % pop11 main.p

     PopRacer v1.08 (c) Team Popcorn 2005 - Loading Modules...Final Release
             by Michael Brook
     * Neural Network and Genetic Algorithm Engine OK
     * Physics Engine OK.
       - Using Gravitional Constant:9.81
       - Using Friction Coefficient:0.002
     * Bezier Engine OK.
       - Track Editor OK.


     Welcome to PopRacer by Team Popcorn 2005
     *** Type help to list commands ***
     Pop Racer Command Line:
     Command?

Typing 'help' then provides available commands.

Several commands can then be given to set up the system before the
evolving/ training begins. It repeatedly waits for new commands (explained
by 'help') and then eventually runs (spectacularly showing racing cars
being evolved/trained to run on a figure 8 circuit).

But in V16 it fails. After printing the instructions, it repeatedly prints
out the Popracer 'Command' prompt:

        pop11 main.p
        ........
        CommandCommandCommandCommandCommandCommandCommandCommandCommandCommandC
        ommandCommandCommandCommandCommandCommandCommandCommandCommandCommandC

And has to be interrupted.

Which means that *readline* is not working at that stage.
        
This must be a problem deep in the system initialisation code

I tried to get some hints from REF SYSTEM, but I think it requires looking
into the source code for system startup, which I don't think I can do, and
in any case don't have time to try in the near future.

Anyone else?

The problem may be in
        $usepop/pop/src/initial.p

or another .p or file in the same directory

or perhaps in one of these two directories (newly created by Waldek, to
separate out architecture specific code from the rest of the system
sources):

        $usepop/pop/src/x86_64/*
        $usepop/pop/src/syscomp/x86_64

(probably not the last as the syscomp directory is concerned with the
problems of building a new system, not running an existing poplog).

That's as far as I can go at present.

I suspect there's a fairly simple change to be made somewhere to restore
the functionality that existed in V15.65

It could be related to the construction of readitem, or itemread, at
startup.

Aaron

Reply via email to