Thursday, September 17, 2009

How to add a file into OS image

  1. For adding any file into OS image, you need to know about .bib file. What is the .bib file and what it structure is?
  2. You can add the files using .bib file. You can declare the files in FILES section or MODULE section and your file will be added. Better read about FILES and MODULES section from web.
    • If your file is an Native executable, add it in MODULE section
    • If your file is an Managed executable, add it in FILES section
    • If your file is not an executable, add it in FILES section

  3. Ordering is not important here.
  4. For example I am adding an .exe file (Native code), .dll file and a .txt file.
    MODULES
    ; Name Path Memory Type
    ; ---------- -------------------------------- -----------

    LogStatus.dll $(_FLATRELEASEDIR)\LogStatus.dll NK
    LoadTest.exe $(_FLATRELEASEDIR)\LoadTest.exe NK


    FILES
    ; Name Path Memory Type
    ; ---------- -------------------------------- -----------
    MyFile.txt $(_FLATRELEASEDIR)\MyFile.txt NK

  5. Name: Name of the file which you want to add in the OS image. Its not necessary that this name should be same as the original file. If you want to add file abcd.txt as XYZ.abc, here you can provide name as XYZ.txt.

    Path: Path of the file, which need to be added in the path.

    Memory Type: Name of the memory area where this file will be loaded.

  6. Open your project.bib file and add your file.

  7. After providing all these info, Do a “Copy Files to Release Directory”. It will first clear your build folder and then will copy all the bib, reg and other required files. Then do the “Make Run Time Image”. Makeimg.exe will read your bib file entry and look for the specified file at the path which you have declared in “Path” section above. Once your image is up, yoy could find oput your file in \Windows folder.


How to change the File structure tree into OS image

Once you are done with Emulator OS image successfully then you might feel to do some more changes in the default “things”. There are many more things you can customize. One of them is altering the file system; means you want to create some customize Folder structure. I have tried to do same in below exercise........

You can do this my modifying the .dat files. Read about first .dat file in PB. File system (.dat) files, specifically Platform.dat and Project.dat, contain settings to initialize the RAM file system.

For example you want to add some folders in “My Documents” as:




Open Project.dat file and add as given below:

Root:-Directory("Program Files")
Root:-Directory("My Documents")
Directory("\Program Files"):-Directory("ASSET")
Directory("\My Documents"):-Directory("Project Documents")
Directory("\My Documents"):-Directory("Internal Documents")
Directory("\My Documents\Internal Documents"):-File("MyFile.txt", "\Windows\Myfile.txt")

root:[-Directory(“”)] [-File(“”, “”)]

Where is the name of the directory, is the final name of the file that is copied from the \Windows directory, and is the name of the initial file in the \Windows directory.

Now do a “Copy Files to Release Directory”. It will first clear your build folder and then will copy all the bib, reg, dat and other required files. Then do the “Make Run Time Image”. Once your image is up, you could find see you new folder tree structure.

How to create an Emulator image in WinCE6.0

This is the first excersize I did while learning WinCE 6.0. Creating a sample customized oS and then loading it on Emulator. Lets go step by step how to go for a sample emulator based OS building ...............
  1. Go to File->New->Project
  2. In Project types, Select “Platform Builder for CE 6.0”
  3. Enter Project Name in “Name” control
  4. In BSP tab, select “Device Emulator: ARMV4l”
  5. In Device Templates tab, select PDA device
  6. In Design Template Variants: Select Mobile Handheld
  7. In Applications & Media tab: unselect “.Net Compact Framework” and “ActiveSync”. Select “WordPad”.
  8. Networking & Communications tab: unselect “TCP/IP”
  9. Click “Finish” and then “Acknowledgement”.
  10. Now your image is componentized. We need to set some settings.
  11. Go to Project-> Properties.
  12. Expand “Configuration Properties” tree node.
  13. In “Build Options” select the followings and click apply:
    • Enable eboot space…
    • Enable Event tracking…
    • Enable Kernel Debugger
    • Enable KITL
    • Enable Profiling
  14. Go to Target->Connectivity Options…
  15. In Connectivity Options dialog,
    • Target Device: CE Device
    • Download: Device Emulator (DMA)
    • Transport: Device Emulator (DMA)
    • Debugger: KbStub

    Click “Settings” button of “Download”: In “Display” tab make Screen width as 740, and height as 480 (NOTE: you can give whatever size you want).
    In “Network” tab, select “Enable NE2000 PCMCIA..” check box and click OK
  16. Click apply
  17. Go to Build and Build the solutions.
  18. Once Solution is build without any error, go to “Target” and and click “Attach Device”
  19. You can see the output of an image loading in Output window.