UP
 
EROS Web
 
Developer Documentation
 
Cross Development Guide
 

The Cross Environment


 
 

This document describes the programs used to generate an initial bootable EROS environment. It provides a brief description of the cross environment and system generation tools.

1. Host Platform

EROS currently builds on Intel-based machines running Linux.

1.1. Hardware

With patience, the current system builds on a 75Mhz 486 portable with 8 megabytes of memory, though we were surely happier after upgrading the memory to 20 megabytes.

A 120 Mhz (or better) Pentium (or better) chip is recommended. Compatible chips are untested, but should build the system without difficulty. We have had no opportunity to test EROS itself on the Cyrix or AMD parts, and look forward to your feedback.

We currently build on systems with as little as 16 megabytes of main memory. 32 megabytes cuts the time required to complete the build nearly in half. 64 megabytes makes it possible to do other things (such as run emacs) without unduly slowing the build. We have seen no appreciable benefit past 64 megabytes. At that point, it would seem that you are better off going for a faster chip.

EROS itself presently supports only (E)IDE drives. The driver should in theory also support older drives, but this is untested. While we will adopt reasonable patches for supporting older drives, we will not put engineering effort into supporting them. SCSI support is planned.

1.2. Operating System

The EROS build environment is currently designed to run on Linux systems. Compatibility with various Linux releases is summarized below. Additions to this list are welcome, and should be sent to the eros-doc alias.

Provider Version Status
RedHat 4.2 Works, modulo transfig out of date
RedHat 5.0 thru 5.2 Works
All others Unknown

While we have not tried to do so, it should not be difficult to make this build environment operate from any UNIX derivative using ELF-based object files and GNU make.

The development group is currently using the RedHat 4.2 and 5.0 releases. If you are running an earlier release of RedHat, it is very much worth upgrading for the sake of improved UNIX security.

With some work the a.out file format could be accomodated, which would facilitate development from FreeBSD or NetBSD. It would be very difficult to facilitate building from Microsoft operating systems, and we have no plans to do so.

Our recommendation, if your circumstances permit it, is to work from Linux, as a rehosted Linux environment will eventually be distributed for the EROS system.

2. The Distribution

The EROS distribution will be available as a gzipped tar image from the EROS Home Page.

2.1. Space Requirements

To build the release, you will need approximately:

Item Mbytes
Release tar files 2.7
Source tree 8.0
Documentation source tree 3.7
Binaries and objects 5.0
Installed Documentation 2.0
Total 21.4

