Port Implementation Tutorial

This topic describes how to customize the Base Starter.

Creating local drive mapping files

  1. Create an ASCII text file containing your local drive mapping records; see create local drive mapping files for information about the syntax of the file.

  2. Put this text file into your variant source tree. The source tree is typically of the form sf/os/boardsupport/.../<your variant>/estart/ . Depending on your port, you might need more than one local drive mapping file.

  3. In the kernel.iby file for your variant, you need to add lines to make sure that your local drive mapping files are copied into the ROM's \sys\data\ directory when the ROM is built. For example include a lines in the form

    data=\epoc32\rom\youvariant\ESTARTCOMP.TXT              \Sys\Data\ESTARTCOMP.TXT
  4. If you need more than one mapping file, or your single mapping file has a name other than ESTART.TXT, then you need to customise the function TFSStartUp::LocalDriveMappingFileName() so that you can return the appropriate file name at run time.

Making use of auto detection

To make use of auto-detection, you need to ensure that your variant cannot find local drive mapping files in your ROM's \sys\data\ directory. If you are using the default version of TFSStartUp::LocalDriveMappingFileName(), then make sure that no file exists with the full path name Z:\sys\data\estart.txt.

Customising code

The most common customisation is to provide your own implementation of the TFSStartup virtual functions. To do this:

  1. Take a copy of ESTARTMAIN.CPP from sf/os/kernelhwsrv/userlibandfileserver/fileserver/estart/, and insert your code into this copy. Typically this will include, but is not limited to, your implementation of the TFSStartup virtual functions.

  2. Place the copy into your variant's source tree. This is typically of the form sf/os/boardsupport/.../<your variant>/estart/. This is the general pattern for the other ports supplied with Symbian platform.

  3. Create a .mmp file to build your variant's version of the Base Starter. This is usually placed in the \<youvariant>\ directory. The general pattern looks like this: sf/os/boardsupport/.../<your variant>/estart/estart.mmp. Ports to other hardware variants and the emulator (WINS) variant follow the same general pattern.

  4. Your .mmp file should pick up the Symbian platform generic code from sf/os/kernelhwsrv/userlibandfileserver/fileserver/estart/estart.cpp, but should pick up your variant's customised source code from sf/os/boardsupport/.../<your variant>/estart/estartmain.cpp. The general pattern is to give the resulting executable the name e32strt.exe.

  5. In the kernel.iby file for your variant, you need to add a line that copies your executable into the ROM's \sys\bin\ directory when the ROM is built. For example, include a line of the form:

    file=\Epoc32\Release\##MAIN##\##BUILD##\_##VARIANT##_e32strt.exe        sys\bin\estart.exe HEAPMAX(0x2000)

Removing auto detect from the Base Starter

You do this only if you need to save code space, and you do not need the autodetect functionality.

See also Use automatic local drive mapping.

  1. Create a .mmp file to build your variant's version of the Base Starter. This is usually placed in the sf/os/boardsupport/.../<your variant>/estart/ directory. This shows the general pattern. Ports to other hardware variants and the emulator (WINS) variant follow the same general pattern.

  2. In your .mmp file, define the macro:

    MACRO AUTODETECT_DISABLE
  3. The location of all source files in the .mmp file will be sf/os/kernelhwsrv/userlibandfileserver/fileserver/estart/.

  4. In the kernel.iby file for your variant, you need to add a line to make sure that your executable is copied into the ROM's \sys\bin\ directory when the ROM is built. For example, include a line of the form

    file=\Epoc32\Release\##MAIN##\##BUILD##\_##VARIANT##_e32strt.exe        sys\bin\estart.exe HEAPMAX(0x2000)

    This is the general pattern for the other ports supplied with Symbian platform.

See also

Concepts