|
|||
Prex Home > Document Index > Prex Build Guide | |||
Prex Build GuideVersion 1.3.0, 2007/06/20Table of ContentsGetting Source
You can download the source files at the
download page. Compiling PrexStep 1. Prepare ToolchainThe following packages are required for compiling Prex.
Step 2. Unpack SourcesUnpack the sources and move to top level directory of the source tree.$ cd /usr/src $ tar zxvf prex-X.X.X.tar.gz $ cd prex-X.X.X Step 3. ConfigureSetup target architecture and platform. The following sample shows about i386-pc target.$ ./configure --target=i386-pc Step 4. MakeRun make.$ make (Tips)If you want to run 'make' in the subdirectory, you have to set the PREX_SRC as follow.$ export PREX_SRC=/usr/src/prex-X.X.X Compiling on Win32 with CygwinTarget Platform: i386-pcThe gcc on Cygwin generates PE files as Win32 program. However, Prex supports only ELF file format. So, you have to prepare the toolchain for i386-elf with the following steps. Step 1. Install CygwinYou can find the latest Cygwin setup program at this site. Download setup.exe and run it. During Cygwin installation, you have to select at least the following packages in addition to the default selection.
Step 2. Unpack ArchivesYou have to download and unpack the following files.$ cd /usr/src $ tar zxvf binitils-2.15.tar.gz $ tar zxvf gcc-core-3.4.3.tar.gz Step 3. Build BinutilsConfigure 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 Step 4. Build gcc$ 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 Step 5. SetupSet the prefix of the build tools before compiling Prex.$ export CROSS_COMPILE=i386-elf- Customizing OS Boot ImageIf you compile the Prex source with "make" command, the OS boot image is created as "prexos" in "/img" directory. The file "prexos" must exist in root directory of the Prex disk. You can test your own Prex image by replacing the "prexos" in the floppy image. The file "prexos" includes the following files.
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 "TASK=" option in Makefile placed in "/img" directory. |
|||
Copyright© 2005-2007 Kohsuke Ohtani |