issue109:migrerdevax
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue109:migrerdevax [2016/05/29 17:58] – créée auntiee | issue109:migrerdevax [2016/06/13 18:08] (Version actuelle) – auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | In the early days of computers, a company called Digital Equipment Corporation (DEC) created its 32-bit VAX computer using openVMS as its operating system. Because a VAX/VMS computer is so reliable, there are today - after more than 25 years - still a large number of them in use. But, in the end, even these reliable computers will have to be replaced. As described in part 1, you could migrate from VAX/VMS to Linux, as the way Linux works is largely compatible with VAX/VMS. If you use Pascal as your programming language, you will find that Lazarus/ | + | **In the early days of computers, a company called Digital Equipment Corporation (DEC) created its 32-bit VAX computer using openVMS as its operating system. Because a VAX/VMS computer is so reliable, there are today - after more than 25 years - still a large number of them in use. But, in the end, even these reliable computers will have to be replaced. As described in part 1, you could migrate from VAX/VMS to Linux, as the way Linux works is largely compatible with VAX/VMS. If you use Pascal as your programming language, you will find that Lazarus/ |
- | DCL | + | Au début des ordinateurs, |
+ | |||
+ | **DCL | ||
When you log on to a Linux system (or start the terminal), a program is started to prompt you for commands. This is called the shell, and in my case this program is Bash. When you log on to a VMS system, the same happens. On VMS, this program is called DCL (Digital Command Language). | When you log on to a Linux system (or start the terminal), a program is started to prompt you for commands. This is called the shell, and in my case this program is Bash. When you log on to a VMS system, the same happens. On VMS, this program is called DCL (Digital Command Language). | ||
- | For the user, it looks like there is no difference, but the way these programs work is quite different. As mentioned in part 3, there is one big difference: DCL is a real shell, it wraps around a process and every time an executable (“image” in VMS) is started, it runs within this shell, within the same memory, with the same logicals and symbols (environment variables), and with the same process ID. Bash is called a shell, but it is NOT! It is a CLI (Command Line Interpreter). Every time an executable is started in Linux, it's started in a new subprocess with a different PID. | + | For the user, it looks like there is no difference, but the way these programs work is quite different. As mentioned in part 3, there is one big difference: DCL is a real shell, it wraps around a process and every time an executable (“image” in VMS) is started, it runs within this shell, within the same memory, with the same logicals and symbols (environment variables), and with the same process ID. Bash is called a shell, but it is NOT! It is a CLI (Command Line Interpreter). Every time an executable is started in Linux, it's started in a new subprocess with a different PID.** |
- | Another difference is the use of the “$”-character. In VMS, it has no meaning and is frequently used in names of logicals (like SYS$SYSTEM), | + | DCL |
+ | |||
+ | Quand vous vous identifiez dans un système Linux (ou ouvrez un terminal), un programme est lancé pour vous demander les commandes. Il est appelé le « shell » et, dans mon cas, le programme est Bash. Quand vous entrez dans un système VMS, c'est identique. Sur VMS, le programme s' | ||
+ | |||
+ | Pour l' | ||
+ | |||
+ | **Another difference is the use of the “$”-character. In VMS, it has no meaning and is frequently used in names of logicals (like SYS$SYSTEM), | ||
DCL has a powerful set of built-in commands and functions. These are so versatile that entire programs have been written in DCL functions. When you migrate a VMS system to Linux, you will have to include these “programs”. The functions of bash to replace the functions of DCL are so different in syntax and working, that the migration of DCL “programs” is a lot of work and some will simply fail to migrate as there might be no substitution for one or more DCL functions. An example - to read a file is shown below. | DCL has a powerful set of built-in commands and functions. These are so versatile that entire programs have been written in DCL functions. When you migrate a VMS system to Linux, you will have to include these “programs”. The functions of bash to replace the functions of DCL are so different in syntax and working, that the migration of DCL “programs” is a lot of work and some will simply fail to migrate as there might be no substitution for one or more DCL functions. An example - to read a file is shown below. | ||
- | In DCL every line must start with a “$”, or it will not see it as a command. | + | In DCL every line must start with a “$”, or it will not see it as a command.** |
- | In Linux, the first parameter on a command-line is denoted as 1, while the same parameter in VMS is denoted as P1. The translation of a variable in Linux is done by prefixing with a $; in VMS by enclosing in single quotes, hence $1 in Linux is 'P1' in VMS. “echo” writes | + | Une autre différence est l' |
- | “file_var” in the above example is also a logical. As a consequence, this means that, if the file is not closed, it will still be open if the same script (command file) is executed again in the same session. That might be intentional if two scripts have to be executed consecutively, | + | DCL a un jeu puissant de commandes et fonctions intégrées. Elle sont si variées que des programmes entiers ont été écrits avec des fonctions DCL. Quand vous migrez un système VMS vers Linux, vous devrez inclure ces « programmes ». La syntaxe et l'exécution des fonctions de bash qui remplaceraient les fonctions de DCL sont si différentes que la migration des « programmes » DCL représente beaucoup de travail et la migration de certains pourrait échouer puisqu' |
- | I cannot imagine how a migration tool would be able to create a working bash script from a DCL script (in VMS this is called a command-file, | + | Dans DCL, chaque ligne commence par un $ ; sinon, elle n'est pas vue comme une commande. |
+ | |||
+ | **In Linux, the first parameter on a command-line is denoted as 1, while the same parameter in VMS is denoted as P1. The translation of a variable in Linux is done by prefixing with a $; in VMS by enclosing in single quotes, hence $1 in Linux is ' | ||
+ | |||
+ | “file_var” in the above example is also a logical. As a consequence, | ||
+ | |||
+ | Dans Linux, le premier caractère d'une ligne de commande est noté 1, alors que le même paramètre dans VMS est noté P1. La translation d'une variable dans Linux est faite en préfixant avec un $ ; et dans VMS, en l' | ||
+ | |||
+ | « file_var », dans l' | ||
+ | |||
+ | **I cannot imagine how a migration tool would be able to create a working bash script from a DCL script (in VMS this is called a command-file, | ||
/VMS/show log -g “*” . | /VMS/show log -g “*” . | ||
Ligne 25: | Ligne 43: | ||
show log /group * . | show log /group * . | ||
- | This way, every existing DCL “program” will behave the same with only small adaptations. | + | This way, every existing DCL “program” will behave the same with only small adaptations.** |
- | ASTs | + | J'ai du mal à imaginer comment un outil de migration serait capable de créer un script bash fonctionnel à partir d'un script DCL (dans VMS, c'est appelé un fichier de commande, avec type de fichier par défaut .COM). Aussi, j'ai commencé à travailler sur la création d'un clone de DCL. Il sera capable d' |
- | In VMS, all communication with the terminal goes through the driver “TTDRV”. When the user gives a special command using control characters (mostly ^C, ^Y, ^T and ^Z), the driver will issue an AST (Asynchronous System Trap). Essentially, | + | /VMS/show log -g “*” . |
- | The best equivalent of these ASTs is the use of the method “Synchronize” of the class “tthread”. To get the same behavior as in VMS, the DCL process is used to process all input from the terminal and output to the terminal. The DCL process communicates through pipes with a separate thread created at program start using the class “tthread”. When the user presses any of the special control characters, this thread will call a dedicated procedure - defined in the class, but executed in the main thread - using “Synchronize”. On ^C, the process will terminate; on ^Y, the main thread will be suspended; on ^T, status information will be sent to the terminal (if specified in the main thread), and on ^Z, a controlled termination will take place. When the main thread is suspended after ^Y, two things can happen: | + | Mon programme DCL acceptera la commande standard sensible à la casse : |
+ | |||
+ | show log /group * . | ||
+ | |||
+ | De cette manière, chaque « programme » DCL existant se comportera de la même façon avec seulement de petites adaptations. | ||
+ | |||
+ | **ASTs | ||
+ | |||
+ | In VMS, all communication with the terminal goes through the driver “TTDRV”. When the user gives a special command using control characters (mostly ^C, ^Y, ^T and ^Z), the driver will issue an AST (Asynchronous System Trap). Essentially, | ||
+ | |||
+ | Les AST | ||
+ | |||
+ | Dans VMS, toutes les communications avec le terminal passent par le pilote « TTDRV ». Quand l' | ||
+ | |||
+ | **The best equivalent of these ASTs is the use of the method “Synchronize” of the class “tthread”. To get the same behavior as in VMS, the DCL process is used to process all input from the terminal and output to the terminal. The DCL process communicates through pipes with a separate thread created at program start using the class “tthread”. When the user presses any of the special control characters, this thread will call a dedicated procedure - defined in the class, but executed in the main thread - using “Synchronize”. On ^C, the process will terminate; on ^Y, the main thread will be suspended; on ^T, status information will be sent to the terminal (if specified in the main thread), and on ^Z, a controlled termination will take place. When the main thread is suspended after ^Y, two things can happen: | ||
• If “continue” is typed in the DCL process, the main thread will be resumed. | • If “continue” is typed in the DCL process, the main thread will be resumed. | ||
- | • If a new command is given, resulting in the start of another process, the suspended process will be terminated. | + | • If a new command is given, resulting in the start of another process, the suspended process will be terminated.** |
+ | |||
+ | Le meilleur équivalent de ces AST est l' | ||
+ | • Si « continue » est saisi dans le processus DCL, le fil principal reprendra. | ||
+ | • Si une nouvelle commande est donnée, démarrant un autre processus, le processus suspendu sera terminé. | ||
- | To get this behavior, DCL must be aware of the control characters and act upon them. | + | **To get this behavior, DCL must be aware of the control characters and act upon them. |
Something like the attribute “[VOLATILE]” is not necessary as I have not seen Free Pascal doing any optimization (unfortunately). | Something like the attribute “[VOLATILE]” is not necessary as I have not seen Free Pascal doing any optimization (unfortunately). | ||
- | On activation of a QIO(W) (see part 2) or timer, it is also possible to specify an AST to be called on termination. These are implemented the same way, as both work through the creation of a new thread. | + | On activation of a QIO(W) (see part 2) or timer, it is also possible to specify an AST to be called on termination. These are implemented the same way, as both work through the creation of a new thread.** |
- | Detached process: | + | Pour obtenir ce comportement, |
+ | |||
+ | Quelque chose comme l' | ||
+ | |||
+ | Sur l' | ||
+ | |||
+ | **Detached process: | ||
If you start a detached process (a process without a parent) in VMS, it is started without DCL as a shell. Some programs depend on the existence of DCL - if they call an internal function. To run such a program, you must create a command-file stating: “$run program_name”, | If you start a detached process (a process without a parent) in VMS, it is started without DCL as a shell. Some programs depend on the existence of DCL - if they call an internal function. To run such a program, you must create a command-file stating: “$run program_name”, | ||
Ligne 49: | Ligne 91: | ||
Next month | Next month | ||
- | In the next article I will go more in depth about the network database DBMS32 and its (dis)advantages. | + | In the next article I will go more in depth about the network database DBMS32 and its (dis)advantages.** |
+ | |||
+ | Processus détaché : | ||
+ | |||
+ | Si vous démarrez un processus détaché (un processus sans parent) dans VMS, il démarre sans DCL comme un shell. Certains programmes dépendent de l' | ||
+ | |||
+ | L' | ||
+ | |||
+ | Le mois prochain | ||
+ | |||
+ | Dans le prochain article, j' |
issue109/migrerdevax.1464537482.txt.gz · Dernière modification : 2016/05/29 17:58 de auntiee