[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon, 17 May 2004 07:43:47 +0000 (UTC) 
Subject:Re: FreeBSD Poplog without a Linux Partition (For Bernard) 
From:agley 
Volume-ID: 

Aaron Sloman <A.Sloman@cs.bham.ac.uk> writes:

> My feeling is that plain text is best. Then everyone can read it with
> minimal hassle, using any editor, or things like 'more' or 'less'.
>
> If necessary I can generate simple html from plain text in Ved, to
> make it easier for people to follow links.

    Hi Aaron,
             O.K. here is the document, I will put it inside the e-mail
I don't know what your attachment policy is. I will leave the Cc: to
pop-forum in this time on purpose in case someone can suggest
improvements. I didn't spot the Cc: line in my last mail sorry.
             I posted a first draft to freebsd-emulation@FreeBSD.org
but so far no one has said if they see anything wrong. I have written it
from the point of view of someone completely new to Poplog.


                     How To Build and Run Linux Poplog on FreeBSD

 
         Linux Poplog can be used on FreeBSD with the Linux ABI support
      provided in the GENERIC kernel. See the FreeBSD Handbook and manual
      pages for the gory details. To get this support every time you run
      put,

      linux_enable="YES"

      in your /etc/rc.conf and to ensure that FreeBSD recognises the Poplog
      binaries as Linux use this sysctl variable like so,

      # sysctl kern.fallback_elf_brand=3

      This will have to be repeated upon a reboot. You could just try to
      brand the binaries like this,

      # brandelf -t Linux poplog_binaries

      but maybe some parts of the Poplog system are seen as binaries that I
      don't know about.

          First we have to set up a Linux type system under /compat/linux in
      FreeBSD, we do this by building the ports which give us a RedHat 8 set
      of libraries. This is because of the version of the Linux libc that
      Poplog needs now. At the moment these are,

      /usr/ports/emulators/linux_base-8
      /usr/ports/devel/linux_devtools
      /usr/ports/x11/linux-XFree86-libs

          This will install the following packages,

      linux_base-8-8.0_4   linux_devtools-8.0_1  linux-XFree86-libs-4.3.0_2

          After this we will need to install some things that the Poplog
      installation scripts need, we do this by installing the RedHat RPMS
      for RedHat 8.0 en which can be found at websites like rpmfind. We need,

      tcsh-6.12-2.i386.rpm
      tar-1.13.25-8.i386.rpm
      gzip-1.3.3-5.i386.rpm
      textutils-2.0.21-5.i386.rpm
      util-linux-2.11r-10.i386.rpm
      openmotif-2.2.2-12.i386.rpm    ---  only if you want WITH_MOTIF

          You install them like in this example

      # rpm -i --ignoreos --nodeps --root /compat/linux \
      --dbpath /var/lib/rpm tcsh-6.12-2.i386.rpm

          When you install the util-linux RPM you will get the message
 
      group tty does not exist using root

          This does not seem to worry the installation. Another point is
      that although there is a /compat/linux/usr/tmp directory symlinked
      to /var/tmp the Poplog installation can't use this so we need to
      make another one

      # cd /compat/linux
      # mkdir tmp

          Assuming you have downloaded the large Linux Poplog tarball(21MB) 
      to your home directory and had a look at the documentation available
      at the Birmingham University website to see what should happen lets
      start the installation.
      
          I am going to install everything in the default position and so
       that all users can use Poplog, there is now provision in the build
       scripts to install in other places if you want, see the documentation
       for details. First make a directory under /compat/linux for the
       source and copy the tarball into it.

       # cd /compat/linux/usr
       # mkdir -p /compat/linux/usr/local/poplog/src
       # cd /home/whoever
       # cp -p bham-linux-poplog.tar.gz /compat/linux/usr/local/poplog/src
 
          Now enter into a chrooted environment under /compat/linux to untar
       the sources and run the build scripts. First run the ldconfig program
       for the /compat/linux libraries just in case, this step also seems to
       be able to be done from outside the chroot if needed.

       # cd /compat/linux/usr
       # chroot /compat/linux /bin/bash
       bash2.05b# pwd                      ( just to check )
       /
       bash2.05b# cd /lib
       bash2.05b# /sbin/ldconfig
       bash2.05b# cd /usr/X11R6/lib
       bash2.05b# /sbin/ldconfig
       bash2.05b# cd /usr/local/poplog/src
       bash2.05b# zcat bham-linux-poplog.tar.gz | tar xf -

          You now have the build scripts and some documentation in this
       directory. The docs explain a lot, I will just say that there are two
       ways to build, linked with and without Motif. I recommend with Motif
       if this is your first look at Poplog. So run either,
 
       bash2.05b# ./INSTALL_EVERYTHING_WITH_MOTIF      ( or )
       bash2.05b# ./INSTALL_EVERYTHING_WITHOUT_MOTIF

          There are a lot of errors at the start of the build saying,

       cc1: warning: changing search order for system directory "usr/include"
       as it already has been specified as a non-system directory

          I am told these occur when building Poplog on RedHat 8 or 9 so are
       nothing unusual, other errors that appear are normal for any build.

          Exit out of the chroot and copy the whole Birmingham Poplog set up
       into /usr/local for FreeBSD.

        bash2.05b# exit
        # cd /compat/linux/usr/local/poplog
        # cp -pR /compat/linux/usr/local/poplog /usr/local

           Now Poplog depends heavily on environmental variables and there are
        some example configuration scripts bundled with the documentation but
        I will keep things as simple as possible to get you started. I use a
        C type shell so,

        # cd /usr/local/bin
        # ln -s /usr/local/poplog/local/setup/bin/poplog /usr/local/bin/poplog
        # exit
        > cd
        > rehash
        > setenv usepop /usr/local/poplog/v15.53e
        > setenv poplocal /usr/local/poplog
        > setenv local $poplocal/local
        > source $usepop/pop/com/poplog

           For the other shells
        $ cd
        $ usepop=/usr/local/poplog/v15.53e
        $ export usepop
        $ poplocal=/usr/local/poplog
        $ local=$poplocal/local
        $ export poplocal local
        $ . $usepop/pop/com/poplog.sh
  
           Now open up an xterm and try to start Poplog,
       
        > poplog pop11 %x

        if you used Motif you might see this error printed with the start up
        banner,
       
        Can't open shared object
        /usr/local/poplog/current.poplog/pop/extern/lib/libXm.so
        ( Inappropiate ioctl for device )

          I think what happens here is that I have FreeBSD openmotif installed
        and initially it looks at this but in a few seconds comes good and
        starts up with a Motif control panel and a window for the Xved editor
        with the file temp.p in it.
        
          If you didn't use Motif you might think that the graphical interface
        failed but that is not so, read in a file at the Setpop prompt in your
        xterm, i.e. the full colon by entering the line below and press <RETURN>
 
        Setpop
        : teach teach

         and the graphical editor Xved should start with this teach file and
        and a separate window with the file temp.p in it. In this teach file
        it is explained how to get a control menu up.

            If anything goes wrong or you change your mind about Motif to try
        again it is a simple matter to just remove the untarred Poplog files
        and installation and try again.
        
        # cd /usr/local/bin
        # rm poplog
        # cd /usr/local/poplog
        # rm -rf /usr/local/poplog
        # cd /compat/linux/usr/local/poplog
        # rm -rf /compat/linux/usr/local/poplog

           With or without Motif once you have a window open with the Xved
        editor enter the lines below at the Setpop prompt in your xterm and
        press <RETURN> for each line. This will give you some intuitive
        keyboard keys until you find your feet with Xved configuration.

        Setpop
        : uses oldvedxvedkeys
        : oldvedxvedkeys();

           Once you have done this you can read the documentation in the Xved
        editor window. With a PC keyboard any reference now to the <ENTER> key
        means the enter key on the number pad. Start with these below, when the
        <ENTER> key is pressed the editor will jump to a mini command line at
        top and show your commands there. You will find that there is a sort
        of hyperlink system in the documentation in Xved, some links use Esc-h
        and others show red color and use the mouse.

                       <ENTER> teach teach <RETURN>
                       <ENTER> teach xved <RETURN>
                       <ENTER> teach pop11 <RETURN>

          There you go, you now have a wealth of documentation and examples at
        your disposal to help you learn how to program in the Linux Poplog
        Virtual Machine.


                                     THE END


          Feel free to make changes and improvements you feel might be
needed.

                                    All the best,
                                      John Duncan