Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende ÜberarbeitungNächste ÜberarbeitungBeide Seiten der Revision | ||
software:deep:dev:crosscompiler:linker32 [2014-02-10 10:31] – graf | software:deep:dev:crosscompiler:linker32 [2014-02-10 13:19] – graf | ||
---|---|---|---|
Zeile 65: | Zeile 65: | ||
- The system runs from the RAM. | - The system runs from the RAM. | ||
- The base system is in the flash. Further classes are later loaded into the RAM. This case needs two system tables. The flash holds a system table which contains only classes which are present in the flash. The system table in the RAM must hold all classes. IMPORTANT This feature is not implemented yet IMPORTANT | - The base system is in the flash. Further classes are later loaded into the RAM. This case needs two system tables. The flash holds a system table which contains only classes which are present in the flash. The system table in the RAM must hold all classes. IMPORTANT This feature is not implemented yet IMPORTANT | ||
- | \\ | ||
- | Die Methode '' | ||
- | Die Systemtabelle hat den folgenden Aufbau: | + | In the compiler the system table is modeled as list. as elements it uses the same blocks as for the constant block. Additionally '' |
- | [{{ .: | + | |
- | Bevor die Systemtabelle zusammengestellt werden kann, muss der Klassenkonstruktor der Kernel-Klasse gefunden werden. Dazu wird der Klassennamen aus der Konfiguration geladen und anschliessend die Methode ''< | + | The structure of the system table is: |
+ | [{{ .: | ||
- | Nun kann die Systemtabelle aufgebaut werden. Dazu wird als erstes der Offset zum Beginn der Klassenliste (Liste mit der Basisadresse des Konstantenblocks jeder Klasse) eingefügt. Anschliessend werden die Informationen zu Heap und Stack eingefügt. Anschliessend die Anzahl vorhandener Klassen und die bereits erwähnte Liste mit den Basisadressen der Konstantenblöcke. Die Systemtabelle wird mit dem Wert 0x0 abgeschlossen. | + | First, the class constructor of the class kernel must be found. For this, the class name of the kernel is fetched from the configuration and the method //< |
- | Der letzte Teil mit den Referenzen auf den Konstantenblock der einzelnen Klassen ist wie folgt zusammengestellt. Zuerst kommen alle Klassen mit einem Klassenkonstruktor. Diese Klassen sind bereits | + | The references to the constant blocks are assembled as follows. First come the classes with class constructors. These classes are already sorted in correct order as described |
- | \\ | + | |
- | Beim MPC555 wird die Systemtabelle in der Dual-Mapped-Section direkt nach dem Exceptioncode positioniert (Addresse 0x2000 -> siehe Memory Map). | + | |
- | ===== Memory Map fixieren | + | ===== Fix Memory Map ===== |
- | [{{ .: | + | [{{ .: |
- | Das Platzieren des Codes, der statischen Variablen und der Konstanten im Speicher geschieht wie folgt. Als erstes wird jeder Klasse ein Memory-Segment für den Code ('' | + | In this step the code is placed in the memory, as well as the class variables and the constants. First, each class is assigned a memory segment for the code ('' |
- | Anschliessend wird die verwendete Grösse auch noch für das Systemtabellen-Segment gesetzt und das Speichersegment für die globale Konstantentabelle festgelegt. | + | Now, the base address of each used segment can be determined. \\ |
- | In einem weiteren Schritt wird die Grösse für jedes verwendete Segment festgelegt (sofern nicht bereits in der Konfiguration vorgegeben). Nun kann für jedes verwendete Segment die Basisadresse berechnet werden. | + | IMPORTANT System methods with offsets given by the configuration must be placed |
- | \\ Achtung: Ganz zu Beginn müssen Systemmethoden, | + | |
- | ===== Absolute | + | ===== Calculate |
- | Nachdem der Code, die statischen Variablen und der Konstantenblock jeder Klasse und auch die Systemtabelle und die globale Konstantentabelle platziert sind, werden nun die absoluten Adressen berechnet. Dazu steht die Methode | + | First, the addresses of static fields are fixed. For this the linker traverses the list '' |
- | In einem ersten Schritt werden die Adressen für die statischen Felder bestimmt. Dazu läuft der Linker durch die entsprechende Liste ('' | + | |
- | Im nächsten Schritt werden die Adressen der Methoden berechnet. Dabei müssen die durch die Konfiguration absolut positionierten Methoden (Exception-Handlers)wiederum speziell behandelt werden. | + | |
- | Als drittes werden die Adressen für die Konstanten im //Constant pool// und die Strings im //String pool// berechnet. | + | |
- | Als letztes wird noch die Adresse der Klasse selbst ('' | + | ===== Refresh Constant Block ===== |
+ | After calculating absolute addresses the constant block has to be refreshed. | ||
- | Diese Methode muss vom //Launcher// für jede Klasse aufgerufen werden. | + | ===== Create Global Constant Table ===== |
+ | This table holds constants which do not belong to a specific class. To give an example: Certain constants are needed to convert an //int// to a //float//. | ||
- | ===== Konstantenblock aktualisieren ===== | + | ===== Create |
- | Nach dem Festlegen der Adressen kann nun der Konstantenblock aktualisiert werden. Dazu legt die Methode '' | + | Finally, the target image is put together. For each method of each class and for each constant block (one for each class, array or interface) a target segment is created and inserted into a list. |
- | + | ||
- | ===== Globale Konstantentabelle erstellen ===== | + | |
- | In der globalen Konstantentabelle werden Konstanten gespeichert, | + | |
- | + | ||
- | ===== Target Image erstellen | + | |
- | Zum Schluss wird das Target Image erstellt. Dabei wird für jede Methode jeder Klasse und für Konstantenblock | + | |
---- | ---- |