|
|||
Prex Home >
Document Index >
Prex Build Guide
|
You can download the source files at the
download page.
Some binary files may be available there.
The following tools are required to build Prex.
Now, PCC or other compilers can be used for build.
$ cd /usr/src $ tar zxvf prex-X.X.X.tar.gz $ cd prex-X.X.X
$ ./configure --target=x86-pc
$ make
$ export SRCDIR=/usr/src/prex-X.X.X
Cygwin is required to build Prex on Windows environment.
Please note that we can not use the default gcc version included in Cygwin. This is because the pre-compiled gcc in Cygwin is built to generate a native Windows binary (PE format). Since Prex supports only ELF file format, you have to prepare the toolchain for i386-elf with the following steps. (Target Platform is x86-pc here.)
$ cd /usr/src $ tar zxvf binitils-2.15.tar.gz $ tar zxvf gcc-core-3.4.3.tar.gz
Configure and build binutils.
$ mkdir binutils-2.15-i386-elf $ cd binutils-2.15-i386-elf $ ../binutils-2.15/configure --prefix=/usr/local/i386 --target=i386-elf --disable-nls $ make $ make install
You must set the path to this binutils before compiling gcc.
$ export PATH=/usr/local/i386/bin:$PATH $ cd /usr/src
$ mkdir gcc-3.4.3-i386-elf $ cd gcc-3.4.3-i386-elf $ ../gcc-3.4.3/configure --prefix=/usr/local/i386 --target=i386-elf \ --with-gnu-as --with-gnu-ld --disable-nls --enable-languages=c --without-headers \ --without-libs --disable-libssp $ make LANGUAGES="c" $ make LANGUAGES="c" install $ cd /usr/src
$ cd prex-X.X.X $ ./configure --target=x86-pc $ make
$ configure --help
Usage: configure [options]
Options:
--help print this message
--target=TARGET use TARGET for target system
--profile=PROFILE use PROFILE for target profile
--cross-prefix=PREFIX use PREFIX for compile tools
--cc=CC use CC as C compiler
--no-debug disable all debug features
$ _
Switch | Description |
---|---|
_DEBUG_ | All debugging features are enabled by default |
_QUICK_ | Sample applications and test tools are not compiled |
_STRICT_ | Compiler will check code strictly |
_SILENT_ | Output message is reduced during build process. |
If you compile the Prex source with "make" command, the OS boot image is created as "prexos" in the root directory. The file "prexos" must exist in root directory of the Prex disk/ROM. You can test your own Prex image by replacing the "prexos" in the OS boot image. The file "prexos" includes the following files.
The structure of the Prex source directory is as follows:
bsp/ ........ Board Support Package sys/ ........ Prex microkernel usr/ ........ User mode programs include/ .... Common header files conf/ ....... Configuration files mk/ ......... Common makefiles configure ... Configuration script Makefile .... Top level makefile
You can change the various options to adjust the image for your target requirement. The configuration file is prepared for the each target platform. You can modify the options described in the following file.
# # Make options # makeoptions GCCFLAGS+= -march=i386 makeoptions GCCFLAGS+= -mpreferred-stack-boundary=2 # # Memory address # memory LOADER_TEXT 0x00004000 # Start of boot loader memory KERNEL_TEXT 0x80010000 # Start of kernel memory BOOTIMG_BASE 0x80100000 # Location of boot image memory SYSPAGE_BASE 0x80000000 # Location of system page # # Tunable paramters # options HZ=1000 # Ticks/second of the clock options TIME_SLICE=50 # Context switch ratio (msec) options OPEN_MAX=16 # Max open files per process options BUF_CACHE=32 # Blocks for buffer cache options FS_THREADS=4 # Number of file system threads ...
The boot task is a special task which is loaded by kernel directly at boot time. You can specify your own boot task(s) in "TASKS" option in the following file.
# # Boot tasks # TASKS+= $(SRCDIR)/usr/server/boot/boot TASKS+= $(SRCDIR)/usr/server/proc/proc TASKS+= $(SRCDIR)/usr/server/exec/exec TASKS+= $(SRCDIR)/usr/server/fs/fs ...