jc/md/lp-01/05tty_it : corrigé1 tty_it corrigé. jc/md/lp-01/05tty_it : corrigé2 objectif du...
TRANSCRIPT
![Page 1: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/1.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 1
TTY_IT
Corrigé
![Page 2: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/2.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 2
Objectif du chapitre
• Proposer une solution pour les exercices suggérés dans le chapitre IT_CE4.2_présentation
• Écrire un programme qui va communiquer avec une liaison série
• La transmission se fera en polling• La réception sera gérée par interruption• On utilisera la deuxième liaison série connectée
sur l’IRQ3
![Page 3: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/3.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 3
Rappel : principe des interruptions
• Deux composants logiciels pour gérer les interruptions– ISR : Interrupt Service Routine
Code très court qui fait le traitement le plus court possible
retourne un numéro logique d’IT– IST : Interrupt Service Thread
Traite l’interruption
![Page 4: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/4.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 4
Rappel : déroulement du traitement
• Une IT physique se produit• Le gestionnaire d’exception lance l’ISR associé
à cette interruption• L’ISR retourne le numéro logique au noyau• Le noyau arme un événement pour déclencher
l’IST associé• L’IST est déclenchée• La commande IOCTL est exécutée
![Page 5: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/5.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 5
Rappel : IST
• Thread en mode user de forte priorité• En attente d’un événement associé à l’IT logique• Réveillé lorsque le Kernel signale l’événement• Traite l’interruption• Acquitte l’interruption
![Page 6: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/6.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 6
Synchronisation IST/DRIVER
• L’ IST va faire l’acquisition du caractère reçu et le stockera dans un buffer ucBufIn
• Pour signaler au driver qu’un caractère a été acquis, nous utiliserons un autre EVENT géré par un handle nommé hMonEvent
• L’IST positionne cet EVENT• Le driver fait le traitement demandé puis
acquitte l’EVENT
![Page 7: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/7.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 7
Gestion du port série en IT
• On utilise le port 2• IT physique 0x3 (IRQ 3)• IT logique (dwSYSINTR_A_Moi)• Adresse du port 0x2F8
![Page 8: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/8.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 8
IOCTL
• On va définir deux IOCTL internes au driver– IOCTL_PUTC envoi de caractère en polling– IOCTL_GETC réception de caractère sous IT
• On va définir un IOCTL pour la communication driver→ISR (envoi du numéro logique de l’IT)– IOCTL_VAL_SYSINTR
![Page 9: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/9.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 9
plate-forme de travail
• Générer une nouvelle plate-forme standard• Nom : z_CEPC_TTY_IT• Retirer de la configuration de base la gestion
des ports série présente par défaut pour éviter des conflits
![Page 10: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/10.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 10
Retirer le port série (1)
• Onglet Features• Dérouler l’arborescence
→Z_CEPC_TTY_IT features
→CEPC: x86
→Devices Drivers
→Serial
• Cliquer à droite pour ouvrir le menu• Cliquer Delete
![Page 11: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/11.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 11
Retirer le port série (2)
Dérouler jusqu’à Serial puis clic droit
Cliquer
![Page 12: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/12.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 12
Configuration obtenue
![Page 13: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/13.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 13
DRIVER
![Page 14: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/14.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 14
Création du driverDans File : Choisir New Project or File
NommerChoisir
Valider
![Page 15: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/15.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 15
Choix du projet
Valider
Choisir
![Page 16: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/16.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 16
Fichier source obtenu
![Page 17: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/17.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 17
Création du fichier .def (1)
• Nous devons créerTTYIT_DRV.def
• Puis l’ajouter au projet• On peut
– Créer directement dans le projet un nouveau fichier de type Text File
– Ajouter un fichier créé à l’avance dans un répertoire
![Page 18: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/18.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 18
Création directe du fichier .def (1)
Onglet Files
Nommer
Cocher
Valider
Choisir
![Page 19: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/19.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 19
TTYIT_DRV.def
LIBRARY TTYIT_DRV
EXPORTS
TTY_Init
TTY_Deinit
TTY_Open
TTY_Close
TTY_IOControl
![Page 20: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/20.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 20
Insertion de TTYIT_DRV.def (1)
• Créer le fichier• Enregistrer ce fichier dans le répertoire
…\WINCE420\PUBLIC\z_CEPC_TTY_IT\TTYIT_DRV
• Ajouter ce fichier au projet– Cliquer à droite sur le répertoire Source Files– Dans le menu choisir Add Files to Folder…– Dans la fenêtre ouverte, choisir le fichier à insérer– Valider
![Page 21: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/21.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 21
Insertion de TTYIT_DRV.def (2)
![Page 22: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/22.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 22
Insertion de TTYIT_DRV.def (3)
![Page 23: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/23.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 23
Structure du driver
![Page 24: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/24.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 24
Entête du driver (1)
// #include nécessaires
#include "stdafx.h"
#include <nkintr.h>
#include <wdm.h>
#include <Pkfuncs.h>
![Page 25: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/25.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 25
Entête du driver (2)
// Définitions et réservations
// Définition des bits de status du sérialiseur
#define LS_TSR_EMPTY 0x40
#define LS_THR_EMPTY 0x20
#define LS_RX_BREAK 0x10
#define LS_RX_FRAMING_ERR 0x08
#define LS_RX_PARITY_ERR 0x04
#define LS_RX_OVERRRUN 0x02
#define LS_RX_DATA_READY 0x01
![Page 26: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/26.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 26
Entête du driver (3)
// Définition des offsets des registres du sérialiseur
#define comRxBuffer 0
#define comTxBuffer 0
#define comDivisorLow 0
#define comDivisorHigh 1
#define comIntEnable 1
#define comFIFOControl 2
#define comLineControl 3
#define comModemControl 4
#define comLineStatus 5
![Page 27: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/27.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 27
Entête du driver (4)
// Définition des IOCTL
#define IOCTL_PUTC \
CTL_CODE(FILE_DEVICE_UNKNOWN,2048,\
METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_GETC \
CTL_CODE(FILE_DEVICE_UNKNOWN,2049,\
METHOD_BUFFERED,FILE_ANY_ACCESS)
#define IOCTL_VAL_SYSINTR \
CTL_CODE(FILE_DEVICE_UNKNOWN,2050,\
METHOD_BUFFERED,FILE_ANY_ACCESS)
![Page 28: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/28.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 28
Entête du driver (5)
// Adresse de base du sérialiseur#define IoPortBase ((PUCHAR) 0x02F8)// Interruptions#define ItPhysique 0x3// Définition de la structure à passer à l’ISTtypedef struct _ISTDATA
{ HANDLE hThread; // IST Handle DWORD sysIntr; // Logical ID HANDLE hEvent; // Handle to the EVENT volatile BOOL bAbort; // Flag de fin
}ISTDATA;
![Page 29: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/29.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 29
Entête du driver (6)
// Prototype de l'IST
DWORD TTYIST(void *);
DWORD dwSYSINTR_A_Moi;
// Réservations diverses
UCHAR ucBufIn;
HANDLE hMonEvent;
ISTDATA TTY_ISTData;
![Page 30: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/30.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 30
Entrée du driver
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;
}// Fin DllMain
![Page 31: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/31.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 31
TTY_Init (1)
DWORD TTY_Init(DWORD dwContext){
// Déclarations diverses DWORD Buf_In[1];
DWORD Buf_Out[1];DWORD dwNbBytes;HANDLE hChain,hIstEvent;DWORD dwErrCode;
RETAILMSG(1,(TEXT("TTY: TTY_Init\n")));
![Page 32: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/32.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 32
TTY_INIT (2)
// Initialisation des registres du sérialiseur 16550 // pas d'IT sur Receiver Ready (sera fait dans Open)
// 9600 bauds, 8 bits, pas de parité, DTR, RTS// pas de FIFO
WRITE_PORT_UCHAR(IoPortBase+comLineControl, 0x80);
WRITE_PORT_UCHAR(IoPortBase+comDivisorLow, 0x0C);
WRITE_PORT_UCHAR(IoPortBase+comDivisorHigh, 0x00);
![Page 33: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/33.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 33
TTY_Init (3)
WRITE_PORT_UCHAR(IoPortBase+comLineControl, 0x03);
WRITE_PORT_UCHAR(IoPortBase+comFIFOControl, 0x00);
WRITE_PORT_UCHAR(IoPortBase+comIntEnable,
0x00);
// Mettre OUT2 du 16550 à 1 pour autoriser les IT// globalement
// (pas indiqué dans la documentation du 16550 !)
![Page 34: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/34.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 34
TTY_Init (4)
WRITE_PORT_UCHAR(IoPortBase+ comModemControl, 0x0B);
// Récupération d'un numéro d’IT logiqueBuf_In[0]=3;KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, Buf_In,4,Buf_Out,4,NULL);dwSYSINTR_A_Moi=Buf_Out[0];RETAILMSG(1,(TEXT("dwSYSINTR_A_Moi: %d\n"), dwSYSINTR_A_Moi));// Chaînage de l'ISRhChain=LoadIntChainHandler(_T("TTYISR.dll"), _T("ISRHandler"),ItPhysique);
![Page 35: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/35.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 35
TTY_Init (5)
if(hChain==0)
{
RETAILMSG(1,(TEXT("TTY: erreur %d dans LoadIntChainHandler\n"),GetLastError()));
return FALSE;
}
![Page 36: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/36.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 36
TTY_Init (6)
// Passage du numéro IT Logique à l'ISR
Buf_In[0]=dwSYSINTR_A_Moi;
dwErrCode=KernelLibIoControl(hChain,IOCTL_VAL_ SYSINTR,Buf_In,4,NULL,NULL,&dwNbBytes);
if(dwErrCode==FALSE)
{
RETAILMSG(1,(TEXT("TTY: erreur %d dans KernelLibIoControl\n"),GetLastError()));
return FALSE;
}
![Page 37: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/37.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 37
TTY_Init (7)
// Création de l’événement de lien pour l’ISThIstEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
if(hIstEvent==0)
{
RETAILMSG(1,(TEXT("TTY: erreur %d dans CreateEvent (hIstEvent)\n"),GetLastError()));
return FALSE;
}
![Page 38: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/38.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 38
TTY_Init (8)
// Création de l’événement de synchro IST/driver
// Handle déclaré en variable globale : hMonEvent
hMonEvent=CreateEvent(NULL,TRUE,FALSE,NULL);
if(hMonEvent == 0)
{
RETAILMSG(1,(TEXT("TTY: erreur %d dans CreateEvent (hMonEvent)\n"),GetLastError()));
return 0;
}
![Page 39: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/39.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 39
TTY_Init (9)
// Initialisation de la structure
TTY_ISTData.hEvent=hIstEvent;
TTY_ISTData.sysIntr=dwSYSINTR_A_Moi;
TTY_ISTData.bAbort=FALSE;
// Inhibition (Disable) de l’interruption logique
InterruptDisable(TTY_ISTData.sysIntr);
![Page 40: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/40.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 40
TTY_Init (10)
// Création et démarrage du thread IST
TTY_ISTData.hThread=CreateThread(NULL,0, &TTYIST,&TTY_ISTData,0,NULL);
if(TTY_ISTData.hThread ==0)
{
RETAILMSG(1,(TEXT("TTY: erreur % d dans CreateThread (TTY_ISTData)\n"),GetLastError()));
return 0;
}
![Page 41: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/41.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 41
TTY_Init (11)
// Connexion de l’IT logique avec l’événementdwErrCode=InterruptInitialize(dwSYSINTR_A_Moi, TTY_ISTData.hEvent,NULL,0);
if(dwErrCode==FALSE){
RETAILMSG(1,(TEXT("TTY: erreur %d dans InterruptInitialize\n"),GetLastError()));
return 0;}
![Page 42: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/42.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 42
TTY_Init (12)
// Mise en priorité maximale du thread
dwErrCode=CeSetThreadPriority(TTY_ISTData.hThread ,0);
if(dwErrCode==FALSE)
{
RETAILMSG(1,(TEXT("TTY: erreur %d dans CeSetThreadPriority\n"),GetLastError()));
return 0;
}
![Page 43: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/43.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 43
TTY_Init (13)
RETAILMSG(1,(TEXT("TTY: OK IT Init\n")));
return !0;
}// Fin TTY_Init
![Page 44: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/44.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 44
TTY_Deinit (1)
BOOL TTY_Deinit(DWORD hDeviceContext){
RETAILMSG(1,(TEXT("TTY: TTY_Deinit\n")));// Mise du flag bAbort à TRUE pour arrêter l'ISTTTY_ISTData.bAbort=TRUE;
// Inhibition (Disable) de l’IT logique : InterruptDisableInterruptDisable(TTY_ISTData.sysIntr);
![Page 45: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/45.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 45
TTY_Deinit (2)
// Fermeture des handles
CloseHandle(TTY_ISTData.hEvent);
CloseHandle(TTY_ISTData.hThread);
CloseHandle(hMonEvent);
return TRUE;
}// Fin TTY_Deinit
![Page 46: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/46.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 46
TTY_Open (1)
DWORD TTY_Open(DWORD hDeviceContext,
DWORD AccessCode, DWORD ShareMode)
{
RETAILMSG(1,(TEXT("TTY: TTY_Open\n")));
// Initialisations complémentaires du périphérique
// Vidage du buffer de réception si nécessaire
while((READ_PORT_UCHAR(IoPortBase+ comLineStatus)&LS_RX_DATA_READY)==1)
READ_PORT_UCHAR(IoPortBase+comRxBuffer);
![Page 47: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/47.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 47
TTY_Open (2)
// Autoriser l'IT Receiver Ready
WRITE_PORT_UCHAR(IoPortBase+comIntEnable,
0x01);
return !0;
}// Fin TTY_Open
![Page 48: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/48.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 48
TTY_Close
BOOL TTY_Close(DWORD hOpenContext)
{
RETAILMSG(1,(TEXT("TTY: TTY_Close\n")));
// Inhibition de l'IT Receiver Ready
WRITE_PORT_UCHAR(IoPortBase+comIntEnable,
0x0);
return TRUE;
}// Fin TTY_Close
![Page 49: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/49.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 49
TTY_IOControl (1)
BOOL TTY_IOControl(DWORD hOpenContext,
DWORD dwCode,
PBYTE pBufIn,
DWORD dwLenIn,
PBYTE pBufOut,
DWORD dwLenOut,
PDWORD pdwActualOut)
{
switch(dwCode)
{
![Page 50: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/50.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 50
TTY_IOControl (2)
case IOCTL_PUTC:
// Attente transmetteur Ready
while(!(READ_PORT_UCHAR(IoPortBase+
comLineStatus)& LS_THR_EMPTY))
;
// Envoi du caractère
WRITE_PORT_UCHAR(IoPortBase+ comTxBuffer,pBufIn[0]);
break;
![Page 51: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/51.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 51
TTY_IOControl (3)
case IOCTL_GETC:
// Attente de l’Event hMonEvent
WaitForSingleObject(hMonEvent,INFINITE); // Écriture du caractère dans le buffer
// de sortie. Le caractère lu sur IT est dans// ucBufIn, variable globale
pBufOut[0]=ucBufIn;
// Reset de l’EVENT hMonEvent
ResetEvent(hMonEvent);
break;
![Page 52: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/52.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 52
TTY_IOControl (4)
}// Fin switch
// Informe l’application qu’un caractère a été lu
*pdwActualOut=1;
return TRUE;
}// Fin TTY_IOControl
![Page 53: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/53.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 53
IST
![Page 54: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/54.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 54
IST (1)
DWORD TTYIST(void *p){
ISTDATA *pData; pData=(ISTDATA*)p;
// Boucle tant que bAbort = FALSEwhile(!pData->bAbort)
{ // Attente de l’événement associé à l’IT WaitForSingleObject(pData->hEvent,INFINITE);
if(pData->bAbort) break;
RETAILMSG(1,(TEXT("MIRACLE IT\n")));
![Page 55: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/55.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 55
IST (2)
// Traitement de l'interruption
// Lecture du caractère reçu; on le met dans ucBufIn
ucBufIn=READ_PORT_UCHAR(IoPortBase+ comRxBuffer);
// Positionner hMonEvent pour prévenir le driver
SetEvent(hMonEvent);
// Informer l’OS que l’IT est traitée : InterruptDone
InterruptDone(pData->sysIntr);
}// Fin boucle
![Page 56: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/56.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 56
IST (3)
RETAILMSG(1,(TEXT("Fin TTYIST\n")));
return 0;
}// Fin TTYIST
![Page 57: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/57.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 57
Structure de l’ISR
![Page 58: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/58.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 58
Création du projet ISR (1)
NommerValider
Choisir
Choisir
![Page 59: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/59.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 59
Création du projet ISR (2)
ChoisirValider
![Page 60: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/60.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 60
TTYISR.cpp
![Page 61: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/61.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 61
Création de TTYISR.def
• Mettre le fichier TTYISR.def dans le projet par l’une des méthodes déjà rencontrées
– Création d’un nouveau fichier de type texte sous Platform Builder (directement inséré dans le projet)
– Création du fichier sous un éditeur de texte dans le répertoire TTYISR puis addition au projet
![Page 62: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/62.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 62
TTYISR.def
LIBRARY TTYISR
EXPORTS
ISRHandler
IOControl
![Page 63: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/63.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 63
ISR (1)
#include " stdafx.h "
#include <nkintr.h>
#include <wdm.h>
#include <Pkfuncs.h>
// Définition de l’IOCTL de communication driver/ISR
#define IOCTL_val_SYSINTR \
CTL_CODE(FILE_DEVICE_UNKNOWN,2050,\
METHOD_BUFFERED,FILE_ANY_ACCESS)
![Page 64: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/64.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 64
ISR (2)
DWORD dwSYSINTR_A_Moi;
// Entrée de l'ISRBOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved){ return TRUE;}// Fin DllMain
![Page 65: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/65.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 65
ISR (3)
BOOL IOControl(
DWORD InstanceIndex,
DWORD IoControlCode,
LPDWORD pInBuf,
DWORD InBufSize,
LPDWORD pOutBuf,
DWORD OutBufSize,
LPDWORD pBytesReturned)
{
switch(IoControlCode)
![Page 66: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/66.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 66
ISR (4)
{case IOCTL_VAL_SYSINTR:
// Récupération de la valeur de // dwSYSINTR_A_Moi
dwSYSINTR_A_Moi=pInBuf[0];break;
}// Fin switch // Informe l’application qu’un caractère a été lu *pBytesReturned = 1; return TRUE;}// Fin IOControl
![Page 67: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/67.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 67
ISR (5)DWORD ISRHandler(DWORD InstanceIndex){//Test que IT bien active,status en 0x2F8 +5, RxRdy bit 0 __asm {
mov dx,02FDhin al,dxand al,01h
jnz it_a_moi}
//it_pas_a_moi: return SYSINTR_CHAIN;
it_a_moi:return dwSYSINTR_A_Moi;
}
![Page 68: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/68.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 68
Application
![Page 69: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/69.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 69
Applicaton
• Application qui utilise le driver TTYIT_DRV• Le programme est très simple, il doit :
– Écrire un $ avec IOCTL_ PUTC– Attendre la réception d’un caractère avec
IOCTL_GETC – Envoyer l’écho avec IOCTL_PUTC– Boucler jusqu’à la réception du caractère ESCAPE
(0x1B)– Se terminer après la réception de ESCAPE
![Page 70: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/70.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 70
Création de l’application (1)
Choisir New Project or File
Choisir
Nommer
Valider
![Page 71: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/71.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 71
Création de l’application (2)
Valider
Choisir
![Page 72: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/72.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 72
TTYIT_APP.cpp
![Page 73: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/73.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 73
Application (1)
// #include nécessaires#include "stdafx.h"#include <windev.h>
// Définition des IOCTL#define IOCTL_PUTC \ CTL_CODE(FILE_DEVICE_UNKNOWN,2048,\ METHOD_BUFFERED,FILE_ANY_ACCESS)#define IOCTL_GETC \ CTL_CODE(FILE_DEVICE_UNKNOWN,2049,\ METHOD_BUFFERED,FILE_ANY_ACCESS)
![Page 74: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/74.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 74
Application (2)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow){
// Initialisations et réservations HANDLE hDevice,hTTY;
UCHAR carac[4];DWORD dwNb;
![Page 75: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/75.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 75
Application (3)
// Chargement du driver qui retourne un handle hDevicehDevice=RegisterDevice(TEXT("TTY"),1, TEXT("TTYIT_DRV.dll"),NULL);if(hDevice==INVALID_HANDLE_VALUE)
{ MessageBox(NULL,_T("PB Register TTY1:"),
_T("TTYApp"),MB_OK); return 0; }
MessageBox(NULL,_T("Register TTY1 OK:"), _T("TTYApp"),MB_OK);
![Page 76: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/76.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 76
Application (4)
// Ouverture du driver avec retour du HANDLE hTTYhTTY=CreateFile(TEXT("TTY1:"),GENERIC_READ| GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,0);
if(hTTY==INVALID_HANDLE_VALUE) {
MessageBox(NULL,_T("Pb Open TTY1:"), _T("TTYApp"),MB_OK); DeregisterDevice(hDevice); CloseHandle(hDevice);
return 0; }
![Page 77: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/77.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 77
Application (5)
// Envoi d'un caractère $
carac[0]=0x24;
// Appel de IOCTL_PUTC
DeviceIoControl(hTTY,IOCTL_PUTC,carac,1, carac,1,&dwNb,NULL);
![Page 78: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/78.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 78
Application (6)
// Boucle tant que le caractère n'est pas Escape
while(carac[0] != 0x1B)
{
// Appel de IOCTL_GETC
DeviceIoControl(hTTY,IOCTL_GETC,carac,1, carac,1,&dwNb,NULL);
// Appel de IOCTL_PUTC
DeviceIoControl(hTTY,IOCTL_PUTC,carac,1, carac,1,&dwNb,NULL);
}// Fin boucle
![Page 79: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/79.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 79
Application (7)
MessageBox(NULL,_T("OK pour finir"), _T("TTYApp"),MB_OK);
// Déchargement du driver
// Fermeture des handles
CloseHandle(hTTY);
DeregisterDevice(hDevice);
CloseHandle(hDevice);
return 0;
}// WinMain
![Page 80: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/80.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 80
Configuration pour l’application
ChoisirChoisir
Valider
Choisir Settings…
![Page 81: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/81.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 81
Configuration pour l’ISR
ChoisirChoisir
Valider
Choisir Settings…
Vérifier
![Page 82: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/82.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 82
Configuration pour le driver
ChoisirChoisir
Valider
Choisir Settings…
![Page 83: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/83.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 83
Option pour la génération
• L’ISR doit être généré sans les « C Run Times »• Il faut modifier les options pour l’édition de lien
pendant la génération
![Page 84: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/84.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 84
Configuration de l’édition de liens
Choisir puis click droit
Choisir
![Page 85: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/85.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 85
Options de l’édition de liens
Modifier
Choisir
Valider
![Page 86: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/86.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 86
Project Options pour l’ISR
coredll.libcoredll.lib/nologo/nologo/base:"0x00100000" /base:"0x00100000" /stack:0x10000,0x1000/stack:0x10000,0x1000/entry:"DllMain"/entry:"DllMain"/dll/dll/incremental:no/incremental:no/pdb:"CEPC__X86Rel/TTYISR.pdb"/pdb:"CEPC__X86Rel/TTYISR.pdb"/machine:IX86 /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:"$/machine:IX86 /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:"$(CENoDefaultLib)" (CENoDefaultLib)" /def:".\TTYISR.def" /def:".\TTYISR.def" /out:"CEPC__X86Rel/TTYISR.dll" /out:"CEPC__X86Rel/TTYISR.dll" /implib:"CEPC__X86Rel/TTYISR.lib" /implib:"CEPC__X86Rel/TTYISR.lib" /subsystem:$(CESubsystem)/subsystem:$(CESubsystem)
![Page 87: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/87.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 87
Insertion dans le noyau
• Contrairement aux exécutables et aux drivers, l’ISR ne s’exécute pas en mode user mais en mode superviseur
• Il faut empêcher le système d’opérer des translations d’adresse sur les zones de code et de données des ISR
• Pour obtenir ce résultat il faut préciser que l’ISR doit être dans une section « FILES » au lieu d’une section « MODULES » dans les listes du fichier project.bib
![Page 88: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/88.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 88
Insertion de l’ISR dans project.bib
Choisir
Dérouler
Ouvrir (double clic)
Vérifier (clic droit)
![Page 89: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/89.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 89
Ajouter TTYISR.dll
Bloc mémoire Options
Répertoire Nom du fichier
![Page 90: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/90.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 90
Génération
• Il n’y a plus qu’à faire la génération du système avec son driver pour la ligne série et l’application
• Puis tester :– Télécharger dans la cible le noyau et son driver– Exécuter l’application– Observer l’affichage du caractère $– Observer l’écho des frappes sur le clavier– Sortir de l’application par la frappe du caractère
escape
![Page 91: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/91.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 91
Debug
![Page 92: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/92.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 92
Debug
• Mettre le mode Debug et modifier les options – Platform
→Settings
→Build Options
Cocher Enable Event Tracking During Boot Enable Full Kernel Mode Enable Kernel Debugger Enable Profiling
• Vérifier toutes les options
– Platform Settings (Build avec ou sans image)– Project Settings (Link…)
![Page 93: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/93.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 93
Options de débogage
Mode Debug
Choisir
Cocher les options
Valider
Ouvrir
Choisir
![Page 94: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/94.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 94
Configuration pour l’ISR
Choisir Choisir
Valider
Choisir Settings…
Choisir
![Page 95: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/95.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 95
Configuration pour l’application
ChoisirChoisir
Valider
Choisir Settings…
![Page 96: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/96.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 96
Configuration pour le driver
Choisir
Choisir
Valider
Choisir Settings…
![Page 97: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/97.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 97
Configuration de l’édition de liens
Choisir puis click droit
Choisir
![Page 98: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/98.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 98
Options pour l’édition de liens
Choisir
Choisir
Valider
Choisir
Modifier
![Page 99: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/99.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 99
Project Options pour l’ISR
coredll.libcoredll.lib/nologo/nologo/base:"0x00100000" /base:"0x00100000" /stack:0x10000,0x1000/stack:0x10000,0x1000/entry:"DllMain"/entry:"DllMain"/dll/dll/incremental:no/incremental:no/pdb:"CEPC__X86/pdb:"CEPC__X86DbgDbg/TTYISR.pdb« /TTYISR.pdb«
/debug/debug/machine:IX86 /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:"$/machine:IX86 /nodefaultlib:"OLDNAMES.lib" /nodefaultlib:"$(CENoDefaultLib)" (CENoDefaultLib)" /def:".\TTYISR.def" /def:".\TTYISR.def" /out:"CEPC__X86/out:"CEPC__X86DbgDbg/TTYISR.dll" /TTYISR.dll" /implib:"CEPC__X86/implib:"CEPC__X86DbgDbg/TTYISR.lib" /TTYISR.lib" /subsystem:$(CESubsystem)/subsystem:$(CESubsystem)
![Page 100: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/100.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 100
Kernel Debugger
• Utiliser le Kernel Debugger pour visualiser les interruptions
• Vérifier les numéros de process et de threads• Examiner la chronologie des threads application,
driver, ISR et IST• Mesurer les temps d’exécution
![Page 101: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/101.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 101
Exécution de l’application
Repérer les paramètres
![Page 102: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/102.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 102
Paramètres
• PID TTYIT_APP 43a084fa• TID TTYIT_APP 43a084ca• PID TTYIT_DRV e3ba39e2• TID TTYIT_DRV 43a084ca• dwSYSINTR_A_Moi 16
![Page 103: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/103.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 103
Lancement du Kernel Tracker
Choisir
![Page 104: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/104.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 104
État avant d’entrer un caractère
![Page 105: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/105.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 105
Après frappe sur le clavier (IT)
![Page 106: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/106.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 106
Quand l’IST fonctionne
Repérer les paramètres
![Page 107: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/107.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 107
Paramètres IST
• PID IST eba39e2 • TID IST 839e5f02
![Page 108: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/108.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 108
Recherche de l’IT 16
• Arrêter le défilement avec icône |→• Déplacer le curseur pour trouver une IT 16
active• Adapter la « Zoom Range »
![Page 109: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/109.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 109
IT 16
![Page 110: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/110.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 110
IST : set hMonEvent
Thread IST
![Page 111: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/111.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 111
IST : attente de hMonEvent
![Page 112: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/112.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 112
Application et driverreset de hMonEvent
![Page 113: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/113.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 113
Application et driverattente de hMonEvent
![Page 114: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/114.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 114
Arrivée de l’IT
![Page 115: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/115.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 115
Mesure des temps
• IT → IST : 0,2 ms• Durée IST : 3,2 ms• Durée application : 1,3 ms
![Page 116: Jc/md/lp-01/05TTY_IT : corrigé1 TTY_IT Corrigé. jc/md/lp-01/05TTY_IT : corrigé2 Objectif du chapitre Proposer une solution pour les exercices suggérés](https://reader035.vdocuments.pub/reader035/viewer/2022062621/551d9d8e497959293b8c4016/html5/thumbnails/116.jpg)
jc/md/lp-01/05 TTY_IT : corrigé 116
Conclusion
Nous avons :• Réalisé un ensemble driver/ISR/IST pour gérer
une interruption provenant du sérialiseur• Réalisé une application recevant un caractère
du sérialiseur avec une gestion par IT• Examiné avec le Kernel Debugger les différents
threads et leur chronologie