If necessary, the documentation source tree (eros/src/doc can be deleted before building, reducing the overall space requirements to 15.7 megabytes.

2.2. Build Tree Organization

The top level of the build tree is the eros/ directory. This directory may be placed anywhere that is convenient. All makefiles in the build tree locate this directory by referencing the variable EROS_ROOT. In my own case, the build tree sits in my home directory, and the EROS_ROOT variable is set to "/home/shap/eros".

Once built, the next level down in the tree contains several further directories:

eros Build tree root
  cross Cross tools are installed here
  doc Documentation is installed here
  domain EROS 'domain' binaries are installed here, along with their map files (see the build tutorial).
  include Include files are installed here as the build progresses.
  lib Library files are installed here as the build progresses.
  src Where the sources live.

The source tree itself is organized by package:

eros/src Source tree root
  base The kernel, and the core domains and libraries reside here.
  doc The base documentation set lives here.
  legal License and copyright documents liver here.

The documentation tree can be navigated through your web browser. Some browsers do not work correctly unless the document is compacted. We therefore recommend that you install and navigate the eros/doc/www tree, and substitute eros/src/doc/www when you need to locate the corresponding source file.

The base tree is organized as follows:

eros/src/base Base sources root
  cross Source for all cross utilities (except erosinstall) and associated libraries reside here. The erosinstall utility is a shellscript, and can be found in lib/make/ along with the master make rules file.
  domain Source for all EROS domains.
  lib Various libraries used by certain of the EROS domains.
  sys Kernel source tree
  sysimage Master EROS image is built here.
  test-domain Various test domains and performance timing tools.

In most of the source tree, the build occurs directly in the relevant directory. In the kernel subtree, the build occurs in sys/arch/XXX/build/, where XXX varies according to the architecture name.

Other packages, including a port of XFree86 and a Linux rehosting project, are currently underway. Each of these packages has an associated directory under eros/src, and has its own conventions for build tree structure. All of these packages depend on a successfully built base package.

3. Environment Setup

Before building the EROS distribution, two environment variables must be set:

Variable Description
EROS_ROOT Identifies the top of the EROS tree.
EROS_TARGET Indicates the target architecture to be build. The only valid value at this time is i486.
EROS_CONFIG Identifies the kernel configuration that you wish to use. If this variable is not set, it will default to 'DEFAULT' in most of the build tree. This name should be the name of a file in eros/src/base/sys/arch/$(EROS_TARGET)/conf. By convention, all platforms provide a DEFAULT configuration. Other plausible configurations include DEVEL, which includes kernel debugger and assertion checking, and DDB, which includes the kernel debugger, but without assertion checks.

At some point, this list will be expanded to include an environment variable describing the host environment for the build. At present, builds from non-i386 versions of Linux are not supported by the build environment.

In my own build environment, the eros/ directory sits under my home directory. For Bourne shell and bash users, your login-time initialization file should contain:

    EROS_ROOT="${HOME}/eros"
    EROS_TARGET=i486
    EROS_CONFIG=DEFAULT
    export EROS_TARGET EROS_ROOT EROS_CONFIG

Users of csh or tcsh should instead use:

    setenv EROS_ROOT $HOME/eros
    setenv EROS_TARGET i486
    setenv EROS_CONFIG DEFAULT

I have found it useful not to set the EROS_ROOT variable in my .cshrc or .bashrc or equivalent. Once in a while I want to maintain two build trees, and this is rendered impossible if the per-shell configuration file overrides the value of EROS_ROOT. Removing this value from the per-shell configuration file, however, leads to two problems:

  • Under the default configuration, the variable will not be correctly inherited by an emacs session invoked directly from a window manager menu.

  • rsh/ssh can no longer be used to perform remote builds unless the login file or it's equivalent is ``sourced.''

The first problem can be solved by making a small repair to your .xsession file. If you do not have one, it may be necessary to copy /usr/lib/X11/xdm/Xsession to $HOME/.xsession so you can apply this fix.

Change the first line, which reads

    #!/bin/bash

To read:

    #!/bin/bash -login

This will cause your .login file to be read before the window manager is started, after which all of your .login environment variables will be inherited correctly by applications started from the window manager. The fact that the default .xsession file does not do this is a bug

An alternative workaround is to have your .cshrc or .bashrc only set EROS_ROOT if it is not set already. This also solves the rsh/srsh problem.

Both workarounds can safely be applied simultaneously.

3. Building the Distribution

At this point, you can build the distribution. To do so:

    cd $EROS_ROOT/src
    make -k install

If you choose to rebuild the tree you may find some other make targets useful:

make clean Recursively removes all object files.
make -k clobber Recursively removes all object files, binaries, libraries, and links within the build tree.
make nodepend Removes the dependency files which were automatically generated by previous build(s).
make -k clobber nodepend Restores the build tree to pristine status.

4. Generating the Installation Image

Instructions for producing new EROS images can be found in Building an EROS Disk Image. To build the generic installation image, you can now:

    cd $EROS_ROOT/src/base/sysimage
    make -k floppy

This command should be issued with a blank floppy in the floppy drive, and you must have write permission on the floppy drive. If you do not wish to actually write the floppy, you can use:

    cd $EROS_ROOT/src/base/sysimage
    make -k sysvol

This will produce the system volume image, which can be copied to a floppy or hard disk partition using the dd utility.


Copyright 1998 by Jonathan Shapiro. All rights reserved. For terms of redistribution, see the EROS License Agreement