Changeset c3a8e6b in rtems-libbsd


Ignore:
Timestamp:
Jul 6, 2016, 2:06:54 PM (3 years ago)
Author:
Christian Mauderer <Christian.Mauderer@…>
Branches:
4.11
Children:
ccd0ebc
Parents:
2d1da0d
git-author:
Christian Mauderer <Christian.Mauderer@…> (07/06/16 14:06:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/03/16 12:13:19)
Message:

libbsd.txt: Add guide for user space tools.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libbsd.txt

    r2d1da0d rc3a8e6b  
    579579The script may also be used to generate a diff in either forward or reverse
    580580direction.
     581
     582== Porting of user space utilities
     583
     584The theory behind the described method is to put all BSS and initialized data
     585objects into a named section. This section then will be saved before the code is
     586executed and restored after it has finished. This method limits to a single
     587threaded execution of the application but minimizes the necessary changes to the
     588original FreeBSD code.
     589
     590. Import and commit the unchanged source files like described above.
     591. Add the files to the libbsd.py and build them.
     592. Use nm on the generated object files to find out which objects are initialized
     593  (either in BSS -- type b or B -- or in the initialized data segment -- type d
     594  or D). An example call could look like follows:
     595  `arm-rtems4.12-nm build/arm-rtems4.12-xilinx_zynq_a9_qemu/freebsd/contrib/pf/pfctl/pfctl.c.10.o | grep ' [DdbB] '`
     596. Check the sources for everything that can be made const. This type of patches
     597  should go back to the upstream FreeBSD sources.
     598. Check the sources for every global variable that can be made static. This type
     599  of patches should go back to the upstream FreeBSD sources.
     600. Move static variables out of functions. This patches should also go upstream.
     601. Create one `xxx-data.h` file per c module. This header should contain
     602  declarations for the remaining initialized objects matching the original
     603  declarations but adding a section attribute. The section name has to match the
     604  name of the RTEMS_LINKER_RWSET defined further below. For an example look at
     605  `freebsd/contrib/pf/pfctl/pfctl-data.h`.
     606. Include the header files at the end of the corresponding c files.
     607. Add a rtems_bsd_command_xxx wrapper function to the c file containing the main
     608  function. For an example look at `rtems_bsd_command_pfctl(...)` in
     609  `freebsd/contrib/pf/pfctl/pfctl.c`.
     610. Create one compilable commit.
    581611
    582612== Initialization of the BSD Library
Note: See TracChangeset for help on using the changeset viewer.