Changeset 96d56b3 in rtems


Ignore:
Timestamp:
Apr 27, 1998, 6:42:04 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
2993cd3f
Parents:
0c508af
Message:

Update from Pedro Romano <pmcnr@…>.

Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/pc386/HOWTO

    r0c508af r96d56b3  
    1 #
    2 #  $Id$
    3 #
    4 
    5 Joel's Note:
    6 
    7 This has some information which is specific to 3.6.0.  Other parts of the
    8 document should be merged with the main RTEMS READMEs.  Procedures for
    9 building a boot floppy, from a network server, and other information
    10 specific to this BSP should remain in this file.
    11 
    12 -----------
    13 
    14 RTEMS PC386 BSP HOWTO:
     1
     2+-----------------------------------------------------------------------------+
     3| RTEMS 4.0.0 PC386 BSP HOWTO - 1998/04/21                                    |
     4+-----------------------------------------------------------------------------+
     5| (C) Copyright 1998 -                                                        |
     6| - NavIST Group - Real-Time Distributed Systems and Industrial Automation    |
     7|                                                                             |
     8| http://pandora.ist.utl.pt                                                   |
     9|                                                                             |
     10| Instituto Superior Tecnico * Lisboa * PORTUGAL                              |
     11+-----------------------------------------------------------------------------+
     12| Disclaimer:                                                                 |
     13|                                                                             |
     14| This file is provided "AS IS" without warranty of any kind, either          |
     15| expressed or implied.                                                       |
     16+-----------------------------------------------------------------------------+
     17
    1518
    16191. Introduction
    1720---------------
    1821
    19     This howto tries to explain how to setup the RTEMS host
    20 environment on a Linux based PC so that RTEMS applications can be
    21 built for and run in a bare PC 386+.
     22    This tries to explain how to setup the RTEMS host environment so
     23that RTEMS applications can be built for and run in a bare PC 386 or
     24above.
     25
     26    It covers essentially the aspects of loading images, since
     27information concerning other issues such as building the development
     28tools and the RTEMS distribution can be found in the 'RTEMS 4.0.0
     29On-Line Library' under 'Getting Started with RTEMS for C/C++ Users'.
    2230
    2331    Please note that everything in the following text using the
     
    2533substituted by the real thing!
    2634
    27 2. Unarchiving
     35
     362. Building the GNU C/C++ Cross Compiler Toolset
     37------------------------------------------------
     38
     39    Obtaining, building and installing the tools for building the
     40PC386 BSP of RTEMS is covered in detail in the 'RTEMS 4.0.0 On-Line
     41Library' -> 'Getting Started with RTEMS for C/C++ Users' -> 'Building
     42the GNU C/C++ Cross Compiler Toolset'.
     43
     44    When running the 'bit' script you should use the 'i386-elf'
     45configuration.
     46
     47
     484. Building RTEMS
     49-----------------
     50    Obtaining, building and installing the tools for building the
     51PC386 BSP is covered in detail in the 'RTEMS 4.0.0 On-Line Library' ->
     52'Getting Started with RTEMS for C/C++ Users' -> 'Building RTEMS'.
     53
     54    When running configure, use the following values for the listed
     55options:
     56
     57      --target=i386-rtems
     58
     59      --enable-rtemsbsp=pc386
     60
     61      --prefix=i386-rtems
     62
     63 
     645. RTEMS Tests
    2865--------------
    2966
    30     Files which have been "tarred, zipped" (i.e. .tar.gz or .tgz
     67    If you've completed the last step successfully, you'll find the
     68RTEMS sample and test files that can be loaded with GRUB in the
     69'<build_point>/pc386/tests' directory, RTEMS sample and test files in
     70a format suitable for use with NetBoot in the
     71'<build_point>/pc386/BootImgs' directory.
     72
     73
     746. Loading RTEMS PC386 applications
     75-----------------------------------
     76
     776.1. Unarchiving
     78----------------
     79
     80    Files which have been "tarred, gzipped" (i.e. .tar.gz or .tgz
    3181extension) may be unarchived with a command similar to one of the
    3282following:
    3383
    34       gzcat <file>.tgz | tar xvof -
     84      zcat <file>.tgz | tar xvof -
    3585
    3686    OR
     
    4090    OR
    4191
    42       gtar xzvf <file>.tgz
    43 
    44     NOTE: gunzip -c is equivalent to gzcat, while gtar is GNU tar.
     92      tar xzvf <file>.tgz
     93
     94    NOTE: gunzip -c is equivalent to zcat. On commercial (non-Linux)
     95Unices, since the GNU utilities are not the standard 'tar' will be
     96gtar (GNU tar) and 'zcat' will be 'gzcat'.
    4597
    4698    Given that the necessary utility programs are installed, any of
    4799the above commands will extract the contents of <file>.tar.gz into the
    48 current directory. All of the RTEMS components will be extracted into
    49 the subdirectory rtems-3.2.0. To view the contents of a component
    50 without restoring any files, use a command similar to the following:
    51 
    52       gzcat <file>.tgz | tar tvf -
    53 
    54 3. The building tools (gcc, binutils, et al.)
    55 ---------------------------------------------
    56 
    57     The PC386 BSP was developed so that the Linux native building
    58 tools can be used to build the RTEMS binaries.
    59 
    60     With this in mind all you have to do is check if you have gcc +
    61 binutils (as, ld, ar, objcopy) installed in your system (which most
    62 probably you'll have) and check their versions. You can do so with:
    63 
    64     - 'gcc -v' (for gcc);      --> version 2.7.2.1
    65     - 'ld -v'  (for binutils). --> version 2.8.1 (with BFD linux-2.8.1.0.1)
    66 
    67     The above mentioned versions of gcc and binutils are almost
    68 certainly guaranteed to work (their the ones we've been using). More
    69 recent versions should also be ok, and older versions may be ok too.
    70 
    71     The only known problem is with older versions of binutils which
    72 still don't have a 'binary' target in 'objcopy'. We need objcopy's
    73 binary target to produce our final binaries (this will probably be
    74 enhanced in the future, so we get them directly from the 'elf32-i386'
    75 object, but for now this is how we do it). There's a possible
    76 workaround this, using older versions of 'objdump' with the flags used
    77 to produce the Linux kernel binary. You can investigate this in the
    78 Linux source makefiles. This hasn't been tested.
    79 
    80     It should be ok to build a cross-compilation environment (gcc +
    81 binutils) that supports the 'elf32-i386' target, so that you can use a
    82 host system other than Linux. This hasn't been tested.
    83 
    84     You can get 'gcc' and 'binutils', both pre-compiled binaries for
    85 Linux and sources from:
    86 
    87     ftp://sunsite.unc.edu/pub/Linux/GCC/
    88 
    89       binutils-2.8.1.0.1.bin.tar.gz
    90       binutils-2.8.1.0.1.tar.gz
    91       gcc-2.7.2.1.bin.tar.gz
    92 
    93 as well as from several other mirrors and sites.
    94 
    95 4. Creating aliases for gcc and the binutils
    96 --------------------------------------------
    97 
    98     The NEWLIB expects to be compiled by a cross-compiler. The easiest
    99 (as far as we could find out) way to do this, short of changing the
    100 configuration files is to make symbolic links from cross-compiler
    101 style names (the usual names with a 'i386-elf32-rtems-' prefix) to the
    102 real name.
    103 
    104     You can use the following shell script to create these links
    105 quickly. It assumes that the native Linux 'gcc' and 'binutils' reside
    106 in their usual place (i.e. '/usr/bin/'). It also assumes that you're
    107 running it in the directory where the aliases will reside (which we
    108 will refer to as <elf32-tools>). You should then add <elf32-tools> to
    109 you path. This is necessary for building the NEWLIB package.
    110 
    111 --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE ---
    112 
    113 #!sh
    114 ln -sf /usr/bin/ar i386-elf32-rtems-ar
    115 ln -sf /usr/bin/as i386-elf32-rtems-as
    116 ln -sf /usr/bin/cpp i386-elf32-rtems-cpp
    117 ln -sf /usr/bin/gasp i386-elf32-rtems-gasp
    118 ln -sf /usr/bin/gcc i386-elf32-rtems-gcc
    119 ln -sf /usr/bin/ld i386-elf32-rtems-ld
    120 ln -sf /usr/bin/objcopy i386-elf32-rtems-objcopy
    121 ln -sf /usr/bin/objdump i386-elf32-rtems-objdump
    122 ln -sf /usr/bin/ranlib i386-elf32-rtems-ranlib
    123 
    124 --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE ---
    125  
    126 5. Building Newlib
    127 ------------------
    128 
    129     The next step is to build and install the NEWLIB package. The
    130 version we've been using and have tested is:
    131 
    132       newlib-1.7.0-posix-rtems-3.6.0.tgz
    133 
    134     You can get it from:
    135 
    136       ftp://lancelot.gcs.redstone.army.mil/pub/rtems/releases/current/c/
    137 
    138     After unarchiving the NEWLIB distribution (discussed earlier), the
    139 NEWLIB package must be configured for the desired host and target.
    140 
    141     This is accomplished by changing the current directory to the top
    142 level of the NEWLIB source tree and executing the configure script
    143 with the appropriate arguments. This step configures the NEWLIB source
    144 for the 'i386-elf32-rtems' target configuration. The libraries and
    145 include files will be installed at <install_point>. The --verbose
    146 option to the ./configure script is recommended so you can check how
    147 the configuration process is progressing. Meanwhile we must do a
    148 little patching: 'install.sh' and 'config.sub' are missing from the
    149 'libgloss' sub-directory. A command sequence similar to the following
    150 should be used:
    151 
    152       cd newlib-<NEWLIB_Version>
    153 
    154       cp configure.sub libgloss
    155       cp install.sh libgloss
    156 
    157       CC=gcc CFLAGS="-O4 -g" ./configure --verbose \
    158              --target=i386-elf32-rtems \
    159              --prefix=<install_point>
    160 
    161     If the configure script successfully completes, then NEWLIB may be
    162 built. This step builds the NEWLIB package in the local directory and
    163 does NOT install any files. The example commands specifies that gcc
    164 should be used as the C compiler and the arguments to be used by gcc.
    165 
    166     A command similar to the following should be used:
    167 
    168       make CC="gcc" CFLAGS="-O4 -g"
    169 
    170     If the build process successfully completes, then the NEWLIB
    171 package is ready to install. A command similar to the following should
    172 be used:
    173 
    174       make CC="gcc" CFLAGS="-O4 -g" install
    175 
    176     If this successfully completes, then the NEWLIB package has been
    177 installed at <install_point>.
    178 
    179     The documentation for the NEWLIB package is formatted using
    180 TeX. If TeX and some supporting tools are installed on the development
    181 system, then the following command may be used to produce the
    182 documentation in the "DVI" format:
    183 
    184       gmake CC="gcc" CFLAGS="-O4 -g" dvi
    185 
    186     If while the documentation is being formatted, the message "Cross reference values unknown; you must run TeX again." is printed, then the "DVI" files generated by this command (e.g. *.dvi in every subdirectory with documentation) must be removed and the command reexecuted.
    187 
    188 6. Modules
    189 ----------
    190 
    191     Modules eases the process of manipulating the environment
    192 variables required to build RTEMS. If, for whatever reason, you do not
    193 wish to use Modules, then it will be necessary to manually modify
    194 shell initialization files and set the required RTEMS shell variables
    195 "manually." In this case, the Modules files are still the best place
    196 to look for information on what variables to set and example values.
    197 
    198     The Modules package was utilized by the RTEMS developers to make
    199 the initialization process shell independent. The Modules files used
    200 by the RTEMS developers to configure their user environment while
    201 working on a particular target board are included in the
    202 distribution. These require only simple modifications to be
    203 "localized" for the RTEMS developer. The modifications to these ASCII
    204 files can be made with an editor such as vi or emacs.
    205 
    206     The Modules Homepage is:
    207 
    208       http://www.modules.org/
    209 
    210     You can get the Modules distribution (the latest version, which
    211 we've been using, is '3.0pre') via the homepage or directly from:
    212 
    213       ftp://ftp.modules.org/pub/distrib/Modules-3.0pre.tar.gz
    214 
    215 
    216     6.1. New Modules users
    217     ----------------------
    218 
    219     Install Modules on the development system following the
    220 instructions in the file README in the main Modules directory. When
    221 Modules has been installed and a user account setup to use Modules,
    222 then proceed to the section Current Modules Users.
    223 
    224     6.2. Current Modules users
    225     --------------------------
    226 
    227     If the host computer already utilizes the Modules package, then
    228 the assistance of the system administrator responsible for the Modules
    229 package will be required to perform the modifications described below.
    230 
    231     The system administrator must integrate the RTEMS modules into the
    232 existing Modules configuration. A first alternative is to copy all of
    233 the module files provided with RTEMS into an existing modulefiles
    234 directory. This requires that future updates of RTEMS modules will
    235 also have to be integrated into the existing modulefiles
    236 directory. This alternative is not recommended.
    237 
    238     The more preferable alternative is to add the RTEMS modulefiles
    239 directory to the MODULEPATH. This can be accomplished on an individual
    240 user or system wide basis. For individual users, the RTEMS modules
    241 directory can be added to the MODULEPATH of those users requiring
    242 access to RTEMS. The default MODULEPATH is established by the Modules
    243 initialization routine. Thus, the RTEMS modules directory must be
    244 added to the MODULEPATH in the user's shell initialization file
    245 (~/.profile or ~/.cshrc for example) following the Modules
    246 initialization statement. The proper way to accomplish this is to use
    247 the Modules use statement. For example, the following line should be
    248 added to the user's shell initialization file:
    249 
    250       module use <rtems_path>/modules/modulefiles
    251 
    252     For system wide access, the RTEMS modulefiles directory can be
    253 added to each of the shell initialization scripts in the existing
    254 Modules package. This will require modifying the initialization of
    255 MODULEPATH in each shell initialization file.
    256 
    257     After integrating RTEMS modules with the existing modules, one may
    258 proceed to the Configuring An RTEMS User section.
    259 
    260 7. RTEMS
    261 --------
    262 
    263     You can get the latest free release of the C distribuition of
    264 RTEMS (version 3.6.0), from:
    265 
    266       ftp://lancelot.gcs.redstone.army.mil/pub/rtems/releases/current/c/
    267 
    268     Where you'll find:
    269 
    270       rtems-3.6.0.tgz    or    rtems-c_src.tgz - RTEMS sources;
    271 
    272       rtems-3.5.1-c_doc.tgz or rtems-c_doc.tgz - RTEMS documentation;
    273 
    274       individual_manuals/ - Sub-directory where you can get the
    275                             manuals individually.
    276 
    277     Please note that the RTEMS documentation is slightly outdated
    278 (most noticeably some RTEMS primitives have different protoypes) since
    279 it refers to the previous release (3.5.1.) of RTEMS.
    280 
    281     After unarchiving the RTEMS distribution (discussed earlier), it
    282 is necessary to add the PC386 BSP to the source tree. This is done in
    283 two steps.
    284 
    285     The first step consists in unarchiving the
    286 'rtems-3.6.0-PC386-BSP.tgz' archive over the standard rtems-3.6.0
    287 distribution. It should be done in the same directory where
    288 'rtems-3.6.0.tgz' was unarchived.
    289 
    290     Next you'll need to apply the patch in
    291 'rtems-3.6.0-PC386-BSP.diff.gz' to the RTEMS source tree. The
    292 following command should be used:
    293 
    294       gzip -d -c rtems-3.6.0-PC386-BSP.diff.gz | patch
    295 
    296 also from the same directory where 'rtems-3.6.0.tgz' was unarchived.
    297 
    298     At this stage we have RTEMS + PC386 BSP, the user environment must
    299 be setup to build and install RTEMS.
    300 
    301     Using this process, you'll know which files are patched and which
    302 files are new.
    303 
    304     7.1. Board Support Package
    305     --------------------------
    306 
    307     A Board Support Package (BSP) is a collection of device drivers,
    308 initialization code, and linker scripts necessary to execute RTEMS on
    309 a particular target board. The minimum set of device drivers for a
    310 single processor target includes a Clock, Console I/O, and Benchmark
    311 Timer device drivers.
    312 
    313     The source code for the PC386 BSP can be found in the directory 'c/src/lib/libbsp/i386/pc386.
    314 
    315     7.2. Makefile Configuration Files
    316     ---------------------------------
    317 
    318     There are two target specific configuration files used by the
    319 Makefile system. These configuration files specify detailed
    320 information about the toolset, the compilation process, as well as
    321 some general configuration information regarding the target and the
    322 development environment. The following is a list of these
    323 configuration files:
    324 
    325       c/make/compilers/gcc-pc386.cfg
    326 
    327       c/make/custom/pc386.cfg
    328 
    329     If you're compiling to a i386+ with FPU in a standard Linux
    330 environment, you shouldn't require any changes to these files in order
    331 to build RTEMS (though you'll probably want to fine tune them later
    332 on).
    333 
    334     7.3 Creating a Customized Modules File
    335     --------------------------------------
    336 
    337     Files which the Modules packages may use to customize a user's
    338 environment for building, installing, and modifying RTEMS are found in
    339 the c/Modules/rtems directory. Each of the files in this directory
    340 corresponds to the configuration used by the RTEMS developers for
    341 building and installing RTEMS for a particular target board. These
    342 files contain the Modules commands necessary to set the following
    343 environment variables:
    344 
    345        Variable                      Description
    346 
    347       RTEMS_BSP            The name of the target BSP (e.g.
    348                                  mvme136 or cvme961).
    349 
    350       RTEMS_ROOT        The full path of root directory of the
    351                                   RTEMS source code.
    352 
    353     RTEMS_GNUTOOLS     The full path of the root directory for
    354                          the cross-development toolset to be
    355                                         used.
    356 
    357       RTEMS_HOST         The name of the operating system for
    358                                the development system.
    359 
    360     RTEMS_LIBC_DIR     The full path of the root directory for
    361                           the Standard C Library to be used.
    362 
    363 
    364     The Modules file for the PC386 BSP is: 'c/Modules/rtems/nav-pc386'.
    365 
    366     You MUST edit this file and set the following variables to the
    367 correct values in your system:
    368 
    369       - RTEMS_ROOT;
    370       - RTEMS_GNUTOOLS (this is the directory where the links in 4.
    371                         were created);
    372       - RTEMS_LIBC_DIR (this is the directory where the Newlib target
    373                         specific root is installed, and with reference
    374                         to 5. should be '<install_point>/i386-elf32-rtems').
    375  
    376     7.4 Configuring an RTEMS User Using Modules
    377     -------------------------------------------
    378 
    379     Each user building and installing RTEMS must have their
    380 environment configured. The user environment must have a set of
    381 variables set in it which indicate the target BSP, host operating
    382 system, and numerous paths.
    383 
    384     If you'll just be using the PC386 BSP then a line of the following
    385 type may be added to the initialization file for your shell after the
    386 Modules initialization statement.
    387 
    388      module load nav-pc386
    389 
    390     Note that you must logout and login before any changes to the shell
    391 initialization files will take effect.
    392 
    393     If you don't wish the RTEMS environment configuration to be added
    394 to your shell initialization file, then the "module load" statement
    395 may be entered at the command line.
    396 
    397     You may switch from one RTEMS configuration to another with either
    398 of the following command sequences:
    399 
    400       module unload <old_rtems_modulefile>
    401       module load <new_rtems_modulefile>
    402 
    403     OR
    404 
    405       module switch <old_rtems_modulefile> <new_rtems_modulefile>
    406 
    407     The command "module avail" may be used to obtain a list of the
    408 Module files which are available to be loaded using the "module load"
    409 command.
    410 
    411     The command "module list" provides a list of the currently loaded
    412 Modules.
    413  
    414     7.5. Building RTEMS
    415     -------------------
    416 
    417     See the file README.configure in the top level directory for
    418     more information.
    419 
    420 
    421 8. RTEMS Tests
    422 --------------
    423 
    424     If you've completed the last step successfully, you'll find the
    425 RTEMS sample and test files in the 'c/pc386_i386/tests' directory.
    426 
    427     The 'sp*.bt' are the single processor tests and should all work
    428 correctly. The same applies to the 'tm*.bt' which are the timing
    429 tests.
    430 
    431     The other sample ('*.bt') files should also work with the
    432 exception of 'spfatal.bt' and 'stackchk.bt' (see 9.).
    433 
    434 8.1  Using Diskboot or NetBoot
    435 ------------------------------
    436     To load the '*.bt' files you can either run the 'diskboot.exe'
    437 (which can be found in 'c/pc386_i386/build-tools') under DOS with a
    438 command line like (this is just a quick and dirty loader - you'll have
    439 to press return twice after entering it):
    440 
    441       diskboot sp01.bt
     100current directory. To view the contents of an archive without
     101restoring any files, use a command similar to the following:
     102
     103      zcat <file>.tgz | tar tvf -
     104
     105
     1066.2 Using GRUB to load RTEMS PC386 applications
     107-----------------------------------------------
     108
     109    Using GRUB (GRand Unified Bootloader) is the simplest way to load
     110and run your PC386 BSP samples, tests and programs.
     111
     112    You can get the latest release of GRUB from its homepage:
     113
     114    - http://www.uruk.org/grub/
     115
     116or alternatively by ftp from:
     117
     118    - ftp://ftp.uruk.org/public/grub/
     119
     120    Once you obtain the .tar.gz archive 'grub-0.4.tar.gz', change to a
     121temporary directory (you won't need the grub files after this and can
     122just go ahead and delete the whole directory structure that was
     123generated) and unarchive 'grub-0.4.tar.gz' following the instructions
     124given above in [2. Unarchiving].
     125
     126    After this is done change the directory to:
     127
     128      grub-0.4/bin_std
     129
     130and there you'll find the two files you'll need from this archive:
     131'stage1' and 'stage2'.
     132
     133    You should have two (2) formatted diskettes available. One of
     134these will only be used temporarily to create the other one, and we'll
     135refer to it as 'RAW GRUB' diskette (you can label it accordingly if
     136you wish). The other diskette, which we will refer to as 'GRUB FS'
     137should be high-level formatted with one of GRUB's supported file
     138systems, which are: DOS FAT, BSD FFS, and Linux ext2fs.
     139
     140    A DOS FAT diskette can, obviously, be created under DOS with the
     141'FORMAT' command. Under Linux, the following commands are available to
     142add file systems to low-level formatted diskettes:
     143
     144    1. To add a DOS FAT file system to a low-level formatted diskette:
     145
     146      a) If you have mtools installed:
     147
     148           'mformat a:'.
     149
     150      b) Assuming that you are formatting the diskette in the first
     151         floppy disk drive ('/dev/fd0' under Linux):
     152
     153           'mkdosfs /dev/fd0' or
     154
     155           'mkfs.msdos /dev/fd0'.
     156
     157    2. To add a Linux ext2fs file system to a low-level formatted
     158       diskette, assuming that you are formatting the diskette in the
     159       first floppy disk drive ('/dev/fd0' under Linux):
     160
     161         'mke2fs /dev/fd0' or
     162
     163         'mkfs.ext2 /dev/fd0'.
     164
     165   Next we will install using 'rawrite' or 'dd' to the 'GRUB RAW'
     166diskette.
     167
     168   NOTE: This will destroy any data currently on the diskette.
     169
     170   Execute your OS's equivalent of (this should work for recent
     171FreeBSD versions and Linux just fine):
     172
     173     dd if=stage1 of=/dev/fd0 bs=512 count=1
     174     dd if=stage2 of=/dev/fd0 bs=512 seek=1
     175
     176   Under DOS/Windows/NT, courtesy of Eric Hanchrow (erich@microsoft.com):
     177
     178     * Use the copy /b command to binary concatenate the stage1 and
     179       stage2 files together via:
     180
     181         copy /b stage1 stage2 grub.raw
     182
     183     * Use rawrite.exe (which is available in many places on the net and
     184       in some Linux distributions) to write grub.raw to a diskette.
     185
     186   Next stage: copy the 'stage1' and 'stage2' files to the 'GRUB FS'
     187diskette (if you are using Linux you can mount the diskette in an
     188appropriate mount point and then 'cp' the files to it, if it is either
     189a DOS FAT or an EXT2FS diskette, or in the case of a DOS FAT diskette
     190you can use 'mcopy' from 'mtools'.)
     191
     192   After this is done boot a PC using the 'GRUB RAW' diskette. After
     193this is done, you will get GRUB's command line interface. Exchange
     194'GRUB RAW' with the 'GRUB FS' diskette in the drive and issue the
     195following command from GRUB's prompt:
     196
     197     install=(fd0)/stage1 (fd0) (fd0)/stage2 0x8000 (fd0)/grubmenu
     198
     199   This command will make the 'GRUB FS' diskette bootable. After this
     200is done, you won't require the 'GRUB RAW' diskette anymore and you can
     201delete the 'stage1' file from the 'GRUB FS' diskette.
     202
     203   Next copy all the files you wish to load to the diskette. The GRUB
     204loadable test and sample files in the RTEMS distribution have '.exe'
     205extension and can be found under the build point in the 'pc386/tests'
     206directory. You can compress this files with gzip to save space if you
     207wish. GRUB loads 'gzipped' files transparently.
     208
     209   Finally you have to create a GRUB menu configuration file. We will
     210call this file 'grubmenu'. You can call it anything as long as you use
     211the correct name in the 'install' command where we used 'grubmenu'.
     212
     213   The 'grubmenu' file, as far as we are interested has the following
     214syntax:
     215
     216     title=  Hello World Test
     217     kernel= (fd0)/hello.exe.gz
     218
     219   You can add as many of this entries as you want to the 'grubmenu'
     220file. There should be one for each program you wish to load. The
     221'title=' line provides a description for the program that will appear
     222after boot in the GRUB menu for the user to choose and the 'kernel='
     223line describes where the file can be found by GRUB (you should leave
     224the '(fd0)/' part and just substitute the rest if you've copied the
     225files to the root directory of the diskette.
     226
     227   Just boot the PC with the 'GRUB FS' diskette and you will be able
     228to choose which program you want to load from GRUB's menu.
     229
     230   The GRUB documentation is available in HTML format in the 'docs'
     231directory of the GRUB tree starting with the 'index.html' file.
     232
     233
     2346.3  Using NetBoot to load RTEMS PC386 applications
     235---------------------------------------------------
     236
     237    To load the '*.bt' files you can
    442238
    443239    Alternatively, if you have a PC connected to a network with a
    444240BOOTP server and a TFTP server (this can very well be you're Linux
    445 RTEMS host system), you can use Gero Kuhlmann's netboot loader, to
     241RTEMS host system), you can use Gero Kuhlmann's NetBoot loader, to
    446242load RTEMS to a diskless PC across a network. You can get it from:
    447243
    448       ftp://sunsite.unc.edu/pub/Linux/system/boot/netboot-0.7.2.tar.gz
    449 
    450     Follow the instructions contained in the package to setup the
     244      ftp://sunsite.unc.edu/pub/Linux/system/boot/netboot-0.7.3.tar.gz
     245
     246or in any of Sunsite's mirrors. It is also available from NetBoot's
     247homepage:
     248
     249      http://www.han.de/~gero/netboot
     250
     251    After unarchiving 'netboot-0.7.3.tar.gz' you should change to the
     252base directory of this and run:
     253
     254      ./configure --disable-mknbi-dos --disable-mknbi-linux --disable-mknbi-mgl
     255
     256    Afterwards, you should follow the instructions contained in the
     257'INSTALL' file also contained in the base directory, on how to setup the
    451258server(s) and to build a boot ROM for the client PC network card, or a
    452 boot diskette, and the client should be able to load the '*.bt' files
     259boot diskette, and the PC client should be able to load the '*.bt' files
    453260from the server.
    454261
    455     For the network loader every relocation address from 0x10200 to
    456 0x80200 are known to work correctly. For the DOS loader, relocation
    457 addresses 0x20200, 0x40200 and 0x80200 are known to work under DOS
    458 5.00, DOS 6.xx and DOS 7.00. You can set the relocation address in
    459 'c/make/compilers/gcc-pc386.cfg' by setting the value of the
    460 'RELOCADDR' variable.
    461 
    462 8.2  Using GRUB
    463 ---------------
    464 
    465 GRUB is another boot loader which may be used with pc386.  It is
    466 available from:
    467 
    468   ftp://ftp.uruk.org/public/grub/
    469   http://www.uruk.org/grub/
     262    The important sections to check in the 'INSTALL FILE' are the last two:
     263
     264    - Setup of the server (only the BOOTP and TFTP parts - ignore NFS).
     265      ===================
     266
     267    - Setup of the client including building the bootrom
     268      ==================================================
     269
     270all the rest can be safely ignored if you don't care to examine it.
    470271
    471272 
    472 9. Important Notes
    473 ------------------
    474 
    475     The optional stack checker extension ('stackchk') doesn't seem to
    476 be working properly. It reports blown task stacks even if everything
    477 seems to work properly when 'stackchk' isn't activated... This should
    478 be properly investigated: the problem can reside with the 'PC386 BSP',
    479 or in the interface between 'stackchk' and the BSP (maybe something
    480 isn't being correctly initialized...). Since this doesn't seem to be a
    481 serious BSP problem, it hasn't been dealt with, due to more prioritary
    482 problems.
    483 
    484     The tests which exercise the fatal error mecanisms don't work
    485 correctly either. I've been told by Joe that 'spfatal' is outdated, and
    486 so this really isn't surprising.
    487 
    488     This issues may be important and should be investigated as soon as
    489 possible.
     2737. Technical Information
     274------------------------
     275
     276    NOTE: All the following paths are relative to the base directory
     277of the RTEMS distribution.
     278
     279    As of the writing of this HOWTO, PC386 images can be loaded either
     280in low memory 0x10000 (64KB) until 0x97C00 (607K) using NetBoot or in
     281high memory from 0x100000 (1024KB) until the top of the available
     282memory using either NetBoot or GRUB.
     283
     284    If you want to change the default loading address from 1024KB to
     285something else, just change the value of the variable RELOCADDR in the
     286'make/custom/pc386.cfg' file to the new value you want (make sure you
     287follow the instructions indicated before the definition of RELOCADDR).
     288
     289    Remember that GRUB restricts the loading addresses to values above
     2900x100000 (1024KB), only NetBoot can load images in low memory.
     291
     292    After you make any changes to RELOCADDR and if you are using
     293NetLoader, you'll have to recompile the
     294'c/src/lib/libbsp/i386/pc386/start/start16.s' file. The easiest way to
     295achieve this is just to 'make clean' and the 'make all' again. The
     296quickest way is to change to
     297'<build_point>/c/src/lib/libbsp/i386/pc386/start' and 'make
     298RTEMS_BSP=pc386 clean all'.
    490299
    491300    When programming interrupt handlers take into account that the PIC
    492301is reprogrammed and so you should use the interface functions provided
    493 to garantee that everything works ok.
     302in '<build_point>/pc386/lib/include/irq.h> to guarantee that everything
     303works ok.
  • c/src/lib/libbsp/i386/pc386/bsp_specs

    r0c508af r96d56b3  
    2020
    2121*link:
    22 %{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start}
     22%{!qrtems: %(old_link)} %{qrtems: -dc -dp -N -e start --oformat=elf32-i386}
    2323
  • c/src/lib/libbsp/i386/pc386/console/inch.c

    r0c508af r96d56b3  
    233233_IBMPC_chrdy(char *c)
    234234{
     235  /* FIX ME!!! It doesn't work without something like the following line.
     236     Find out why! */
     237  printk("");
     238
    235239  /* Check buffer our ISR builds */
    236240  if (kbd_first != kbd_last)
  • c/src/lib/libbsp/i386/pc386/include/bsp.h

    r0c508af r96d56b3  
    5353| Memory related constants.
    5454+--------------------------------------------------------------------------*/
    55 #ifdef RTEMS_SMALL_MEMORY                /* We only have low (640K) memory.   */
    56 
    57 #define RAM_START 0x00000
    58 #define RAM_END   0xA0000
    59 
    60 #else                                    /* We have at least 2048K of memory. */
    61 
    62 #define RAM_START 0x100000
    63 #define RAM_END   0x200000
    64 
    65 #endif /* RTEMS_SMALL_MEMORY */
    66 
    6755#define HEAP_SIZE 64  /* Size of libc Heap (used for malloc et al) in KBytes. */
    6856
  • c/src/lib/libbsp/i386/pc386/start/Makefile.in

    r0c508af r96d56b3  
    99PROJECT_ROOT = @PROJECT_ROOT@
    1010
    11 PGMS=${ARCH}/start.o
     11PGMS=${ARCH}/start.o ${ARCH}/start16.bin
    1212
    1313# C source names, if any, go here -- minus the .c
     
    1919
    2020# Assembly source names, if any, go here -- minus the .s
    21 S_PIECES=start
     21S_PIECES=start16 start
    2222S_FILES=$(S_PIECES:%=%.s)
    2323S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o)
     
    5151CLOBBER_ADDITIONS +=
    5252
    53 all:    ${ARCH} $(SRCS) $(OBJS) $(PGM)
     53all:    ${ARCH} $(SRCS) $(OBJS) $(PGMS)
    5454        $(INSTALL_VARIANT) -m 555 ${PGMS} ${PROJECT_RELEASE}/lib
    5555
    5656# Install the program(s), appending _g or _p as appropriate.
    5757# for include files, just use $(INSTALL)
     58
     59LINKCMDS=$(srcdir)/../startup/linkcmds
     60
     61${ARCH}/start16.o: start16.s
     62        sed -e 's/\/\/.*$$//' < $< | $(CPP) $(ASMFLAGS) -I. -I$(srcdir) \
     63          -DASM -DSTART32ADDR=$(RELOCADDR) - > $*.i
     64        $(AS) $(ASFLAGS) -o $@ $*.i
     65
     66${ARCH}/start16.bin: ${ARCH}/start16.o
     67        $(LD) -N -T $(LINKCMDS) -Ttext $(START16ADDR) -e start16 -nostdlib \
     68          --oformat=elf32-i386 -o $(basename $@).obj $(basename $@).o
     69        $(OBJCOPY) -O binary $(basename $@).obj $@
     70
  • c/src/lib/libbsp/i386/pc386/start/start.s

    r0c508af r96d56b3  
    3131| **************************************************************************
    3232|
    33 | Also based on (from the Linux source tree):
    34 |   video.S - Copyright (C) 1995, 1996 Martin Mares <mj@k332.feld.cvut.cz>
    35 |
    3633|  $Id$
    3734+--------------------------------------------------------------------------*/
     
    3936
    4037#include "asm.h"
    41 
    42 /*----------------------------------------------------------------------------+
    43 | Constants
    44 +----------------------------------------------------------------------------*/
    45 
    46 #ifdef pc386
    47 
    48 .set PROT_CODE_SEG, 0x08        # offset of code segment descriptor into GDT
    49 .set CR0_PE,        1           # protected mode flag on CR0 register
    50 
    51 #endif /* pc386 */
    5238
    5339/*----------------------------------------------------------------------------+
     
    6046
    6147/*----------------------------------------------------------------------------+
     48| Size of heap and stack:       
     49+----------------------------------------------------------------------------*/
     50
     51.set HEAP_SIZE,  0x2000
     52.set STACK_SIZE, 0x1000
     53
     54/*----------------------------------------------------------------------------+
    6255| CODE section
    6356+----------------------------------------------------------------------------*/
     
    7366SYM (start):
    7467
    75 /*----------------------------------------------------------------------------+
    76 | Switch VGA video to 80 lines x 50 columns mode. Has to be done before turning
    77 | protected mode on since it uses BIOS int 10h (video) services.
    78 +----------------------------------------------------------------------------*/
    79 
    80 #if defined(pc386) && defined(RTEMS_VIDEO_80x50)
    81        
    82 .code16
    83 
    84         movw    $0x0003, ax     # forced set
    85         int     $0x10
    86         movw    $0x1112, ax     # use 8x8 font
    87         xorb    %bl, %bl
    88         int     $0x10
    89         movw    $0x1201, ax     # turn off cursor emulation
    90         movb    $0x34, %bl
    91         int     $0x10
    92         movb    $0x01, ah       # define cursor (scan lines 0 to 7)
    93         movw    $0x0007, cx
    94         int     $0x10
    95 
    96 .code32
    97 
    98 #endif /* pc386 && RTEMS_VIDEO_80x50 */
    99 
    10068        nop
    10169        cli                     # DISABLE INTERRUPTS!!!
    10270
    10371/*----------------------------------------------------------------------------+
    104 | Bare PC machines boot in real mode! We have to turn protected mode on.
    105 +----------------------------------------------------------------------------*/
    106 
    107 #ifdef pc386
    108 
    109         data16
    110         movl    $ SYM(gdtptr), eax
    111         data16
    112         andl    $0x0000ffff, eax        # get offset into segment
    113         addr16
    114         lgdt    cs:(eax)                # load Global Descriptor Table
    115         data16
    116         movl    $ SYM(idtptr), eax
    117         data16
    118         andl    $0x0000ffff, eax        # get offset into segment
    119         addr16
    120         lidt    cs:(eax)                # load Interrupt Descriptor Table
    121        
    122         movl    %cr0, eax
    123         data16
    124         orl     $CR0_PE, eax
    125         movl    eax, %cr0               # turn on protected mode
    126 
    127         data16
    128         ljmp    $PROT_CODE_SEG, $ SYM(next)     # flush prefetch queue
    129 
    130 SYM(next):
    131 
    132 #endif /* pc386 */
    133 
    134 /*----------------------------------------------------------------------------+
    13572| Load the segment registers (this is done by the board's BSP) and perform any
    13673| other board specific initialization procedures.
     
    15087
    15188        movl    $_end, eax              # eax = end of bss/start of heap
    152         addl    $heap_size, eax         # eax = end of heap
     89        addl    $HEAP_SIZE, eax         # eax = end of heap
    15390        movl    eax, stack_start        # Save for brk() routine
    154         addl    $stack_size, eax        # make room for stack
     91        addl    $STACK_SIZE, eax        # make room for stack
    15592        andl    $0xffffffc0, eax        # align it on 16 byte boundary
    15693        movl    eax, esp                # set stack pointer
     
    263200        je      SYM (no_idt_load)       # NO, then branch
    264201        lidt    SYM (_New_IDTR)         # load the new IDT
     202
    265203SYM (no_idt_load):
    266204
     
    316254BEGIN_DATA
    317255
    318 #ifdef pc386
    319 
    320 /**************************
    321 * GLOBAL DESCRIPTOR TABLE *
    322 **************************/
    323 
    324         .align  4
    325 SYM(gdtptr):
    326         /* we use the NULL descriptor to store the GDT pointer - a trick quite
    327            nifty due to: Robert Collins (rcollins@x86.org) */
    328         .word   gdtlen - 1
    329         .long   gdtptr
    330         .word   0x0000
    331 
    332         /* code segment */
    333         .word   0xffff, 0
    334         .byte   0, 0x9f, 0xcf, 0
    335 
    336         /* data segment */
    337         .word   0xffff, 0
    338         .byte   0, 0x93, 0xcf, 0
    339 
    340         .set    gdtlen, . - gdtptr      # length of GDT
    341        
    342 /*************************************
    343 * INTERRUPT DESCRIPTOR TABLE POINTER *
    344 *************************************/
    345 
    346         .align  4
    347 SYM(idtptr):
    348         .word   0x07ff  # limit at maximum (allows all 256 interrupts)
    349         .word   0, 0    # base at 0
    350 
    351 #endif /* pc386 */
    352 
    353256        EXTERN (Do_Load_IDT)    # defined in the BSP
    354257        EXTERN (Do_Load_GDT)    # defined in the BSP
     
    371274BEGIN_BSS
    372275
    373         PUBLIC (heap_size)
    374         .set    heap_size, 0x2000
    375 
    376         PUBLIC (stack_size)
    377         .set    stack_size, 0x1000
     276        PUBLIC (_heap_size)
     277SYM (_heap_size):
     278        .long   HEAP_SIZE
     279
     280        PUBLIC (_stack_size)
     281SYM (_stack_size):
     282        .long   STACK_SIZE
    378283
    379284        PUBLIC (Interrupt_descriptor_table)
     
    391296        PUBLIC (_Global_descriptor_table)
    392297SYM (_Global_descriptor_table):
    393 #ifdef pc386
    394        
    395298        .space (3 * 8)  # the PC386 bsp only needs 3 segment descriptors:
    396 #else                   #   NULL, CODE and DATA
    397         .space (8192 * 8)
    398        
    399 #endif /* pc386 */
    400 
     299                        #   NULL, CODE and DATA
    401300        PUBLIC (_Original_GDTR)
    402301SYM (_Original_GDTR):
  • c/src/lib/libbsp/i386/pc386/startup/bspstart.c

    r0c508af r96d56b3  
    4242| Global Variables
    4343+--------------------------------------------------------------------------*/
    44 #ifdef RTEMS_SMALL_MEMORY
    4544extern rtems_unsigned32 _end;           /* End of BSS. Defined in 'linkcmds'. */
     45extern rtems_unsigned32 _heap_size;   /* Size of stack. Defined in 'start.s'. */
     46extern rtems_unsigned32 _stack_size;  /* Size of heap. Defined in 'start.s'.  */
    4647
    47 rtems_unsigned32 rtemsFreeMemStart = (rtems_unsigned32)&_end;
     48rtems_unsigned32 rtemsFreeMemStart;
    4849                         /* Address of start of free memory - should be updated
    4950                            after creating new partitions or regions.         */
    50 #else
    51 rtems_unsigned32 rtemsFreeMemStart = RAM_START;
    52                                              /* RAM_START defined in 'bsp.h'. */
    53 #endif /* RTEMS_SMALL_MEMORY */
    5451
    5552/* The original BSP configuration table from the application and our copy of it
     
    106103void bsp_start( void )
    107104{
     105  rtemsFreeMemStart = (rtems_unsigned32)&_end + _heap_size + _stack_size;
     106                                    /* set the value of start of free memory. */
     107
    108108  /* If we don't have command line arguments set default program name. */
    109109
     
    119119  Cpu_table.extra_mpci_receive_server_stack = 0;
    120120
    121   /* Place RTEMS workspace at top of physical RAM (RAM_END defined in 'bsp.h' */
     121  /* Place RTEMS workspace at beginning of free memory. */
    122122
    123   BSP_Configuration.work_space_start =
    124                           (void *)(RAM_END - BSP_Configuration.work_space_size);
     123  if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1))  /* not aligned => align it */
     124    rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1);
     125
     126  BSP_Configuration.work_space_start = (void *)rtemsFreeMemStart;
     127  rtemsFreeMemStart += BSP_Configuration.work_space_size;
    125128} /* bsp_start */
  • c/src/lib/libbsp/i386/pc386/startup/ldsegs.s

    r0c508af r96d56b3  
    7070
    7171/*----------------------------------------------------------------------------+
    72 | empty_8042
    73 +------------------------------------------------------------------------------
    74 | This routine checks that the keyboard command queue is empty (after emptying
    75 | the output buffers).
    76 | No timeout is used - if this hangs there is something wrong with the machine,
    77 | and we probably couldn't proceed anyway.
    78 +----------------------------------------------------------------------------*/
    79 SYM(empty_8042):
    80         call    delay
    81         inb     $0x64, al       # 8042 status port
    82         testb   $0x01, al       # output buffer?
    83         jz      SYM(no_output)
    84         call    SYM(delay)
    85         in      $0x60, al       # read it
    86         jmp     SYM(empty_8042)
    87 SYM(no_output):
    88         test    $0x02, al       # is input buffer full?
    89         jnz     SYM(empty_8042) # yes - loop
    90         ret
    91 
    92 /*----------------------------------------------------------------------------+
    9372| delay
    9473+------------------------------------------------------------------------------
     
    10180/*-------------------------------------------------------------------------+
    10281|         Function: _load_segments
    103 |      Description: Load board segment registers with apropriate values + enable
    104                     A20 line + reprogram PIC.
     82|      Description: Load board segment registers with apropriate values +
     83|                  reprogram PIC.
    10584| Global Variables: None.
    10685|        Arguments: None.
     
    11594        LOAD_SEGMENTS(RESET_FS, fs)
    11695        LOAD_SEGMENTS(RESET_GS, gs)
    117 
    118         /*---------------------------------------------------------------------+
    119         | we have to enable A20 in order to access memory above 1MByte
    120         +---------------------------------------------------------------------*/
    121 
    122         call    SYM(empty_8042)
    123         movb    $0xD1, al               # command write
    124         outb    al, $0x64
    125         call    SYM(empty_8042)
    126         movb    $0xDF, al               # A20 on
    127         outb    al, $0x60
    128         call    SYM(empty_8042)
    12996
    13097        /*---------------------------------------------------------------------+
  • c/src/lib/libbsp/i386/pc386/tools/Makefile.in

    r0c508af r96d56b3  
    2323
    2424# C source names, if any, go here -- minus the .c
    25 C_PIECES=bin2boot
     25C_PIECES=
     26CC_PIECES=bin2boot Header Image
    2627C_FILES=$(C_PIECES:%=%.c)
     28CC_FILES=$(CC_PIECES:%=%.cc)
    2729C_O_FILES=$(C_PIECES:%=$(ARCH)/%.o)
     30CC_O_FILES=$(CC_PIECES:%=$(ARCH)/%.o)
    2831
    29 H_FILES=
     32H_FILES=bytetype.h Header.h Image.h
    3033
    3134SRCS=$(C_FILES) $(CC_FILES) $(H_FILES)
     
    4447CPPFLAGS +=
    4548CFLAGS   +=
     49CXXFLAGS += -g -Wall
    4650
    4751LD_PATHS  +=
    48 LD_LIBS   +=
    49 LDFLAGS   +=
     52LD_LIBS   += -lstdc++
     53LDFLAGS   += -g
    5054
    5155#
     
    6165all:    $(ARCH) $(SRCS) $(PGMS)
    6266        $(INSTALL) -m 555 $(PGMS) ${PROJECT_RELEASE}/build-tools
    63         uudecode < $(srcdir)/diskboot.uue \
    64             > $(PROJECT_RELEASE)/build-tools/diskboot.exe
     67
     68$(ARCH)/bin2boot: $(OBJS)
     69        $(CC) $(LDFLAGS) $^ -o $@ $(LD_LIBS)
     70$(ARCH)/bin2boot.o : bin2boot.cc Header.h Image.h bytetype.h
     71$(ARCH)/Header.o: Header.cc Header.h bytetype.h
     72$(ARCH)/Image.o: Image.cc Image.h bytetype.h
     73
  • c/src/lib/libbsp/i386/pc386/wrapup/Makefile.in

    r0c508af r96d56b3  
    4747all:    ${ARCH} $(SRCS) $(LIB)
    4848        $(INSTALL_VARIANT) -m 644 $(LIB) ${PROJECT_RELEASE}/lib
    49 
     49# we create here a directory specific to the PC386 BSP to store the BootImage
     50# files so they can be easily found
     51        mkdir -p ${PROJECT_RELEASE}/BootImgs
  • make/custom/pc386.cfg

    r0c508af r96d56b3  
    4343define make-target-options
    4444        @echo "/* #define NDEBUG 1 */ "                     >>$@
    45         @echo "#define RTEMS_TEST_NO_PAUSE 1"               >>$@
     45        @echo "/* #define RTEMS_TEST_NO_PAUSE 1 */"         >>$@
    4646        @echo "/* #define RTEMS_DEBUG  1 */"                >>$@
    4747endef
     
    5252
    5353#+--------------------------------------------------------------------------+
    54 #| Relocation address. Set this to the linear address where you want your code
    55 #| to start. It should abide to the following constraints:
    56 #|   RELOCADDR >= 0x10200
    57 #|   RELOCADDR + 'image file size' < 0xA0000
    58 #|   RELOCADDR % 4 = 0 (i.e. aligned on a 4 byte boundary)
     54#| Set the value of RELOCADDR to the address where you want your image to
     55#| load. If you'll be using GRUB to load the images it will have to be >=
     56#| 0x100000 (1024K). If you are using NetBoot to load the images it can be
     57#| >= 0x10000 (64K) AND <= 0x97C00 (607K) OR >= 0x100000 (1024K). The memory
     58#| top is of course another limit. Make sure there is enough space before the
     59#| upper memory limits for the image and the memory allocated by it to fit.
     60#| Make sure the value you choose is aligned to 4 bytes.
    5961#+--------------------------------------------------------------------------+
    60 RELOCADDR=0x00020200
     62  RELOCADDR=0x00100000
     63
     64START16FILE=$(PROJECT_RELEASE)/lib/start16.bin
     65START16ADDR=0x00097C00
     66 HEADERADDR=0x00097E00
    6167
    6268# The following are definitions of make-exe which will work using ld as
     
    6773define make-exe
    6874        $(LD) -N -T $(LINKCMDS) -Ttext $(RELOCADDR) -e start -nostdlib \
    69            -o $(basename $@).elf \
     75           -o $(basename $@).obj \
    7076           $(START_FILE) $(LINK_OBJS) --start-group $(LINK_LIBS) --end-group
    71         $(OBJCOPY) -O binary --set-start $(RELOCADDR) $(basename $@).elf $@
    72         $(PROJECT_TOOLS)/bin2boot -v $@ $(basename $@).bin -s $(RELOCADDR)
    73         $(NM) -g -n $(basename $@).elf > $(basename $@).num
    74         $(SIZE) $(basename $@).elf
     77        $(OBJCOPY) -O a.out-i386 --remove-section=.rodata --strip-unneeded \
     78          $(basename $@).obj $@
     79        $(OBJCOPY) -O binary $(basename $@).obj $(basename $@).bin
     80        $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bin $(HEADERADDR)\
     81          $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
     82        $(NM) -g -n $(basename $@).obj > $(basename $@).num
     83        $(SIZE) $(basename $@).obj
     84        $(INSTALL_VARIANT) -m 555 $(basename $@).bt ${PROJECT_RELEASE}/BootImgs
    7585endef
    7686else
    7787define make-exe
    78         $(CC) $(CFLAGS) $(CFLAGS_LD) -o $(basename $@).elf $(LINK_OBJS)
    79         $(OBJCOPY) -O binary --set-start $(RELOCADDR) $(basename $@).elf $@
    80         $(PROJECT_TOOLS)/bin2boot -v $@ $(basename $@).bin -s $(RELOCADDR)
    81         $(NM) -g -n $(basename $@).elf > $(basename $@).num
    82         $(SIZE) $(basename $@).elf
     88        $(CC) $(CFLAGS) $(CFLAGS_LD) -Ttext $(RELOCADDR) -o $(basename $@).obj $(LINK_OBJS)
     89        $(OBJCOPY) -O a.out-i386 --remove-section=.rodata --strip-unneeded \
     90          $(basename $@).obj $@
     91        $(OBJCOPY) -O binary $(basename $@).obj $(basename $@).bin
     92        $(PROJECT_TOOLS)/bin2boot -v $(basename $@).bt $(HEADERADDR)\
     93          $(START16FILE) $(START16ADDR) 0 $(basename $@).bin $(RELOCADDR) 0
     94        $(NM) -g -n $(basename $@).obj > $(basename $@).num
     95        $(SIZE) $(basename $@).obj
     96        $(INSTALL_VARIANT) -m 555 $(basename $@).bt ${PROJECT_RELEASE}/BootImgs
    8397endef
    8498endif
Note: See TracChangeset for help on using the changeset viewer.