Friday, November 18, 2005


Design of various modules of the system

OpenDOS- Open dynamic optimization system

The different modules are
5.Linear code executer
6.Fragment cache manager
7.Prologue &epilogue adder

This module will be preloaded using the LD_PRELOAD variable.
This will load the bootstrapper ans call it.

The bootstrapper will load and initialize all the modules.
It will get the address of _start using dlsym.
It will save the address of main
It will mprotect the text segment.
It will overwrite the next two lines after _start by a call to startup routine.

3.Startup module
It will save the context of the process.
It will allocate a new stack for the dbo(dynamic binary optimizer system).
It will store a pointer to this stack.
It will call the interpreter.

The input to this is address of main.
It will fetch instructions from this address and decode them.

If the instruction is a not a control transfer instruction the it will copy it to a page.
Otherwise it will check if it is backward taken branch (if pc>target addr)

If it is it will record the target addr as start of trace and
The current pc -1 as end of trace in variables

There are 3 conditions possible:

1.If no entry for this trace then
Store both these addresses in trace lookup table.
Initialize the counter to 1.

2.If trace is present and counter is less than threshold increment the counter.

3.If trace is present and the counter exceeds the threshold value we convert it into IR.
And give it to dispatcher.

It acts as a communicating module between all the modules.
It will accept the IR from interpreter and give it to optimizer.
it will accept optimized IR and give it to translator.

It will perform various optimizations depending on IR.

7.Epilogue and prologue adder
It basically adds stubs at the start and end of each process’s fragment we want to execute natively.
The prologue saves the process context to cpu registers.
The epilogue saves the context from cpu registers to the page where previously we had saved the context.
There is a separate epilogue for each exit.
It transfers control to the interpreter to the next instruction after the end of trace.

8.Fragment cache manager
It inserts the fragment into the software code cache at appropriate location.
It records the address of this location and puts it into trace lookup table.

It will convert the IR to binary and give it to prologue and epilogue adder.

Points to be discussed.
1.Heuristics for cache replacement .
2.Handling aging of traces.
3.using API of libbfd for IR.
4.deciding optimization techniques.


Blogger Tatiana said...

Why we don't just blog about politics
General Trackback Cosmos I don't read Stumbling & Mumbling , but perhaps I should start.
Find out how to buy and sell anything, like things related to road construction of pa on interest free credit and pay back whenever you want! Exchange FREE ads on any topic, like road construction of pa!

1:48 AM  

Post a Comment

<< Home