FR2789193A1 - Method for modifying behavior of computer under execution of functions in binary code by replacing first branching instruction by second branching instruction at first determined address - Google Patents

Method for modifying behavior of computer under execution of functions in binary code by replacing first branching instruction by second branching instruction at first determined address Download PDF

Info

Publication number
FR2789193A1
FR2789193A1 FR9901004A FR9901004A FR2789193A1 FR 2789193 A1 FR2789193 A1 FR 2789193A1 FR 9901004 A FR9901004 A FR 9901004A FR 9901004 A FR9901004 A FR 9901004A FR 2789193 A1 FR2789193 A1 FR 2789193A1
Authority
FR
France
Prior art keywords
instruction
binary code
instr
address
memory area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
FR9901004A
Other languages
French (fr)
Other versions
FR2789193B1 (en
Inventor
Nadia Bouraoui
Jean Pascal Mazzilli
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bull SA
Original Assignee
Bull SA
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bull SA filed Critical Bull SA
Priority to FR9901004A priority Critical patent/FR2789193B1/en
Publication of FR2789193A1 publication Critical patent/FR2789193A1/en
Application granted granted Critical
Publication of FR2789193B1 publication Critical patent/FR2789193B1/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/656Updates while running

Abstract

A binary code contained in the first zone memory is examined to find some addresses (A2) to find a first branching instruction on first determined function with protection of addresses (A2) in a structure of data situated at a second determined address (A8). The first branching instruction is then replaced by a second branching instruction at the first determined address (A1), while writing at the addresses (A2) the second instruction of branching. An Independent claim is included for: (a) a computer

Description

Procédé pour modifier le comportement d'une machine informatique.Method for modifying the behavior of a computer machine.

Le domaine d'application auquel s'intéresse l'invention est celui des modifications de comportement d'une machine informatique en cours d'exécution, c'est à dire sans qu'il ne soit besoin d'arrêter et de redémarrer la  The field of application to which the invention relates is that of the behavioral modifications of a computer machine during execution, that is to say without the need to stop and restart the

machine avec une nouvelle configuration.  machine with a new configuration.

Il est intéressant de pouvoir modifier le comportement d'une machine informatique en fonctionnement pour assurer la maintenance de systèmes io qu'on ne peut se permettre d'arrêter. En phase de débogage, on peut vouloir corriger des erreurs de code exécutable. On peut vouloir obtenir une trace de certains événements particuliers survenant pendant le fonctionnement de la machine. D'autres besoins de modification du comportement de la machine  It is interesting to be able to modify the behavior of a computer machine in operation to ensure the maintenance of systems that cannot be stopped. In the debugging phase, you may want to correct executable code errors. You may want to get a record of some special events occurring during the operation of the machine. Other needs to modify the behavior of the machine

existent, par exemple pour en faire évoluer les performances.  exist, for example to improve performance.

Le comportement de la machine résulte de l'exécution de certaines fonctions qui concernent le coeur de la machine, ce sont par exemple les fonctions de  The behavior of the machine results from the execution of certain functions which concern the heart of the machine, these are for example the functions of

pilotages des éléments matériels et les fonctions du système d'exploitation.  control of the hardware elements and the functions of the operating system.

Pour faire une modification dans une telle fonction, la solution la plus simple consiste à redémarrer la machine en chargeant un nouveau code executable de cette fonction. Le code exécutable d'une fonction est du code binaire directement interprétable par le ou les processeurs de la machine. Il est souvent obtenu par compilation d'un code source élaboré en langage évolué,  To make a modification in such a function, the simplest solution consists in restarting the machine by loading a new executable code of this function. The executable code of a function is binary code directly interpretable by the processor or processors of the machine. It is often obtained by compiling a source code developed in advanced language,

plus proche de la compréhension humaine.  closer to human understanding.

Pour ne pas avoir à recompiler le code d'une fonction et à redémarrer la machine, on peut prévoir que la fonction soit paramétrable. Certains paramètres de la fonction sont modifiables par un programme ou par une interface opérateur de façon à ce que la fonction influe sur le comportement de  To avoid having to recompile the code of a function and restart the machine, we can provide that the function can be configured. Certain parameters of the function can be modified by a program or by an operator interface so that the function influences the behavior of

la machine, de manière différente suivant la valeur des paramètres.  the machine, differently depending on the value of the parameters.

2 27891932 2789193

Cependant, ceci nécessite de connaître à l'avance, les modifications de comportement souhaités de la machine. Cette solution n'apporte pas une souplesse satisfaisante pour des modifications non prévues telles que les  However, this requires knowing in advance the desired behavior modifications of the machine. This solution does not provide satisfactory flexibility for unforeseen modifications such as

corrections d'erreur logicielles ou matérielles, les évolutions de performances.  software or hardware error corrections, performance changes.

Pour palier les inconvénients précédemment cités, l'objet de l'invention est un procédé pour modifier le comportement d'une machine informatique en cours d'exécution de fonctions en code binaire contenu dans une première zone mémoire de ladite machine, par au moins un processeur de ladite machine. Le io procédé est caractérisé en ce qu'il comprend: - une première étape consistant à ranger dans une deuxième zone mémoire de ladite machine, une première séquence spécifique de code binaire débutant à une première adresse déterminée de ladite première zone mémoire. Cette première séquence spécifique de code binaire est celle dont l'exécution modifiera le comportement de la machine; - une deuxième étape consistant à parcourir le code binaire contenu dans la première zone mémoire jusqu'à trouver toutes les adresses auxquelles apparaît une première instruction de branchement sur une première fonction déterminée et à sauvegarder les adresses ainsi trouvées dans une structure de données située à une deuxième adresse déterminée. Cette première fonction est celle dont l'exécution du code binaire correspond au comportement d'origine de la machine; - une troisième étape succédant aux deux étapes précédentes, consistant à écrire à chaque adresse sauvegardée dans la structure de données, une  To overcome the aforementioned drawbacks, the object of the invention is a method for modifying the behavior of a computer machine during the execution of functions in binary code contained in a first memory area of said machine, by at least one processor of said machine. The method is characterized in that it comprises: a first step consisting in storing in a second memory area of said machine, a first specific sequence of binary code starting at a first determined address in said first memory area. This first specific sequence of binary code is the one whose execution will modify the behavior of the machine; a second step consisting in browsing the binary code contained in the first memory area until finding all the addresses at which appears a first instruction to connect to a first determined function and in saving the addresses thus found in a data structure located at a second determined address. This first function is that whose execution of the binary code corresponds to the original behavior of the machine; a third step succeeding the two preceding steps, consisting in writing to each address saved in the data structure, a

deuxième instruction de branchement sur ladite première adresse déterminée.  second instruction to connect to said first determined address.

Ceci permet d'insérer dans le code binaire, sans autre altération de sa structure, une séquence de code binaire dont l'exécution modifie le comportement de la machine. En effet, le comportement de la machine ne résulte plus alors de l'exécution de la première fonction telle qu'activée dans le  This makes it possible to insert into the binary code, without any other alteration of its structure, a sequence of binary code whose execution modifies the behavior of the machine. Indeed, the behavior of the machine no longer results from the execution of the first function as activated in the

code binaire précédemment exécuté.  binary code previously executed.

3 27891933 2789193

Une instruction de branchement est codée en binaire sur un nombre fini de bits qui constituent un mot. Pour éviter de faire un travail comparable à celui d'un compilateur, un intérêt de l'invention est de n'avoir à remplacer dans I'enchaînement du code binaire initial, que le seul mot de la première instruction de branchement précédemment citée. Il convient alors que le mot de la deuxième instruction de branchement précédemment citée puisse contenir l'indication du type d'instruction à réaliser par le processeur et l'adresse sur laquelle effectuer le branchement. Cette adresse est donc nécessairement io codée sur un nombre restreint de bits. Ceci impose que la séquence spécifique de code binaire soit dans une deuxième zone mémoire - dont l'adresse puisse  A branch instruction is binary coded on a finite number of bits which constitute a word. To avoid doing a job comparable to that of a compiler, an advantage of the invention is to have to replace in the sequence of the initial binary code, only the single word of the first branching instruction mentioned above. The word of the second connection instruction previously mentioned should then contain the indication of the type of instruction to be carried out by the processor and the address on which to carry out the connection. This address is therefore necessarily coded on a restricted number of bits. This requires that the specific sequence of binary code be in a second memory area - whose address can

être codée sur un nombre restreint de bits.  be coded on a limited number of bits.

Lorsque, pour modifier le comportement de la machine, il est impossible de i5 contrôler la localisation du code binaire ajouté du point de vue de son adresse, il convient d'utiliser un deuxième type de branchement plus puissant, consistant à remplir un registre de comptage avec l'adresse voulue, puis à se brancher à l'adresse contenue dans ce registre. Une amélioration du procédé selon l'invention, est alors caractérisée en ce que le procédé comprend: - Une première étape consistant à ranger dans une deuxième zone mémoire de la machine, une première séquence spécifique de code binaire débutant à une première adresse déterminée de la première zone mémoire. Cette première séquence spécifique de code binaire est celle qui permet de réaliser un branchement sur une fonction d'adresse quelconque, par utilisation du registre de comptage. Ce type de branchement est plus élaboré que le simple remplacement d'un mot dans le code binaire initial; - une deuxième étape consistant à parcourir le code binaire contenu dans la première zone mémoire jusqu'à trouver toutes les adresses auxquelles apparaît une première instruction de branchement sur une première fonction déterminée et à sauvegarder les adresses ainsi trouvées dans une structure de données située à une deuxième adresse déterminée. Cette première fonction  When, to modify the behavior of the machine, it is impossible to control the location of the added binary code from the point of view of its address, a second, more powerful type of connection should be used, consisting of filling in a count register with the desired address, then connect to the address contained in this register. An improvement of the method according to the invention is then characterized in that the method comprises: - A first step consisting in storing in a second memory area of the machine, a first specific sequence of binary code starting at a first determined address of the first memory area. This first specific sequence of binary code is that which makes it possible to make a connection to any address function, by using the counting register. This type of branching is more elaborate than simply replacing a word in the initial binary code; a second step consisting in browsing the binary code contained in the first memory area until finding all the addresses at which appears a first instruction to connect to a first determined function and in saving the addresses thus found in a data structure located at a second determined address. This first function

4 27891934 2789193

est celle dont l'exécution du code binaire correspond au comportement  is the one whose execution of the binary code corresponds to the behavior

d'origine de la machine.original machine.

- une troisième étape consistant à remplacer la première instruction de branchement par une deuxième instruction de branchement sur la première adresse déterminée, en écrivant à l'adresse o se trouve la première  a third step consisting in replacing the first connection instruction by a second instruction for connection to the first determined address, by writing to the address where the first is located

instruction de branchement, ladite deuxième instruction de branchement.  branching instruction, said second branching instruction.

- une quatrième étape précédant la troisième étape, consistant à ranger dans une troisième zone mémoire de ladite machine, une deuxième séquence de îo code binaire réalisant une deuxième fonction déterminée, à une troisième adresse déterminée, et en ce que ladite première séquence spécifique de code binaire contient au moins une instruction de branchement sur ladite troisième adresse déterminée. Ladite deuxième fonction déterminée est celle dont  a fourth step preceding the third step, consisting in storing in a third memory area of said machine, a second sequence of binary code performing a second determined function, at a third determined address, and in that said first specific code sequence binary contains at least one instruction to connect to said third determined address. Said second determined function is that of which

l'exécution du code binaire modifiera le comportement d'origine de la machine.  the execution of the binary code will modify the original behavior of the machine.

Selon une caractéristique supplémentaire du procédé, objet de l'invention, la première séquence spécifique de code binaire contient: - une ou plusieurs instructions pour sauvegarder le contenu d'un registre de lien et d'un registre de comptage du processeur sur lequel la première séquence spécifique s'exécute, à une quatrième adresse déterminée de la deuxième zone mémoire; - une instruction pour charger la troisième adresse déterminée dans le registre de comptage; - une instruction de branchement utilisant le registre de comptage; - une ou plusieurs instructions pour charger dans le registre de lien et dans le registre de comptage le contenu sauvegardé au moyen de la quatrième adresse déterminée;  According to an additional characteristic of the method which is the subject of the invention, the first specific sequence of binary code contains: - one or more instructions for saving the content of a link register and a counting register of the processor on which the first specific sequence is executed, at a fourth determined address in the second memory area; - an instruction to load the third address determined in the counting register; - a connection instruction using the counting register; - one or more instructions for loading the content saved by means of the fourth determined address into the link register and into the counting register;

- une instruction de retour basée sur le contenu du registre de lien.  - a return instruction based on the content of the link register.

27891932789193

D'autres avantages et détails de réalisation de l'invention vont ressortir de la  Other advantages and details of embodiment of the invention will emerge from the

description d'une mise en oeuvre particulière en référence aux figures.  description of a particular implementation with reference to the figures.

- La figure 1 représente un exemple de machine comprenant au moins un processeur. - La figure 2 représente un état de code binaire avant mise en oeuvre du  - Figure 1 shows an example of a machine comprising at least one processor. - Figure 2 shows a binary code state before implementation of the

procédé selon l'invention.method according to the invention.

- La figure 3 représente des étapes du procédé selon l'invention.  - Figure 3 shows steps of the method according to the invention.

- La figure 4 représente un état de code binaire après mise en oeuvre du  - Figure 4 shows a binary code state after implementation of the

io procédé selon l'invention.io process according to the invention.

En référence à la figure 1, une machine informatique comprend au moins un processeur 1, 2, 3, 4, relié à une unité de mémoire 5 au moyen d'un bus système 6. Chaque processeur 1, 2, 3, 4 est une unité centrale de type connu (CPU pour Central Processing Unit en langue anglaise). Un processeur CPU comprend plusieurs registres qui lui permettent de traiter le contenu de l'unité de mémoire 5. Sans entrer dans le détail de fonctionnement, complexe, du  With reference to FIG. 1, a computer machine comprises at least one processor 1, 2, 3, 4, connected to a memory unit 5 by means of a system bus 6. Each processor 1, 2, 3, 4 is a central unit of known type (CPU for Central Processing Unit in English). A processor CPU includes several registers which allow it to process the content of memory unit 5. Without going into the details of the complex operation of the

processeur CPU, on retient sur la figure 1, des registres IAR, LR, CTR.  processor CPU, one retains on figure 1, registers IAR, LR, CTR.

Le registre IAR (Instruction Address Register en langue anglaise), est destiné à contenir une adresse d'instruction résidente dans l'unité de mémoire 5, en cours d'exécution par le processeur CPU. Des fonctions exécutables par la machine informatique, sont constituées de suites d'instructions en code binaire, résidentes chacune à une adresse dans l'unité de mémoire 5. La lecture d'une instruction en code binaire au moyen du registre IAR permet son interprétation directe par le processeur qui la traite. Une instruction est codée par un ensemble de bits qui constitue un mot. Le mot comprend entre autres, un champ pour coder le type d'instruction et un ou plusieurs champs pour accéder à une ou plusieurs opérandes de l'instruction. Quelques exemples de type d'instruction sont charger, ranger, additionner, brancher, etc. Suivant le type d'instruction, un champ pour accéder à une opérande contient la valeur de  The IAR (Instruction Address Register in English), is intended to contain an instruction address resident in the memory unit 5, being executed by the processor CPU. Functions executable by the computer machine, consist of sequences of instructions in binary code, each resident at an address in the memory unit 5. Reading an instruction in binary code by means of the IAR register allows its direct interpretation by the processor that processes it. An instruction is coded by a set of bits which constitute a word. The word includes among other things, a field for coding the type of instruction and one or more fields for accessing one or more operands of the instruction. Some examples of instruction type are load, store, add, plug in, etc. Depending on the type of instruction, a field to access an operand contains the value of

6 27891936 2789193

l'opérande, I'adresse absolue ou l'adresse relative de l'opérande en mémoire, le numéro d'un registre contenant la valeur de l'opérande ou contenant  the operand, the absolute address or the relative address of the operand in memory, the number of a register containing the value of the operand or containing

l'adresse de l'opérande en mémoire.  the address of the operand in memory.

Le registre LR (Link Register en langue anglaise), est utilisable par certaines instructions de branchement pour établir un lien au retour de branchement  The LR Register (Link Register in English) can be used by certain connection instructions to establish a link to the return connection

effectué par l'instruction utilisant le registre LR.  performed by the instruction using the LR register.

Le registre CTR (CounT Register en langue anglaise), est utilisable par certaines instructions de branchement pour contenir une adresse de  The CTR register (CounT Register in English) can be used by certain connection instructions to contain an address of

branchement en mémoire.memory connection.

L'utilisation des registres IAR, LR et CTR sera mieux comprise en référence à l'exemple de la figure 2. Une première zone mémoire 7 de l'unité de mémoire 5 contient du code binaire de fonctions exécutable par la machine. Ce code binaire contient par exemple une suite d'instructions quelconques Instr.10,  The use of the registers IAR, LR and CTR will be better understood with reference to the example in FIG. 2. A first memory area 7 of the memory unit 5 contains binary code of functions executable by the machine. This binary code contains for example a series of any instructions Instr.10,

Instr.11, Instr.12 situées à des adresses successives de la zone mémoire 7.  Instr.11, Instr.12 located at successive addresses in memory area 7.

Lorsque le registre IAR, par exemple du processeur 1, contient l'adresse de l'instruction Instr.10, le processeur exécute cette instruction. Ensuite, le registre IAR est matériellement incrémenté par le processeur 1 pour contenir l'adresse de l'instruction Instr. 11 qu'il exécute et ainsi de suite pour l'instruction suivante  When the IAR register, for example of processor 1, contains the address of the instruction Instr.10, the processor executes this instruction. Then, the IAR register is physically incremented by the processor 1 to contain the address of the instruction Instr. 11 he executes and so on for the next instruction

Instr. 12.Instr. 12.

Dans l'exemple de la figure 2, à une adresse A2 suivant l'adresse de I'instruction Instr.12, se trouve une instruction particulière blAim, puis aux adresses suivantes, d'autres instructions quelconques Instr.14, Instr.15, etc. Le mot binaire qui code l'instruction blAim contient comme type, celui d'un branchement bl, et comme valeur d'opérande, une adresse relative Aim (pour adresse immédiate). Lorsque le registre IAR, par exemple du processeur 1, contient l'adresse A2 comme adresse courante, le décodage du type bl par le processeur 1, provoque essentiellement deux actions des circuits matériels du  In the example of FIG. 2, at a address A2 following the address of the instruction Instr.12, there is a particular instruction blAim, then at the following addresses, any other instructions whatever Instr.14, Instr.15, etc. The binary word which codes the instruction blAim contains as type, that of a branching bl, and as operand value, a relative address Aim (for immediate address). When the IAR register, for example of the processor 1, contains the address A2 as the current address, the decoding of the type bl by the processor 1, essentially causes two actions of the hardware circuits of the

7 27891937 2789193

processeur 1. Une première action consiste à ajouter la valeur d'opérande Aim à l'adresse courante A2 pour obtenir une adresse absolue qui est rangée dans le registre IAR. Une deuxième action consiste à ranger dans le registre LR,  processor 1. A first action consists in adding the operand value Aim to the current address A2 to obtain an absolute address which is stored in the register IAR. A second action consists in putting in the register LR,

l'adresse suivante de l'adresse A2 o se trouve l'instruction Instr.14.  the following address of address A2 where the instruction Instr. 14 is located.

La première action a pour effet de rompre la séquentialité d'exécution des instructions à des adresses successives de la zone mémoire 7. En effet, l'instruction qui est exécutée à la suite de celle située à l'adresse A2 n'est pas l'instruction Instr.14 mais une instruction Instr. 20 située à l'adresse A3. Aux io adresses suivantes de l'adresse A3, des instructions Instr.21, Instr.22, Instr.23, Instr.24 constituent avec l'instruction Instr.20 le code binaire d'une première  The first action has the effect of breaking the sequential execution of the instructions at successive addresses in the memory area 7. In fact, the instruction which is executed following that located at the address A2 is not the instruction Instr. 14 but an instruction Instr. 20 located at address A3. At the following addresses of address A3, instructions Instr.21, Instr.22, Instr.23, Instr.24 constitute with instruction Instr.20 the binary code of a first

fonction exécutable par la machine.  machine-executable function.

La deuxième action a pour effet de rétablir la séquentialité d'exécution des instructions Instr.14, Instr.15 au retour de la fonction codée par les instructions Instr.20 à Instr.24. Pour cela, la dernière instruction Instr.24 de la première fonction est suivie d'une instruction blr. Le décodage de l'instruction blr par le processeur provoque le transfert du contenu du registre LR vers le registre IAR. Les instructions Instr.10 à Instr.15 font partie du code binaire d'une autre fonction qui fait appel à la première fonction. Généralement la première fonction et l'autre fonction sont d'abord écrites dans un langage évolué plus compréhensible par un être humain que du code binaire. L'écriture de fonctions en langage évolué dans un programme constitue ce qu'on nomme habituellement un code source. Un compilateur se charge alors de traduire le code source en code binaire. En utilisant de préférence l'adressage relatif, le compilateur génère un code binaire de fonctions dont l'emplacement en mémoire est optimisé. L'adressage relatif qui permet de coder dans un seul mot le type d'instruction et l'adresse de branchement de l'exécution, est bien  The second action has the effect of re-establishing the sequential execution of the instructions Instr.14, Instr.15 upon return of the function coded by the instructions Instr.20 to Instr.24. For this, the last instruction Instr.24 of the first function is followed by a instruction blr. The decoding of the instruction blr by the processor causes the transfer of the content of the register LR to the register IAR. The instructions Instr.10 to Instr.15 are part of the binary code of another function which calls the first function. Generally the first function and the other function are first written in an advanced language more understandable by a human being than binary code. Writing advanced language functions in a program is what is usually called source code. A compiler is then responsible for translating the source code into binary code. Preferably using relative addressing, the compiler generates a binary code of functions whose location in memory is optimized. The relative addressing which makes it possible to code in a single word the type of instruction and the address of connection of the execution, is well

8 27891938 2789193

adapté pour des fonctions dont les adresses des séries d'instructions  suitable for functions including addresses of instruction series

branchées sont proches en mémoire des instructions de branchement.  connected are close in memory to the connection instructions.

La zone mémoire 7 étant réservée pour l'exécution du système d'exploitation, les suites d'instructions qui y résident sont celles de fonctions qui gouvernent le comportement de la machine. La zone mémoire 7 fait partie d'un espace d'adressage Noyau (Kernel en langue anglaise) de l'unité mémoire 5, non directement accessible par les applications traitées par la machine. Un procédé pour modifier le comportement de la machine est décrit en référence à la figure  The memory area 7 being reserved for the execution of the operating system, the sequences of instructions which reside there are those of functions which govern the behavior of the machine. The memory area 7 is part of a Kernel address space (Kernel in English) of the memory unit 5, not directly accessible by the applications processed by the machine. A method for modifying the behavior of the machine is described with reference to the figure

o 3 et à la figure 4.o 3 and in figure 4.

En référence à la figure 4, on distingue dans l'espace d'adressage Noyau: - la première zone mémoire 7 qui contient du code et des données chargés lors de l'amorçage du système d'exploitation (boot en anglais) au démarrage de la machine; - une deuxième zone mémoire 8, proche en termes d'adresses de la zone mémoire 7, pour contenir du code et des données chargés pendant ou après l'amorçage du système d'exploitation; - une troisième zone mémoire 9 pour contenir du code et des données accessibles à certaines applications. La zone mémoire 9 constitue un espace d'adressage partagé, généralement plus éloigné en termes d'adresses de la  With reference to FIG. 4, a distinction is made in the Kernel address space: - the first memory area 7 which contains code and data loaded during booting of the operating system (boot in English) when booting up the machine; a second memory area 8, close in terms of addresses of the memory area 7, for containing code and data loaded during or after the booting of the operating system; a third memory area 9 for containing code and data accessible to certain applications. The memory area 9 constitutes a shared address space, generally more distant in terms of addresses from the

zone mémoire 7 que la zone de mémoire 8.  memory area 7 than memory area 8.

En référence à la figure 3, la notion de première, deuxième ou quatrième étape ne traduit pas un ordre de séquentialité mais simplement un ordre de  With reference to FIG. 3, the notion of first, second or fourth step does not translate an order of sequentiality but simply an order of

description ou d'intérêt. La représentation des étapes El, E2, E4 sur des  description or interest. The representation of steps El, E2, E4 on

branches parallèles, indique que l'ordre d'enchaînement de ces étapes est sans importance. Lorsqu'un ordre d'enchaînement d'étapes El, E3, est  parallel branches, indicates that the sequence of these steps is unimportant. When a sequence order of steps El, E3, is

important, celui-ci est précisé.important, this is clarified.

9 27891939 2789193

En référence aux figures 3 et 4, dans une première étape El, plusieurs adresses A1, A5, A6, A7, sont réservées dans la zone mémoire 8. Une séquence spécifique d'instructions Instr.30,..., Instr.36, bir est écrite en code binaire, à des adresses successives de la zone mémoire 8, dont l'adresse de début est l'adresse A1 o est écrite l'instruction Instr.30. Dans une deuxième étape E2, une première fonction est déterminée comme étant celle dont des appels sont déroutés de façon à modifier le comportement de la machine en comparaison de celui initialement prévu lorsque cette io première fonction est normalement appelée. L'adresse A3 à laquelle réside la première instruction Instr.20 du code binaire de la première fonction est mémorisée. Un système d'exploitation comprend généralement une table non représentée ici, qui répertorie les fonctions en indiquant pour chacune, l'adresse de résidence de sa première instruction. Cette table est par exemple utilisée par un compilateur pour transcrire en code binaire un code source qui fait appel à des fonctions qui y sont répertoriées. Une lecture de cette table  With reference to FIGS. 3 and 4, in a first step E1, several addresses A1, A5, A6, A7, are reserved in the memory area 8. A specific sequence of instructions Instr.30, ..., Instr.36, bir is written in binary code, to successive addresses in memory area 8, the start address of which is address A1 o the instruction Instr.30 is written. In a second step E2, a first function is determined to be that from which calls are diverted so as to modify the behavior of the machine in comparison with that initially planned when this io first function is normally called. The address A3 at which the first instruction Instr.20 of the binary code of the first function resides is stored. An operating system generally includes a table, not shown here, which lists the functions, indicating for each the address of residence of its first instruction. This table is for example used by a compiler to transcribe in binary code a source code which calls upon functions which are listed there. A reading of this table

permet d'obtenir l'adresse A3 lorsque la fonction est déterminée par son nom.  provides the address A3 when the function is determined by its name.

Le code binaire contenu dans la zone mémoire 7 est parcouru de sorte que chaque fois qu'est détectée une instruction de branchement sur la première fonction, la valeur de l'adresse A2 à laquelle est détectée cette instruction de branchement, est sauvegardée dans une structure de données résidant à une adresse déterminée A8. Pour détecter l'instruction de branchement sur la première fonction, chaque foi qu'est reconnue une instruction bl_Aim de branchement sur une adresse relative Aim, la valeur d'adresse relative Aim est ajoutée à la valeur d'adresse courante pour laquelle l'instruction bl_Aim a été reconnue. Si le résultat est égal à la valeur d'adresse A3, ceci indique un branchement sur la première fonction. L'adresse courante constitue alors une adresse de type A2. A chaque foi qu'est détectée une instruction blAim de branchement sur la première fonction, en mémorisant l'instruction bl Aim à côté de la valeur d'adresse A2 dans la structure de données résidant à  The binary code contained in the memory area 7 is scanned so that each time a branching instruction is detected on the first function, the value of the address A2 at which this branching instruction is detected is saved in a structure data residing at a specified address A8. To detect the instruction to connect to the first function, each time a bl_Aim instruction to connect to a relative address Aim is recognized, the relative address value Aim is added to the current address value for which the instruction bl_Aim has been recognized. If the result is equal to the address value A3, this indicates a connection to the first function. The current address then constitutes an address of type A2. Each time a blAim instruction for connection to the first function is detected, by memorizing the instruction bl Aim next to the address value A2 in the data structure residing at

l'adresse A8, il est possible de rendre le procédé réversible.  address A8, it is possible to make the process reversible.

1o 2789193 Une troisième étape E3 succède aux étapes E1 et E2. Dans l'étape E3, une instruction blaA1 est écrite à chaque adresse A2 dont la valeur est mémorisée dans la structure de données résidant à l'adresse A8. Chaque première instruction détectée bl_Aim de branchement sur la première fonction, est ainsi remplacée par la deuxième instruction bla_A1. Dans l'exemple présenté o la deuxième instruction est une instruction de branchement absolu sur l'adresse A1, il n'est pas nécessaire de faire de calcul lié à la localisation de l'adresse A2 o le remplacement est effectué. Ceci permet d'accélérer les opérations de  1o 2789193 A third step E3 follows steps E1 and E2. In step E3, an instruction blaA1 is written to each address A2 whose value is stored in the data structure residing at address A8. Each first instruction bl_Aim detected for connection to the first function is thus replaced by the second instruction bla_A1. In the example presented where the second instruction is an instruction for absolute connection to the address A1, it is not necessary to make a calculation linked to the location of the address A2 where the replacement is carried out. This accelerates the operations of

io remplacement de chaque première instruction par la deuxième instruction.  io replacement of each first instruction by the second instruction.

Lorsque les processeurs 1, 2, 3, 4, sont équipés d'antémémoires, une étape E5 peut suivre l'étape E3. Dans l'étape E5, les lignes modifiées d'antémémoire sont purgées de façon à assurer que les modifications soient prises en compte  When the processors 1, 2, 3, 4 are equipped with cache memories, a step E5 can follow the step E3. In step E5, the modified cache lines are purged so as to ensure that the modifications are taken into account

par les processeurs.by processors.

La séquence spécifique rangée dans la zone mémoire 8 par l'étape El, débute par une opération de sauvegarde de contenus de registres du processeur CPU, et termine par une opération de restitution dans ces registres, des contenus sauvegardés. Ladite opération de restitution termine elle-même par  The specific sequence stored in the memory area 8 by step E1, begins with an operation of saving the contents of registers of the processor CPU, and ends with an operation of restoring in these registers, the contents saved. The return operation itself ends with

une instruction de type blr.an instruction of type blr.

L'opération de sauvegarde comprend des instructions Instr.30, Instr.31.  The backup operation includes instructions Instr.30, Instr.31.

L'instruction Instr.30 déclenche une écriture du contenu du registre LR à I'adresse A5. L'instruction Instr.31 déclenche une écriture du contenu du registre CTR à l'adresse A6. L'opération de restitution comprend des instructions Instr.35, Instr.36. L'instruction Instr.35 déclenche une écriture de la valeur contenue à l'adresse A5 dans le registre LR. L'instruction Instr.36 déclenche une écriture de la valeur contenue à l'adresse A6 dans le registre  The instruction Instr.30 triggers a writing of the content of the register LR to the address A5. The instruction Instr.31 triggers a writing of the content of the register CTR at the address A6. The return operation includes instructions Instr.35, Instr.36. The instruction Instr.35 triggers a writing of the value contained at address A5 in the register LR. The instruction Instr.36 triggers a writing of the value contained at address A6 in the register

CTR.CTR.

il 2789193 Entre l'opération de sauvegarde et l'opération de restitution, une suite d'instructions Instr.33,... constitue une séquence d'instructions prévue pour modifier le comportement de la machine en se substituant à la séquence  il 2789193 Between the backup operation and the restore operation, a sequence of instructions Instr.33, ... constitutes a sequence of instructions intended to modify the behavior of the machine by replacing the sequence

d'instructions Instr.20,..., Instr.24.  Instructions Instr. 20, ..., Instr. 24.

Il est intéressant de noter que la séquence spécifique d'instructions débutant à l'adresse A1, est indépendante a priori de l'adresse A3, c'est à dire du choix de la première fonction. Pour un utilisateur ne disposant pas de droits d'accès direct aux zones mémoires 7 et 8, il est possible de mettre en oeuvre le io procédé de modification de comportement lorsque la machine comprend une séquence du type de la séquence spécifique de code binaire précédemment  It is interesting to note that the specific sequence of instructions starting at address A1 is a priori independent of address A3, that is to say of the choice of the first function. For a user who does not have direct access rights to memory areas 7 and 8, it is possible to implement the behavior modification method when the machine comprises a sequence of the type of the specific sequence of binary code previously.

décrite et une interface utilisateur 13.  described and a user interface 13.

L'interface utilisateur 13 comprend une entrée 14 prévue pour recevoir un nom de fonction et une entrée 16 prévue pour recevoir un ordre d'activation/désactivation. Pour permettre un choix entre plusieurs séquences spécifiques, I'interface peut comprendre de plus une entrée 15 prévue pour recevoir un nom de séquence spécifique. Le nom de fonction à dérouter, reçu en entrée 14, sert à exécuter l'étape E2. Le nom de séquence spécifique, reçu en entrée 15, sert à exécuter l'étape El. Lorsqu'elle reçoit en entrées 14, 16, un nom de fonction et un ordre d'activation, l'interface déclenche les étapes El, E2 du procédé de modification de comportement. L'interface 13 dispose de moyens de contrôle qui, par exemple valident l'entrée 16 à condition qu'un nom soit présenté en entrée 14, ou par exemple utilise un nom de séquence  The user interface 13 comprises an input 14 provided for receiving a function name and an input 16 provided for receiving an activation / deactivation order. To allow a choice between several specific sequences, the interface may further comprise an entry 15 intended to receive a specific sequence name. The function name to be routed, received at input 14, is used to execute step E2. The specific sequence name, received at input 15, is used to execute step El. When it receives at inputs 14, 16, a function name and an activation order, the interface triggers steps El, E2 of the behavior modification process. The interface 13 has control means which, for example validate entry 16 provided that a name is presented at entry 14, or for example use a sequence name

spécifique par défaut si aucun nom n'est présenté en entrée 15.  specific by default if no name is presented as input 15.

Une étape E6 peut succéder à l'étape E3 ou E5, lorsque c'est souhaité. L'étape E6 effectue l'opération inverse de l'étape E3. La structure de donnée résidant à l'adresse A8 est parcourue. Pour chaque valeur d'adresse A2 lue, I'instruction bl_Aim mémorisée à coté de cette valeur d'adresse A2, est écrite à l'adresse A2 de la zone mémoire 7. Ceci permet de rendre le procédé de modification de  A step E6 can follow the step E3 or E5, when desired. Step E6 performs the reverse operation of step E3. The data structure residing at address A8 is traversed. For each address value A2 read, the instruction bl_Aim stored next to this address value A2, is written to the address A2 of the memory area 7. This makes it possible to make the method for modifying

12 278919312 2789193

comportement réversible. En effet, la réécriture de toutes les instructions de branchement bl_Aim originelles sur la première fonction, redonne à la machine  reversible behavior. Indeed, the rewriting of all the original bl_Aim connection instructions on the first function, gives back to the machine

son comportement initial.its initial behavior.

Il est possible de déclencher l'étape E6 après l'étape E3 ou l'étape E5 au moyen de l'interface opérateur 13, en présentant en entrée 16, un ordre de désactivation. Lorsque les processeurs 1, 2, 3, 4, sont équipés d'antémémoires, une étape E7 o peut suivre l'étape E6. Dans l'étape E7, les lignes modifiées d'antémémoire sont purgées de façon à assurer que les modifications soient prises en compte  It is possible to trigger step E6 after step E3 or step E5 by means of the operator interface 13, by presenting, at input 16, a deactivation order. When the processors 1, 2, 3, 4 are equipped with cache memories, a step E7 o can follow the step E6. In step E7, the modified cache lines are purged so as to ensure that the modifications are taken into account

par les processeurs.by processors.

Une étape E4 améliore le procédé de la façon suivante. L'étape E4 est activée avant l'étape E3. En étape E4, une séquence d'instructions Instr.40,..., Instr.46, blr, est copiée à des adresses successives d'une zone mémoire 9, en débutant à une adresse A4. Lorsque l'étape E4 est activée, la séquence spécifique d'instructions chargée en zone mémoire 8 par l'étape E1 est une séquence spécifique particulière comprenant la sauvegarde des contenus des registres LR et CTR, le chargement de l'adresse A4 dans le registre de comptage du processeur, I'instruction bctrl_A4 de branchement à l'adresse contenue dans le registre de comptage, puis la restitution, dans les registres  A step E4 improves the process in the following way. Step E4 is activated before step E3. In step E4, a sequence of instructions Instr.40, ..., Instr.46, blr, is copied to successive addresses of a memory area 9, starting at an address A4. When step E4 is activated, the specific sequence of instructions loaded into memory area 8 by step E1 is a specific specific sequence comprising saving the contents of the registers LR and CTR, loading the address A4 into the register counting of the processor, the instruction bctrl_A4 of connection to the address contained in the counting register, then the restitution, in the registers

LR et CTR, des contenus sauvegardés. La séquence d'instructions Instr.40,  LR and CTR, saved content. The instruction sequence Instr.40,

....DTD: Instr.46, blr, constitue le code binaire d'une fonction de substitution, c'est à dire d'une deuxième fonction que l'on souhaite exécuter à la place de la première fonction. Ceci n'empêche pas la deuxième fonction d'appeler la première  .... DTD: Instr.46, blr, constitutes the binary code of a substitution function, ie of a second function which one wishes to execute in place of the first function. This does not prevent the second function from calling the first

fonction si l'exécution de la première fonction est nécessaire.  function if the execution of the first function is necessary.

La copie en zone 9, du code binaire de la deuxième fonction présente plusieurs avantages. Le code binaire de la deuxième fonction peut résider dans des pages 11, 12, quelconques de la mémoire 5. C'est à partir de ces pages que  The copy in zone 9 of the binary code of the second function has several advantages. The binary code of the second function can reside in any pages 11, 12 of the memory 5. It is from these pages that

13 278919313 2789193

s'effectue la copie. Ainsi, par exemple, les pages 11, 12, peuvent être à des adresses éloignées des zones mémoire 7 à 9. Par exemple encore, il est possible d'écrire la deuxième fonction dans un langage évolué pour constituer un code source. On évite une programmation fastidieuse de code binaire ou de code assembleur. Ensuite, il est possible de compiler le code source de la deuxième fonction pour obtenir le code binaire de la deuxième fonction, au moyen d'un compilateur. Le compilateur range le code binaire dans le lieu de mémoire qui lui convient. Il se peut que le code binaire généré par le  the copy is made. Thus, for example, pages 11, 12 can be at addresses far from memory areas 7 to 9. For example again, it is possible to write the second function in an advanced language to constitute a source code. Tedious programming of binary code or assembly code is avoided. Then, it is possible to compile the source code of the second function to obtain the binary code of the second function, using a compiler. The compiler stores the binary code in the memory location that suits it. The binary code generated by the

compilateur chevauche deux pages 11 et 12.  compiler overlaps two pages 11 and 12.

Si on le souhaite, il est possible de programmer la deuxième fonction en langage évolué, de façon à faire appel à la première fonction. Le compilateur se charge de générer des instructions Instr.42,..., Instr.44 pour coder en binaire cet appel. Le compilateur se charge par exemple de générer une l5 instruction bctrlA3 sur l'adresse A3 de la première fonction tel qu'on le voit en figure 4. Ceci est avantageux lorsque la première fonction reste nécessaire au  If desired, it is possible to program the second function in advanced language, so as to call on the first function. The compiler is responsible for generating Instr.42, ..., Instr.44 instructions to binary code this call. The compiler is responsible for example of generating a l5 instruction bctrlA3 on the address A3 of the first function as seen in FIG. 4. This is advantageous when the first function remains necessary for the

fonctionnement de la machine.machine operation.

Si les séquences d'instructions résidant en zone mémoire 7 sont exécutées en mode d'adressage virtuel, le déroutement de la première fonction bénéficie de ce mode d'adressage. Cependant, il est possible que les séquences d'instructions résidant en zone mémoire 7 soient exécutées en mode d'adressage physique. De préférence, l'adresse A4 est une adresse de début de page physique 10 résidant en zone mémoire 9. En s'assurant que le code binaire de la deuxième fonction tient sur une page physique, la recopie en zone mémoire 9 fait tenir le code binaire de la deuxième fonction sur la seule page 10. Les problèmes de connexité de pages qui peuvent se poser en mode d'adressage physique sont résolus car la successivité des adresses en absence de branchement est conservée. Si le code binaire ne tient pas sur une seule page physique, il convient d'effectuer la copie sur des pages physiques  If the instruction sequences residing in memory area 7 are executed in virtual addressing mode, the diversion of the first function benefits from this addressing mode. However, it is possible that the sequences of instructions residing in memory area 7 are executed in physical addressing mode. Preferably, the address A4 is a physical beginning of page address 10 residing in memory area 9. By ensuring that the binary code of the second function fits on a physical page, the copying in memory area 9 makes the code hold binary of the second function on the single page 10. The problems of page connectivity which may arise in physical addressing mode are solved because the successiveness of the addresses in the absence of connection is preserved. If the binary code does not fit on a single physical page, the copy should be made on physical pages

qui se succèdent.one after the other.

14 278919314 2789193

Il est possible d'activer l'étape E4 au moyen de l'interface 13 en présentant sur une entrée 17 de l'interface 13, un nom de fonction de substitution dont le code réside dans la mémoire 5 de la machine. L'interface 13 comprend des moyens pour vérifier que le nom présenté sur l'entrée 14 est celui de la séquence  It is possible to activate step E4 by means of the interface 13 by presenting on an input 17 of the interface 13, a name of substitution function whose code resides in the memory 5 of the machine. The interface 13 includes means for verifying that the name presented on the input 14 is that of the sequence

spécifique particulière.specific specific.

Dans le cas o l'étape E4 est activée, I'étape E1 charge dans la zone mémoire 8, la séquence spécifique particulière qui contient une instruction bctrlA4 pour io effectuer un branchement sur l'adresse A4. L'instruction bctrl a pour effet de charger dans le registre IAR d'un processeur qui l'exécute, le contenu du registre CTR de ce processeur et dans le registre LR de ce processeur, la valeur de l'adresse qui suit celle à laquelle réside l'instruction bctrl. L'utilisation de l'instruction bctrl présente un intérêt qui est celui de pouvoir se brancher à  In the case where step E4 is activated, step E1 loads into the memory area 8, the specific specific sequence which contains an instruction bctrlA4 to make a connection to the address A4. The bctrl instruction has the effect of loading into the IAR register of a processor which is executing it, the content of the CTR register of this processor and into the LR register of this processor, the value of the address which follows that at which resides the instruction bctrl. The advantage of using the bctrl instruction is that of being able to connect to

une adresse quelconque dont la valeur est contenue dans le registre CTRL.  any address whose value is contained in the CTRL register.

L'instruction bctrl de la séquence spécifique d'instructions est alors précédée d'une instruction Instr.33 dont l'effet est de ranger dans le registre CTRL, la  The bctrl instruction of the specific sequence of instructions is then preceded by an Instruction 33 instruction whose effect is to store in the CTRL register, the

valeur d'adresse A4.address value A4.

Après mise en oeuvre du procédé, la machine fonctionne tel qu'expliqué en référence à la figure 4. Supposons par exemple que le processeur 2 exécute les instructions Instr.10 à Instr.15 résidentes dans la zone mémoire 7. Lorsque le registre IAR du processeur 2 contient l'adresse A2, le processeur 2 décode l'instruction bla_A1. En décodant l'instruction bla _A1, le processeur 2 range dans son registre LR, I'adresse suivant l'adresse A2 et range dans son registre IAR l'adresse A1 en valeur absolue. Aux cycles suivants, le processeur 2 décode alors la séried'instructions de sauvegarde Instr.30, Instr.31 qui débute à l'adresse A1 dans la zone mémoire 8. En décodant la série d'instructions Instr.30, Instr.31, le processeur 2 écrit la valeur contenue dans son registre LR et la valeur contenue dans son registre CTR, aux adresses A5, A6. Ensuite, le processeur 2 décode la série d'instructions d'insertion qui commence à  After implementation of the method, the machine operates as explained with reference to FIG. 4. Suppose for example that the processor 2 executes the instructions Instr.10 to Instr.15 resident in the memory area 7. When the IAR register of the processor 2 contains address A2, processor 2 decodes the instruction bla_A1. By decoding the instruction bla _A1, the processor 2 stores in its register LR, the address according to the address A2 and stores in its register IAR the address A1 in absolute value. In the following cycles, the processor 2 then decodes the series of backup instructions Instr.30, Instr.31 which begins at address A1 in the memory area 8. By decoding the series of instructions Instr.30, Instr.31, processor 2 writes the value contained in its register LR and the value contained in its register CTR, at addresses A5, A6. Then, processor 2 decodes the series of insertion instructions which begins to

27891932789193

l'instruction Instr.32. Ensuite, le processeur 2 décode la série d'instructions de restitution Instr.35, Instr.36 qui range les valeurs écrites aux adresses A5, A6, dans les registres LR et CTR. Ainsi, les registres LR et CTR du processeur 2, contiennent à nouveau les valeurs qu'ils contenaient immédiatement après que le registre IAR contienne l'adresse A2. En particulier, le registre LR contient l'adresse de l'instruction Instr.14 qui suit l'adresse blaA1 dans la zone mémoire 7. A la suite de la dernière instruction Instr.36 de la série d'instructions de restitution, le processeur 2 décode l'instruction blr. En décodant l'instruction blr, le processeur 2 range dans son registre IAR, le io contenu de son registre LR. Ainsi, aux cycles suivants, le processeur 2 exécute les instructions Instr.14, lnstr.15 résidant dans la zone mémoire 7. La sauvegarde avant, puis la restitution après exécution de la série d'instructions d'insertion permet à la série d'instructions d'insertion de modifier le contenu des registres LR et CTR si besoin est, et permet de revenir à toute instruction Instr.14 qui suit toute instruction blaA1 car le code des instructions Instr.30 à  instruction Instr. 32. Next, the processor 2 decodes the series of restitution instructions Instr.35, Instr.36 which stores the values written at the addresses A5, A6, in the registers LR and CTR. Thus, the registers LR and CTR of processor 2, again contain the values which they contained immediately after the register IAR contains the address A2. In particular, the register LR contains the address of the instruction Instr.14 which follows the address blaA1 in the memory area 7. Following the last instruction Instr.36 of the series of restitution instructions, the processor 2 decodes the instruction blr. By decoding the instruction blr, the processor 2 stores in its register IAR, the content of its register LR. Thus, in the following cycles, the processor 2 executes the instructions Instr.14, lnstr.15 residing in the memory area 7. The saving before, then the restitution after execution of the series of insertion instructions allows the series of insertion instructions to modify the content of the registers LR and CTR if necessary, and allows to return to any instruction Instr.14 which follows any instruction blaA1 because the code of instructions Instr.30 to

Instr.36 est indépendant de l'adresse A2.  Instr. 36 is independent of address A2.

La série d'instructions d'insertion mentionnée ci-dessus, peut contenir des instructions simples que l'on désire insérer entre les instructions Instr.12 et Instr.14 dans la zone mémoire 7. Selon la mise en oeuvre de l'invention présentée en figure 4, lorsque le processeur 2 décode la série d'instructions Instr.32, Instr.33, le processeur 2 charge la valeur résidant à l'adresse A7 et la range dans son registre CTR. Comme la valeur résidant à l'adresse A7 est l'adresse A4 de l'instruction Instr.40, le registre CTR contient alors l'adresse A4. Ensuite, le processeur 2 exécute l'instruction bctrl qui précède l'instruction Instr. 35. En exécutant l'instruction bctrl, le processeur 2 range dans son registre LR, I'adresse o réside l'instruction Instr.35 et range dans son registre  The series of insertion instructions mentioned above may contain simple instructions which it is desired to insert between the instructions Instr.12 and Instr.14 in the memory area 7. According to the implementation of the invention presented in FIG. 4, when the processor 2 decodes the series of instructions Instr.32, Instr.33, the processor 2 loads the value residing at the address A7 and stores it in its register CTR. Since the value residing at address A7 is the address A4 of the instruction Instr.40, the register CTR then contains the address A4. Next, the processor 2 executes the instruction bctrl which precedes the instruction Instr. 35. By executing the instruction bctrl, the processor 2 stores in its register LR, the address where the instruction Instr. 35 resides and stores in its register

IAR, le contenu du registre CTR, c'est à dire l'adresse A4.  IAR, the content of the CTR register, i.e. the address A4.

Lorsque le registre IAR du processeur 2, contient l'adresse A4, le processeur 2 décode l'instruction Instr.40 résidant dans la zone mémoire 9, puis, par  When the IAR register of the processor 2 contains the address A4, the processor 2 decodes the instruction Instr.40 residing in the memory area 9, then, by

16 278919316 2789193

incrémentations successives du registre IAR, la suite des instructions Instr.41 à Instr.46 jusqu'à arriver à l'instruction bir qui suit l'instruction Instr.46. En décodant l'instruction bir, le processeur 2 range le contenu de son registre LR dans son registre IAR, c'est à dire l'adresse de l'instruction Instr.35. Le processeur 2 enchaîne ainsi les instructions suivantes Instr.35, Instr.36 résidant dans la zone mémoire 8 puis les instructions Instr.14, Instr.15 résidant  successive increments of the IAR register, the continuation of the instructions Instr.41 to Instr.46 until arriving at the bir instruction which follows the instruction Instr.46. By decoding the instruction bir, the processor 2 stores the content of its register LR in its register IAR, that is to say the address of the instruction Instr. 35. The processor 2 thus links the following instructions Instr.35, Instr.36 residing in the memory area 8 then the instructions Instr.14, Instr.15 residing

dans la zone mémoire 7.in memory area 7.

Les explications qui précèdent pour le processeur 2 restent valables pour tout io processeur 1, 3, 4 de la machine. Il est intéressant de noter que le remplacement de la première instruction bl_Aim par la deuxième instruction bla_A1 ne crée pas de perturbation dans le fonctionnement de la machine, même si un processeur exécute l'une des instructions Instr.12 à Instr.14 pendant le remplacement. En effet: - si le processeur exécute l'instruction Instr.14, le comportement de la machine provoqué précédemment par le branchement en adresse A2 sur la première fonction n'a simplement pas été modifié par le remplacement, il le sera au branchement suivant; - si le processeur exécute l'instruction Instr.12, le processeur exécute ensuite l'instruction résidant à l'adresse A2 qui est l'instruction blaA1 pour exécuter ultérieurement l'instruction Instr.14 car son registre LR contient l'adresse suivante de l'adresse A2 au moment du branchement qui modifie alors le comportement de la machine; - si le processeur exécute l'instruction résidant à l'adresse A2, quelque soit le  The foregoing explanations for processor 2 remain valid for any processor 1, 3, 4 of the machine. It is interesting to note that the replacement of the first instruction bl_Aim by the second instruction bla_A1 does not create any disturbance in the operation of the machine, even if a processor executes one of the instructions Instr.12 to Instr.14 during the replacement . Indeed: - if the processor executes the instruction Instr.14, the behavior of the machine previously provoked by the connection to address A2 on the first function has simply not been modified by the replacement, it will be so on the following connection; - if the processor executes the instruction Instr.12, the processor then executes the instruction residing at address A2 which is the instruction blaA1 to subsequently execute the instruction Instr.14 because its register LR contains the following address of address A2 at the time of connection, which then modifies the behavior of the machine; - if the processor executes the instruction residing at address A2, whatever the

type de branchement, le registre LR contient l'adresse de l'instruction Instr.14.  type of connection, the LR register contains the address of the instruction Instr.14.

Si le branchement est effectif sur l'adresse A3, la séquence d'instructions débutant à l'adresse A1 n'est pas exécutée et le retour sur l'instruction Instr.14 est assuré par exécution de l'instruction blr qui suit l'instruction Instr.24. Si le branchement est effectif sur l'adresse A1, la séquence d'instructions débutant à I'adresse A1 est exécutée et le retour sur l'instruction Instr.14 est assuré par  If the connection is effective at address A3, the sequence of instructions starting at address A1 is not executed and the return to instruction Instr.14 is ensured by execution of the instruction blr which follows the instruction Instr. 24. If the connection is effective at address A1, the sequence of instructions starting at address A1 is executed and the return to instruction Instruction 14 is ensured by

exécution de l'instruction blr qui suit l'instruction Instr.36.  execution of the instruction blr which follows the instruction Instr. 36.

17 278919317 2789193

On remarque dans la séquence d'instructions Instr.40,..., Instr.46, bir, résidant dans la zone mémoire 9 que:  Note in the instruction sequence Instr.40, ..., Instr.46, bir, residing in memory area 9 that:

- en absence d'instruction bctrl_A3, la séquence d'instructions Instr.40,  - in the absence of a bctrl_A3 instruction, the instruction sequence Instr.40,

....DTD: Instr.46, bir, se substitue purement et simplement à la séquence d'instructions Instr.20,..., Instr.24, blr; - en présence d'une instruction bctrl_A3 en fin de séquence d'instructions Instr.40,..., Instr.46, un enchaînement de la séquence d'instructions Instr.40, Instr. 46, s'insère avant l'enchaînement des instructions Instr.20,..., Instr. 24, bir; - en présence d'une instruction bctrl_A3 en début de séquence d'instructions Instr.40,..., Instr.46, un enchaînement de la séquence d'instructions Instr.40, lnstr.46, s'insère après l'enchaînement des instructions Instr.20,..., lnstr.24, bir;  .... DTD: Instr.46, bir, simply replaces the sequence of instructions Instr.20, ..., Instr.24, blr; - in the presence of an instruction bctrl_A3 at the end of the instruction sequence Instr.40, ..., Instr.46, a sequence of the instruction sequence Instr.40, Instr. 46, is inserted before the sequence of instructions Instr. 20, ..., Instr. 24, bir; - in the presence of an instruction bctrl_A3 at the start of the instruction sequence Instr.40, ..., Instr.46, a sequence of the sequence of instructions Instr.40, lnstr.46, is inserted after the sequence instructions Instr.20, ..., lnstr.24, bir;

- en présence d'une instruction bctrl_A3 parmi les instructions Instr.40,  - in the presence of a bctrl_A3 instruction among the Instr.40 instructions,

....DTD: Instr.46, un enchaînement de la séquence d'instructions Instr.40,..., Instr.46,  .... DTD: Instr.46, a sequence of instructions Instr.40, ..., Instr.46,

s'insère avant et après l'enchaînement des instructions Instr.20,..., Instr.24, bir.  is inserted before and after the sequence of instructions Instr.20, ..., Instr.24, bir.

Ainsi, le procédé selon l'invention permet d'insérer l'enchaînement d'un nombre quelconque d'instructions Instr.40,..., Instr.46, avant et ou après, ou à la place  Thus, the method according to the invention makes it possible to insert the sequence of any number of instructions Instr.40, ..., Instr.46, before and or after, or instead

de l'enchaînement d'une séquence quelconque d'instructions Instr.20,....  the sequence of any sequence of instructions Instr.20, ....

Instr.24, sans avoir à modifier les adresses des instructions qui résident dans  Instr. 24, without having to change the addresses of the instructions that reside in

la zone mémoire 7. De plus, I'enchainement des instructions Instr.40,....  memory area 7. In addition, the sequence of instructions Instr.40, ....

Instr.46, peut résulter d'une fonction élaborée par des moyens logiciels standards sans avoir à se préoccuper du fait que les instructions résidant en  Instr. 46, can result from a function developed by standard software means without having to worry about the fact that the instructions residing in

mémoire 7 soient exécutées en mode d'adressage virtuel ou physique.  memory 7 are executed in virtual or physical addressing mode.

18 278919318 2789193

Claims (7)

REVENDICATIONS 1. Procédé pour modifier le comportement d'une machine informatique en cours d'exécution de fonctions en code binaire contenu dans une première zone mémoire (7) de ladite machine, par au moins un processeur (1, 2) de ladite machine, caractérisé en ce qu'il comprend: - une première étape (El) consistant à ranger dans une deuxième zone mémoire (8) de ladite machine, une première séquence spécifique de code binaire (Instr. 30,..., Instr.36, bir) débutant à une première adresse déterminée io (A1) de ladite deuxième zone mémoire (8); - une deuxième étape (E2) consistant à parcourir le code binaire contenu dans la première zone mémoire (7) pour trouver des adresses (A2) auxquelles apparaît une première instruction de branchement (blAim) sur une première fonction déterminée et à sauvegarder les adresses (A2) ainsi trouvées dans une structure de données située à une deuxième adresse déterminée (A8); - une troisième étape (E3) succédant aux deux étapes précédentes (El) et (E2), consistant à remplacer la première instruction de branchement (blAim) par une deuxième instruction de branchement (bla A1) sur ladite première adresse déterminée (A1), en écrivant aux adresses (A2) ladite deuxième  1. Method for modifying the behavior of a computer machine during the execution of functions in binary code contained in a first memory area (7) of said machine, by at least one processor (1, 2) of said machine, characterized in that it comprises: - a first step (El) consisting in storing in a second memory area (8) of said machine, a first specific sequence of binary code (Instr. 30, ..., Instr. 36, bir ) starting at a first determined address io (A1) of said second memory area (8); a second step (E2) consisting in browsing the binary code contained in the first memory area (7) to find addresses (A2) to which a first connection instruction (blAim) appears on a first determined function and to save the addresses ( A2) thus found in a data structure located at a second determined address (A8); a third step (E3) succeeding the two preceding steps (E1) and (E2), consisting in replacing the first connection instruction (blAim) with a second connection instruction (bla A1) on said first determined address (A1), by writing to the addresses (A2) said second instruction de branchement.connection instruction. 2. Procédé selon la revendication 1, caractérisé en ce qu'il comprend: une quatrième étape (E4) précédant la troisième étape (E3), consistant à ranger dans une troisième zone mémoire (9) de ladite machine, une deuxième séquence de code binaire (Instr.40,..., Instr.46, blr) réalisant une deuxième fonction déterminée, à une troisième adresse déterminée (A4); et en ce que la première séquence spécifique de code binaire contient au moins une instruction de branchement (bctrlA4) sur ladite deuxième fonction déterminée.  2. Method according to claim 1, characterized in that it comprises: a fourth step (E4) preceding the third step (E3), consisting in storing in a third memory area (9) of said machine, a second sequence of code binary (Instr.40, ..., Instr.46, blr) performing a second determined function, at a third determined address (A4); and in that the first specific binary code sequence contains at least one branch instruction (bctrlA4) on said second determined function. 19 278919319 2789193 3. Procédé selon la revendication 2, caractérisé en ce que la première séquence spécifique de code binaire contient: - une ou plusieurs instructions pour sauvegarder le contenu d'un registre de lien (LR) et d'un registre de comptage (CTR) du processeur sur lequel la première séquence spécifique s'exécute, au moyen d'une quatrième adresse déterminée (A5); - une instruction pour charger la troisième adresse déterminée (A4) dans le registre de comptage (CTR); - une instruction de branchement utilisant le registre de comptage (CTR); - une ou plusieurs instructions pour charger dans le registre de lien (LR) et dans le registre de comptage (CTR) le contenu sauvegardé au moyen de la quatrième adresse déterminée (A5);  3. Method according to claim 2, characterized in that the first specific sequence of binary code contains: - one or more instructions for saving the content of a link register (LR) and a counting register (CTR) of the processor on which the first specific sequence is executed, by means of a fourth determined address (A5); - an instruction to load the third determined address (A4) into the counting register (CTR); - a connection instruction using the counting register (CTR); - one or more instructions to load in the link register (LR) and in the counting register (CTR) the content saved by means of the fourth determined address (A5); - une instruction de retour basée sur le contenu du registre de lien (LR).  - a return instruction based on the content of the link register (LR). I,  I, 4. Procédé selon la revendication 2, caractérisé en ce que la deuxième séquence de code binaire est contenue dans une seule page physique de la4. Method according to claim 2, characterized in that the second sequence of binary code is contained in a single physical page of the machine, ou à défaut, dans des pages physiques contigues de la machine.  machine, or failing that, in contiguous physical pages of the machine. 5. Procédé selon la revendication 2, caractérisé en ce que la deuxième séquence de code binaire contient une instruction (bctrlA3) dont l'exécution a pour effet un branchement sur l'adresse de la première instruction (Instr.20) de  5. Method according to claim 2, characterized in that the second binary code sequence contains an instruction (bctrlA3) whose execution has the effect of connecting to the address of the first instruction (Instr.20) of code binaire de la première fonction.  binary code of the first function. 6. Machine informatique dont le comportement résulte d'exécutions de code binaire de fonctions, ledit code binaire résidant dans une première zone mémoire (7) d'une unité de mémoire (5), caractérisée en ce qu'elle comprend hors de la première zone mémoire (7): - une séquence spécifique de code binaire (Instr.30,..., Instr.36, blr) dont une exécution modifie le comportement de la machine; - une interface opérateur (13) comprenant une entrée (14) pour recevoir un nom de première fonction dont le code binaire réside dans la première zone  6. Computer machine whose behavior results from the execution of binary code of functions, said binary code residing in a first memory area (7) of a memory unit (5), characterized in that it comprises outside the first memory area (7): - a specific sequence of binary code (Instr.30, ..., Instr.36, blr) whose execution modifies the behavior of the machine; - an operator interface (13) comprising an input (14) for receiving a first function name whose binary code resides in the first zone 27891932789193 mémoire (7), prévue pour ranger dans une deuxième zone mémoire (8) ladite séquence spécifique de code binaire à partir d'une première adresse déterminée (A1) et pour remplacer dans la première zone mémoire (7), chaque instruction de branchement sur ladite première fonction par une instruction de branchement sur ladite première adresse (A1).  memory (7), provided for storing in a second memory area (8) said specific sequence of binary code from a first determined address (A1) and for replacing in the first memory area (7), each instruction for connection to said first function by an instruction to connect to said first address (A1). 7. Machine informatique selon la revendication 5, caractérisée en ce qu'elle comprend hors de la première zone mémoire (7), une deuxième séquence de code binaire réalisant une deuxième fonction déterminée, en ce que l'interface io opérateur (13) comprend une entrée (17) pour recevoir un nom de deuxième fonction, prévue pour ranger une deuxième séquence de code binaire réalisant la deuxième fonction dans une troisième zone mémoire (9), et en ce que ladite séquence spécifique de code binaire comprend une instruction de7. Computer machine according to claim 5, characterized in that it comprises, outside the first memory area (7), a second sequence of binary code performing a second determined function, in that the operator interface (13) comprises an input (17) for receiving a second function name, provided for storing a second sequence of binary code performing the second function in a third memory area (9), and in that said specific sequence of binary code comprises an instruction for branchement sur la deuxième séquence de code binaire en zone mémoire (9).  connection to the second binary code sequence in the memory area (9).
FR9901004A 1999-01-29 1999-01-29 METHOD FOR MODIFYING THE BEHAVIOR OF A COMPUTER MACHINE Expired - Fee Related FR2789193B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
FR9901004A FR2789193B1 (en) 1999-01-29 1999-01-29 METHOD FOR MODIFYING THE BEHAVIOR OF A COMPUTER MACHINE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
FR9901004A FR2789193B1 (en) 1999-01-29 1999-01-29 METHOD FOR MODIFYING THE BEHAVIOR OF A COMPUTER MACHINE

Publications (2)

Publication Number Publication Date
FR2789193A1 true FR2789193A1 (en) 2000-08-04
FR2789193B1 FR2789193B1 (en) 2001-08-10

Family

ID=9541363

Family Applications (1)

Application Number Title Priority Date Filing Date
FR9901004A Expired - Fee Related FR2789193B1 (en) 1999-01-29 1999-01-29 METHOD FOR MODIFYING THE BEHAVIOR OF A COMPUTER MACHINE

Country Status (1)

Country Link
FR (1) FR2789193B1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4394729A (en) * 1980-10-16 1983-07-19 Ncr Corporation Jump return stack
EP0416767A2 (en) * 1989-09-08 1991-03-13 Digital Equipment Corporation Position independent code location system
US5495612A (en) * 1992-09-30 1996-02-27 Kabushiki Kaisha Toshiba System for dynamically changing an execution program and method for doing the same
US5579520A (en) * 1994-05-13 1996-11-26 Borland International, Inc. System and methods for optimizing compiled code according to code object participation in program activities
US5781776A (en) * 1995-11-01 1998-07-14 Allen Bradley Company, Inc. Industrial controller permitting program editing during program execution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4394729A (en) * 1980-10-16 1983-07-19 Ncr Corporation Jump return stack
EP0416767A2 (en) * 1989-09-08 1991-03-13 Digital Equipment Corporation Position independent code location system
US5495612A (en) * 1992-09-30 1996-02-27 Kabushiki Kaisha Toshiba System for dynamically changing an execution program and method for doing the same
US5579520A (en) * 1994-05-13 1996-11-26 Borland International, Inc. System and methods for optimizing compiled code according to code object participation in program activities
US5781776A (en) * 1995-11-01 1998-07-14 Allen Bradley Company, Inc. Industrial controller permitting program editing during program execution

Also Published As

Publication number Publication date
FR2789193B1 (en) 2001-08-10

Similar Documents

Publication Publication Date Title
US9602347B2 (en) Method, system and program for browser to switch IE kernel
US7340566B2 (en) System and method for initializing a memory device from block oriented NAND flash
US8196129B2 (en) Adaptive class loading
JP3093624B2 (en) Method and apparatus for handling speculative exceptions
US6993663B1 (en) Input buffer overrun checking and prevention
EP1619590B1 (en) Method for programming a system on a chip DMA controller and system on a chip therefore.
US20050278318A1 (en) Iterative development with prioritized build
US20040088694A1 (en) Systems and methods for updating software
US7539851B2 (en) Using register readiness to facilitate value prediction
JP2005182775A (en) Driver-specific context for kernel mode shimming
EP1617335A1 (en) Method of programming a DMA controller in an on-chip system and the associated on-chip system
US6110227A (en) Systems and methods for pre-processing variable initializers
US20150317347A1 (en) Portable Application Registry
US20120331489A1 (en) Bypassing user mode redirection
CN114144764A (en) Stack tracing using shadow stack
US7735076B2 (en) Faster loading of extension-based applications using caching
FR2789193A1 (en) Method for modifying behavior of computer under execution of functions in binary code by replacing first branching instruction by second branching instruction at first determined address
JP3652956B2 (en) Emulation device
US7552451B2 (en) Persisting state across navigations in a navigation-based application and responding to navigation-related events throughout an application
FR2801693A1 (en) Data processing system performing instructions of streaming single-instruction-multiple data extension set by executing once again first instruction with regard to first fraction of data with recording its results
US20040064681A1 (en) Stack-pointer update technique
US20240028336A1 (en) Techniques for reducing cpu privilege boundary crossings
CN113031956A (en) Program compiling method and device and program running method and device
EP4131041A1 (en) Method for verifying execution of a software program
TW480445B (en) Method for downloading application programs on the compiler system platform of an electronic communication device

Legal Events

Date Code Title Description
PLFP Fee payment

Year of fee payment: 18

ST Notification of lapse

Effective date: 20170929