|Length of data segment|
|Starting address of rvm|
|Heap region length|
|Static region length|
|Number of lists of free block|
While entering these six numeric parameters, either on command line on via the interactive prompt, users may use numeric number in hexadecimal, decimal or even octal notation. Hexadecimal numbers are preceeded by Ox, decimal numbers are preceeded by nothing and octal numbers are preceded by 0.
Special note for long time rdsinit user: the old rdsinit automatically assumed saddr, hlen and slen parameters supplied on command lines are in hexidecimal and did not require the prefix 0x. This is no longer true with this version of rdsinit.
Users specify the length of the data segment with the parameter datalen. Again, old version of rdsinit did not require this parameter if the data segment was a regular file and it existed already at the time of running rdsinit. This special case is eliminated: length of data segment must to be supplied in all circumstances.
Starting address of rvm, or saddr, is where heap and static region will be mapped into virtual memory. Heap region is located right at the starting address, while static region is located at starting address plus heap region length. Users may need to have some knowledges of the overall layout of the virtual memory use by the system before they can make the right choice of starting address. For example, the starting address of rvm must be much larger than the largest possible break point of your application, and it should not be in conflict other uses of virtual memory (such as use by shared libraries). It must also be on a page boundary. In CMU, we use 0x20000000 (536870912) with Linux and BSD44, or 0x70000000 (1879048192) with Mach. It is possible to choose other values, but you have to choose them carefully.
Length of regions of heap and static are specified by the parameter hlen and slen respectively. They both must be integral multiple of pagesize of the system. Also, the combined length of the two regions must be smaller than the length of data segment minus one extra page.
Note that the above three parameters: saddr, hlen, slen, are permanent. They cant be changed without re-initizing (and brain-wiping) the data segment.
The next two parameters: nl and chunk are related to underlying structure of management of the heap. RDS uses the Quick Fit method for heap allocation. In this method, free blocks are maintained by a number of free lists, each list for one particular size of free blocks. Specifically, there will be nl free lists, and each of them will have free blocks of size 1..nl chunk respectively.
Chunk size must be integral multiple of sizeof(char *), and be at least RDS_MIN_CHUNK_SIZE. Number of lists must be at least RDS_MIN_FREE_LISTS. For example, a reasonable choice is to have 100 free list with chunk size 32 bytes.
Once all the parameters are chosen, rdsinit will ask user for confirmation before it goes ahead and make permanent change on the log and data segment. Note in the following example that those numerical arguments are presented in both hexidecimal and decimal (in bracket). It is safe to quit at this point and no permanent changes will be made.
The following parameters are chosen:
length of data segment: 0xf5000 ( 1003520)
starting address of rvm: 0x20000000 ( 536870912)
heap len: 0xf0000 ( 983040)
static len: 0x4000 ( 16384)
nlists: 0x64 ( 100)
chunk size: 0x20 ( 32)
Do you agree with these parameters ? (y|n|q) y
If user supplied the -f (firm) switch on command line, this last confirmation will not show up.
rds_init_heap (3), rds_load_heap (3), rds_zap_heap (3), rvm_create_segment (3), rvm_load_segment (3), rvmutl (1)
David C. Steere, created man page
Yui W. Lee, modified (Sept 1997)