Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Running a Program on the Target Running with or without Paging Installing Hardware Interrupt Handlers Catching NULL Pointer Assignments Running without Run-Time System Configuration for Debug and Release Builds Using Data Compression Loading DLLs through a File System Using the MetaWINDOW Graphics Library Custom MP Floating Pointer Structure Compiling and Linking with On Time RTOS-32 |
Using Data CompressionExcept for the header, the boot code, and the decompression code, any program entity containing an image can be compressed by RTLoc. The following prerequisites must be satisfied for data compression:
The extra entities required for compression (DecompCode, DecompData, and Copies) are all discardable. Thus, if they reside in RAM, their memory can be reused by the application's stack and heap without causing any memory overhead. Apart from reducing program image sizes, data compression has an impact on application initialization times. Decompressing program code and data may require several seconds (the .LOC file contains the times needed for decompression, as measured on the host). The only exception is the page table, which will typically decompress faster than it can be copied. Of course, compression also requires time on the host, slowing down RTLoc. Again, the Compression Report in the .LOC file shows these times. Boot time may be an issue for systems which must be able to start up very quickly. The following sections discuss how boot times and overall memory requirements vary depending on how the application is loaded. Downloading and Cross DebuggingCompressed applications can typically be downloaded twice as fast. Since all discardable entities are located to RAM, there is no memory lost on the target. Thus, compression is highly recommended during the development phase. Applications Booted from DiskThe disk space requirement is typically 50% of an uncompressed application, and there is no extra memory required, since all extra program entities required for compression are discardable and reside in RAM. Even program load time will be faster with compression for most systems, because less data has to be read from the boot device and decompressing is typically faster than reading data from disk. However, the net gain or loss in load time depends on the speed of the boot device and the speed of the CPU. If booting from floppy disk, compression will certainly improve startup time, even on slow CPUs. The same is true for most hard disk based systems with 486 or higher CPUs. Silicon disks, however, may be faster than RTTarget-32's decompression algorithm (with the exception of page tables). Applications copied from ROM to RAMApplications which are booted from ROM, but then completely copied to RAM will benefit from significantly reduced ROM space requirements with no extra RAM needs. Thus, the total memory requirement is actually reduced. Boot time, however, will be higher with compression. Applications Running in ROMIf all read-only entities remain in ROM, data compression can only be used for initialized data and the page table. Since the decompression code itself requires about 2k of memory (and cannot be reused because it resides in ROM), the total ROM space requirement may actually increase if no paging is used and the initialized data size is not reduced by more than 2k. Memory savings and boot time differences may be small for such applications and depend heavily on initialized data size. Configuration for Debug and Release Builds
|