[AIX 진단 서브시스템 19] 코드 예 — 테스트 단위와 진단 응용 프로그램
https://archive.horanglab.com/posts/aix-diag-code
핵심 정리
- 코드 예는 개념과 라이브러리 루틴을 이해하려고 읽는 참고용이며, 그대로는 깨끗하게 컴파일되지 않습니다.
- 테스트 단위(TU) 쪽: 장치별 오류 상세 출력 헤더(
{DEVICE}_ERR_DETAIL.H), 입력 매개변수 헤더({DEVICE}_INPUT_PARAMS.H), 지역 헤더,exectu()진입점,pdiag_open/pdiag_close를 쓰는 장치 열기·닫기, Makefile. - 인터럽트 처리기 쪽: SLIH C 소스와, 32·64비트 SLIH를 함께 만드는 Makefile.
- 진단 응용 프로그램(DA) 쪽:
getdainput,diag_asl_*/diag_display, TU 호출,addfrub,DA_SETRC_*·DA_EXIT를 쓰는 DA 본문과, 메뉴·FRU 텍스트가 든 메시지 파일(.msg).
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같음) |
| 원문 | Understanding the Diagnostic Subsystem for AIX — 5.3판 7장(231257쪽), 6.1판 216240쪽 |
| 주의 | 원문이 밝힌 대로 개념 설명용이며 그대로는 깨끗이 컴파일되지 않습니다. |
이 절에는 응용 프로그램 테스트 단위(TU)와 진단 응용 프로그램(DA) 코드를 위한 여러 C 프로그래밍 예가 들어 있습니다.
이 예들은 개념과 라이브러리 루틴을 이해하려고 검토하는 용도이며 그대로는 깨끗하게 컴파일되지 않습니다. 참고용으로만 실었습니다.
영어 원문
Code examples
This section contains various sample C programming code for both the Application Test Unit and Diagnostic Application code.
These examples are meant for review to understand the concepts and library routines used and cannot not be compiled clean. They are included here as reference only.
테스트 단위가 호출 응용 프로그램에 돌려주는 장치별 오류 상세 정보를 정의하는 헤더 파일의 예입니다.
/*
* COMPONENT_NAME: TU_DEVICE
*
* FUNCTIONS: SAMPLE Header file for TU Error Detail (OUTPUT)
*
*/
#ifndef _h_device_err_detail
#define _h_device_err_detail
/*
* ERROR_DETAILS structure and related definitions follow.
*
* These structures are used to provide detailed error information
* for some of the errors that are detected by the test units.
* Whether the detailed error is available for a particular TU and error
* code is documented in the TU Component Interface Specification, and
* the actual source files where that error code is defined.
*/
/********************************************************/
/* The following structures are examples. Modify */
/* as needed. */
/********************************************************/
typedef struct {
unsigned long int error_code;
unsigned long int crc_expected;
unsigned long int crc_actual;
} CRC_ERROR_DETAILS;
typedef struct {
unsigned long int error_code;
unsigned long int miscompare_address;
unsigned long int expected_data;
unsigned long int actual_data;
} DMA_ERROR_DETAILS;
typedef union {
unsigned long int error_code;
CRC_ERROR_DETAILS crc_test;
DMA_ERROR_DETAILS dma_test;
} ERROR_DETAILS;
/* The following is required by <diag/tucb.h> file */
#define OUTPUT_DATA ERROR_DETAILS
#endif
영어 원문
Example _ERR_DETAIL.H: TU specific outputs
(40줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
호출 응용 프로그램이 테스트 단위에 넘기는 장치별 입력 매개변수를 정의하는 헤더 파일의 예입니다.
/*
* COMPONENT_NAME: TU_DEVICE
*
* FUNCTIONS: SAMPLE TU Input Parameters Header File
*
*/
#ifndef _h_device_input_params
#define _h_device_input_params
/*
* INPUT_DATA structure and related definitions follow.
*
* These structures are used to provide detailed input data information
* for some of the test units. This data is only used in manufacturing
* or other special case test areas.
*/
/********************************************************/
/* The following structures are examples. Modify */
/* as needed. */
/********************************************************/
typedef struct {
unsigned long int mfg_mode;
} TU_SPECIFIC_INPUT;
/* The following is required by the <diag/tucb.h> header */
#define INPUT_DATA TU_SPECIFIC_INPUT
#endif
영어 원문
Example _INPUT_PARAMS.H: TU specific inputs
(25줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU 지역 헤더 파일 예
테스트 단위 안에서만 쓰는 지역 헤더 파일의 예입니다.
/*
* COMPONENT_NAME: TU_DEVICE
*
* FUNCTIONS: TU Header file
*/
#ifndef _h_tu
#define _h_tu
#include <diag/tucb.h>
#include <sys/pdiagex_dds.h>
#define TU_SUCCESS 0
#define TU_DEVICE_BUSY 1
#define TU_CHILD_BUSY 2
#define TU_SOFTWARE_ERROR 3
#define TU_INVALID_PARAM 4
#define TU_INCORRECT_STATE 5
#define TU_OPEN 0x01
etc, etc
#define TU_CLOSE 0xEFFF
typedef struct {
int adapter_diagnose_state;
pdiagex_dds_t dds;
pdiag_info_handle_t pdiagex_handle;
} TU_GLOBAL_DATA;
#endif
영어 원문
Example TU local leader file
(24줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU exectu 함수 예
테스트 단위의 진입점 exectu() 함수의 예입니다.
/*
* COMPONENT_NAME: (TU_DEVICE) Device Adapter Test Units
*
* FUNCTIONS: exectu
*/
/* FILE NAME: device_exectu.c */
/* FUNCTION: Device Adapter Application Test Units. */
/* */
/* This source file contains source code for the Device adapter’s */
/* Application Test Units to aid in various testing environments */
/* of the device adapter. These test units provide a basic inter- */
/* face between the diagnostic application program and functions */
/* written in the diagnostic extension (pdiagex) which provide direct */
/* access to the device without the need for a device driver. */
/* */
/* */
/* EXTERNAL PROCEDURES CALLED: */
/* */
/* INCLUDED FILES */
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include "device_input_params.h"
#include "device_err_detail.h"
#include "tu.h"
#include <diag/tucb.h>
/*- global variables -*/
TU_GLOBAL_DATA *tu_data;
/*- extern functions -*/
extern void Do_INIT_TUS(TU_TYPE *, TU_GLOBAL_DATA *, TU_RETURN_TYPE *tu_rc);
extern void Do_TERM_TUS(TU_TYPE *, TU_GLOBAL_DATA *, TU_RETURN_TYPE *tu_rc);
/*
* NAME: exectu
*
* FUNCTION: Execute a specific Resource Test Unit.
*
* EXECUTION ENVIRONMENT:
* This routine is called as a subroutine of a diagnostic application.
*
* NOTES: This routine is used as the interface between an application
* and the test units for a Resource.
*
*/
ulong
exectu(TU_TYPE *dev_tucb, TU_INFO_HANDLE *tu_handle, TU_RETURN_TYPE *tu_rc)
{
int loopcount;
int mfg_flag=0;
/* Set the tu_handle pointing to the global tu structure data */
/* if the first time in. Also initialize elements. */
if ( *tu_handle == (TU_INFO_HANDLE *)NULL ) {
tu_data = (TU_GLOBAL_DATA *)calloc(1,sizeof(TU_GLOBAL_DATA));
*tu_handle = (TU_INFO_HANDLE *)tu_data;
}
/* number of times to repeat a command */
loopcount = dev_tucb->parms.loop;
/*---------------------------------------*/
/* assure adapter is proper state */
/* before attempting test unit */
/*---------------------------------------*/
if ((dev_tucb->parms.tu != 1) && /* for tus other than init tu */
(tu.adapter_diagnose_state != 1)){ /* test for NOT Diag state */
tu_rc->major_rc = TU_INCORRECT_STATE;
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file, "TU is not 1, and
not in correct state. status = %d\n", tu_rc->major_rc);
return(tu_rc->major_rc); /* must be in diagnose state */
}
else if ((dev_tucb->parms.tu == 1) && /*- for tu 1 only -*/
/*- test for Diagnose state -*/
(tu.adapter_diagnose_state == 1)) {
tu_rc->major_rc = TU_SUCCESS;
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file, "TU is 1, and is in
correct state. status = %d\n", tu_rc->major_rc);
return(tu_rc->major_rc); /*- already in diagnose state -*/
}
switch (dev_tucb->parms.tu) {
/*--------------------------------------*/
/*- INITIALIZE Test Unit #1 -*/
/*--------------------------------------*/
case TU_OPEN:
{
(void) Do_INIT_TUS(dev_tucb, tu_data, tu_rc);
if (tu_rc->major_rc == TU_SUCCESS)
/*- flag Diagnose state -*/
tu.adapter_diagnose_state = 1;
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file,
"TU is 1 status = %d\n", tu_rc->major_rc);
break;
}
/*--------------------------------------*/
/*- Other Test Units -*/
/*--------------------------------------*/
/*--------------------------------------*/
/*- TERMINATE Test Unit #EFFF -*/
/*--------------------------------------*/
case TU_CLOSE:
{
(void) Do_TERM_TUS(dev_tucb, tu_data, tu_rc);
if (tu_rc->major_rc == TU_SUCCESS)
/*- reset Diagnose state -*/
tu.adapter_diagnose_state = 0;
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file,
"TU is 2 status = %d\n", tu_rc->major_rc);
break;
}
/*---------------------------------------*/
/* Unknown tu number */
/*---------------------------------------*/
default:
tu.rc.major_rc = TU_INVALID_PARAM;
} /* end of switch on tu number */
/* If the OUTPUT_DATA is wanted by the calling application, */
/* then the tucb->data_log should not be NULL. If so, then */
/* this structure may be used. */
if ( dev_tucb->parms.data_log )
dev_tucb->parms.data_log->error_code = TU_FAILED;
/* If the INPUT_DATA is specified by the calling application, */
/* then the tucb->tu_data should not be NULL. If so, then */
/* get specific input data from this structure */
if ( dev_tucb->parms.tu_data )
mfg_flag = dev_tucb->parms.tu_data->mfg_mode;
return (tu_rc->major_rc);
} /* end of exectu()-------------------------------------------------------*/
영어 원문
Example TU exectu function
(127줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU 장치 열기·닫기 인터페이스 예
테스트 단위가 장치를 열고 닫는 인터페이스의 예입니다.
/*
* COMPONENT_NAME: (TU_DEVICE) Resource Interface Access Code
*
* FUNCTIONS: Do_INIT_TUS
* Do_TERM_TUS
*/
/* FILE NAME: device_interface.c */
/* FUNCTION: Device Adapter Application Interface Code */
/* */
/* This source file contains source code for the Device adapter’s */
/* Application Test Units to aid in various testing environments */
/* of the device adapter. These test units provide a basic inter- */
/* face between the diagnostic application program and functions */
/* written in the diagnostic extension (pdiagex) which provide direct */
/* access to the device without the need for a device driver. */
/* */
/* */
/* INCLUDED FILES */
#include <sys/types.h>
#include <stdio.h>
#include <errno.h>
#include <sys/intr.h>
#include <sys/dma.h>
#include "device_err_detail.h"
#include "tu.h"
#include <diag/tucb.h>
#include <sys/pdiagex_dds.h>
/*****************************************/
/*- INITIALIZE Test Unit #1 -*/
/*****************************************/
void
Do_INIT_TUS(TU_TYPE *dev_tucb, TU_GLOBAL_DATA *tu_data, TU_RETURN_TYPE *tu_rc)
{
int rc;
void *ih_handle;
/* Set initial tu success status */
tu_rc->major_rc = TU_SUCCESS;
/*- unconfigure device/children and place device in diagnose state -*/
rc = pdiag_diagnose_state(dev_tucb->resource_name);
if (rc != 0) { /*- test unit failed to complete normally -*/
tu_rc->major_rc = TU_DEVICE_BUSY;
tu_rc->minor_rc = rc;
return;
}
tu_data->adapter_diagnose_state = 1;
/* Get all the device attributes for the dds structure */
rc = get_dds( dev_tucb, tu_data );
if (rc != 0) { /*- test unit failed to complete normally -*/
tu_rc->major_rc = TU_SOFTWARE_ERROR;
tu_rc->minor_rc = rc;
return;
}
/************************************************************
* Call pdiag_open
* This also loads the interrupt handler
************************************************************/
/* Open the device for testing via PDIAGEX */
rc = pdiag_open( dev_tucb->resource_name, &tu_data->dds, "device_intr",
&tu_data->pdiagex_handle);
if (rc != 0) { /*- test unit failed to complete normally -*/
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file,
"pdiagex open rc = %d\n", rc);
tu_rc->major_rc = TU_DEVICE_BUSY;
tu_rc->minor_rc = rc;
return;
}
return; /*- normal completion -*/
}
/*****************************************/
/*- TERMINATE Test Unit #EFFF -*/
/*****************************************/
void
Do_TERM_TUS(TU_TYPE *dev_tucb, TU_GLOBAL_DATA *tu_data, TU_RETURN_TYPE *tu_rc)
{
int rc;
tu_rc->major_rc = TU_SUCCESS;
/* Close/terminate device from PDIAGEX */
/* This also unloads the interrupt handler */
rc = pdiag_close(tu_data->pdiagex_handle);
if ( rc != 0 ) {
if ( dev_tucb->parms.msg_file != (FILE *)NULL)
fprintf( dev_tucb->parms.msg_file,
"pdiagex close rc = %d\n", rc);
tu_rc->major_rc = TU_SOFTWARE_ERROR;
tu_rc->minor_rc = rc;
}
/*- reconfigure device/children to their original state -*/
rc = pdiag_restore_state(dev_tucb->resource_name);
if (rc != 0) { /*- test unit failed to complete normally -*/
tu_rc->major_rc = TU_SOFTWARE_ERROR;
tu_rc->minor_rc = rc;
}
return; /*- normal completion -*/
}
/*****************************************/
/*- Get the device attributes -*/
/*****************************************/
int
get_dds( TU_TYPE *dev_tucb, TU_GLOBAL_DATA *tu_data )
{
int rc;
char type;
char *parent_name;
/* Open/Initialize Configuration Services */
if ((rc = pdiag_cs_open()) != 0 )
return (rc);
/********************************************************/
/* Initialize the DDS structure with all pertinent data */
/********************************************************/
/* Get the parent name */
rc = pdiag_cs_get_attr(dev_tucb->resource_name, "parent_name",
&parent_name, &type );
/* Bus ID for the parent resource */
rc = getatt(&tu_data->dds.bus_id,’l’,parent_name,"bus_id",NULL);
pdiag_cs_free_attr ( parent_name );
/* Slot number */
rc=getatt(&tu_data->dds.slot_num,’i’,dev_tucb->resource_name,
"connwhere", NULL);
/* Bus Interrupt Level */
rc=getatt(&tu_data->dds.bus_intr_lvl,’i’,dev_tucb->resource_name,
"busintr", NULL);
/* assign bus_io_addr */
rc=getatt(&tu_data->dds.bus_io_addr,’l’,dev_tucb->resource_name,
"busio",NULL);
/* assign bus_io_length */
rc=getatt(&tu_data->dds.bus_io_length,’l’,dev_tucb->resource_name,
"bus_io_length",NULL);
/* assign bus_mem_addr */
rc=getatt(&tu_data->dds.bus_mem_addr,’l’,dev_tucb->resource_name,
"bus_mem_addr",NULL);
/* assign bus_mem_length */
rc=getatt(&tu_data->dds.bus_mem_length,’l’,dev_tucb->resource_name,
"bus_mem_length",NULL);
tu_data->dds.intr_priority = INTCLASS2;
tu_data->dds.intr_flags = NULL; /* not used by PCI */
tu_data->dds.dma_lvl = NULL; /* not used by PCI */
tu_data->dds.dma_bus_mem = NULL;
tu_data->dds.dma_bus_length = NULL;
tu_data->dds.dma_flags = DMA_MASTER;
tu_data->dds.bus_type = BUS_BID;
tu_data->dds.data_ptr = (uchar *)NULL;
tu_data->dds.maxmaster = 32;
/* Close Configuration Services */
pdiag_cs_close();
return (rc);
}
/**************************************************************************
* NAME: getatt
*
* FUNCTION: Obtains attribute from the configuration services
* database, or change list.
*
* EXECUTION ENVIRONMENT:
*
* NOTES:
*
* int
* getatt(dest_addr,dest_type,lname,att_name,newatt )
*
* dest_addr = pointer to the destination field.
* dest_type = The data type which the attribute is to be converted to
* ’s’ = string rep=s
* ’b’ = byte sequence rep=s, e.g. "0x56FFE67.."
* ’l’ = long rep=n
* ’i’ = int rep=n
* ’h’ = short (half) rep=n
* ’c’ = char rep=n,or s
* ’a’ = address rep=n
* lname = Device logical name. ( or parent’s logical name )
* att_name = attribute name to retrieve
* newatt = New attributes to be scanned before reading database
*
*
* RETURNS:
* 0 = Successful
* <0 = Successful (for byte sequence only, = -ve no. of bytes)
* >0 = errno ( E_NOATTR = attribute not found )
*
**************************************************************************/
int getatt(dest_addr, dest_type, lname, att_name, newatt)
void *dest_addr; /* Address of destination */
char dest_type; /* Destination type */
char *lname; /* device logical name */
char *att_name; /* attribute name */
struct attr *newatt; /* List of new attributes */
{
struct attr *att_changed();
struct attr *att_ptr;
int convert_seq();
int rc;
char *val_ptr;
char rep;
char *value;
/* Note: We need an entry from customized, or predefined even if */
/* an entry from newatt is going to be used because there is no */
/* representation (rep) in newatt */
/* SEARCH FOR ENTRY */
rc = pdiag_cs_get_attr(lname, att_name, &value, &rep );
/* CONVERT THE DATA TYPE TO THE DESTINATION TYPE */
rc = convert_att(dest_addr, dest_type, value, rep );
/* Free up what the pdiag_cs_get_addr allocated */
pdiag_cs_free_attr( &value );
return(rc);
}
/*************************************************************************
* NAME: convert_att
*
* FUNCTION: This routine converts attributes into different data types
*
* EXECUTION ENVIRONMENT:
*
* Generally this routine is called by getatt(), but it is available
* to other procedures which need to convert data which may not also
* be represented in the database.
* No global variable are used, so this may be dynamically linked.
*
* RETURNS:
*
* 0 = Successful
* <0 = Successful (for byte sequence only, = -ve no. of bytes)
* >0 = errno
**************************************************************************/
int convert_att(dest_addr, dest_type, val_ptr, rep )
void *dest_addr; /* Address of destination */
char dest_type; /* Destination type */
char *val_ptr; /* Address of source */
char rep; /* Representation of source (’s’, or ’n’) */
{
if( rep == ’s’ ) {
switch( dest_type ) {
case ’s’:
strcpy( (char *)dest_addr, val_ptr );
break;
case ’c’:
*(char *)dest_addr = *val_ptr;
break;
case ’b’:
return ( convert_seq( val_ptr, (char *)dest_addr ) );
case ’i’:
*(int *)dest_addr =
(int)strtoul( val_ptr, (char **)NULL, 0);
break;
default:
return 1;
}
} else if( rep == ’n’ ) {
switch( dest_type ) {
case ’l’:
*(long *)dest_addr =
strtoul( val_ptr, (char **)NULL, 0);
break;
case ’i’:
*(int *)dest_addr =
(int)strtoul( val_ptr, (char **)NULL, 0);
break;
case ’h’:
*(short *)dest_addr =
(short)strtoul( val_ptr, (char **)NULL, 0);
break;
case ’c’:
*(char *)dest_addr =
(char)strtoul( val_ptr, (char **)NULL, 0);
break;
case ’a’:
*(void **)dest_addr =
(void *)strtoul( val_ptr, (char **)NULL, 0);
break;
default:
return 1;
}
} else {
return 1;
}
return 0;
}
/**************************************************************************
* NAME: convert_seq
*
* FUNCTION: Converts a hex-style string to a sequence of bytes
*
* EXECUTION ENVIRONMENT:
*
* This routine uses no global variables
*
* NOTES:
*
* The string to be converted is of the form
* "0xFFAAEE5A567456724650789789ABDEF678" (for example)
* This would put the code FF into the first byte, AA into the second,
* etc.
*
* RETURNS: No of bytes, or -3 if error.
*
***************************************************************************/
int convert_seq( source, dest )
char *source;
uchar *dest;
{
char byte_val[5]; /* e.g. "0x5F\0" */
int byte_count = 0;
uchar tmp_val;
char *end_ptr;
strcpy( byte_val, "0x00" );
if( *source == ’\0’ ) { /* Accept empty string as legal */
return 0;
}
if( *source++ != ’0’ ) {
return 1;
}
if( tolower(*source++) != ’x’ ) {
return 1;
}
while( ( byte_val[2] = *source ) && ( byte_val[3] = *(source+1) ) ) {
source += 2;
/* be careful not to store illegal bytes in case the
* destination is of exact size, and the source has
* trailing blanks
*/
tmp_val = (uchar) strtoul( byte_val, &end_ptr, 0 );
if( end_ptr != &byte_val[4] ) {
break;
}
*dest++ = tmp_val;
byte_count++;
}
return -byte_count;
}
영어 원문
Example TU open/close device interface
(328줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU Makefile 예
테스트 단위 라이브러리를 만드는 Makefile의 예입니다.
#
# COMPONENT_NAME: (TU_DEVICE)
#
# FUNCTIONS: EXAMPLE TU LIBRARY MAKEFILE
#
#
VPATH = ${MAKETOP}/bos/kernext/exp
# The following three lines are for building a
# Second Level Interrupt Handler.
SUBDIRS = slih
EXPINC_SUBDIRS = slih
EXPLIB_SUBDIRS = slih
PROGRAMS = libtu_device
# Flag to the linker that exectu is the main entry point.
libtu_device_LDFLAGS += -e exectu
# If using PDIAGEX, the diagnostic kernel extension
libtu_device_IMPORTS = -bI:pdiagex.exp
#
LIBS = -ldiag -lpdiag
# Install list and directory.
ILIST = ${PROGRAMS}
IDIR = /usr/lpp/diagnostics/lib/
OFILES = device_exectu.o device_interface.o
.include <${RULES_MK}>
#
#Using command line make:
#
libtu_device: device_exectu.o device_interface.o
ld -o tu /lib/crt0.o device_exectu.o
device_interface.o -lpdiag -lc -e exectu
device_exectu.o: device_exectu.c
cc -c -I. device_exectu.c
device_interface.o: device_interface.c
cc -c -I. device_interface.c
영어 원문
Example TU makefiles
(34줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU 인터럽트 처리기 C 소스 예
테스트 단위의 인터럽트 처리기(SLIH) C 소스 파일의 예입니다.
/*
* COMPONENT_NAME: tu_device
*
* FUNCTIONS: device_interrupt
*/
/*** header files ***/
#include <sys/adspace.h>
#include <sys/ioacc.h>
#include <sys/types.h>
#include <sys/sleep.h>
#include <sys/watchdog.h>
#include <sys/trcmacros.h>
#include <sys/pdiagex_dds.h>
/******************************************************************************
*
* NAME: device_interrupt
*
* FUNCTION: Interrupt handler for the ....... adapter.
*
* INPUT PARAMETERS: handle = handle returned from pdiagex_open
* data = data passed to handler during
* initialization.
*
* EXECUTION ENVIRONMENT: Interrupt
*
* RETURN VALUE DESCRIPTION: none.
*
* EXTERNAL PROCEDURES CALLED: pdiag_dd_read, pdiag_dd_write
*
******************************************************************************/
int device_interrupt(pdiag_info_handle_t handle, char *data_area,
int *interrupt_flag, int sleep_flag, int *sleep_word)
{
ushort readdata, rc;
int interrupt_mask;
int offset;
ulong writedata;
pdiagex_opflags_t flags={ PDIAG_MEM_OP,
1,
PDIAG_SING_LOC_ACC,
INTRKMEM,
NULL };
/******************************************
* Get value of interrupt status register
******************************************/
rc = pdiag_dd_read(handle, IOSHORT16, offset,
(void *)&readdata, &flags);
*interrupt_flag = 0;
/***********************************************************
* An Interrupt for this resource has occurred, process it.
***********************************************************/
rc = pdiag_dd_write(handle, IOSHORT16, offset, (void *)&writedata,
&flags);
/************************************************************
* Set a value to the watchdog function that indicates that
* this is the interrupt expected
************************************************************/
*interrupt_flag |= interrupt_mask;
/*********************************************
* Wake up sleeping application IF necessary
**********************************************/
if (sleep_flag) {
pdiag_dd_interrupt_notify( sleep_word );
}
return (0);
} /* end device_intr */
영어 원문
Example C source file for TU interrupt handler
(66줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TU 인터럽트 처리기 Makefile 예
테스트 단위 인터럽트 처리기를 만드는 Makefile의 예입니다.
# COMPONENT_NAME: tu_device
#
# FUNCTIONS: none
#
#
#-----------------------------------------------------------------------#
# #
# Make file for the ................... #
# #
#-----------------------------------------------------------------------#
# @(#)17 1.1 src/idd/en_US/aixprggd/diagunsd/TU_64bit_port.htm, iddiagunsd,
# idd500 5/23/00 13:54:31
#
.include <${MAKETOP}bos/kernext/Kernext.mk>
TU_VPATH = ${MAKETOP}/bos/diag/tu/tu_dir
VPATH = ${MAKETOP}bos/kernel/exp:${MAKETOP}bos/kernext/exp:$TU_VPATH
# 32-bit version of load object
#
KERNEL_EXT = your_intr
# 64-bit version of load object
#
KERNEL_EXT64 = your_intr64
IDIR = /usr/lpp/diagnostics/slih/
# install list containing 32-bit and 64-bit version
#
ILIST = your_intr your_intr64
OPT_LEVEL = -qlist -qsource
# entry point, import and export files for 32-bit version
#
your_intr _DEPENDS = your_intr .exp
your_intr _ENTRYPOINT = your_interrupt
your_intr _IMPORTS = -bI:pdiagex.exp
your_intr _EXPORTS = -bE: your_intr .exp
# entry point, import and export files for 64-bit version
# (common with 32-bit version)
your_intr64 _DEPENDS = your_intr .exp
your_intr64 _ENTRYPOINT = your_interrupt
your_intr64 _IMPORTS = -bI:pdiagex.exp \
pdiagex64.exp
your_intr64 _EXPORTS = -bE: your_intr .exp
# object list definition for 32-bit version
#
your_intr _OFILES = your_intr .o
# object list definition for 64-bit version (common objects
# across 32-bit and 64-bit versions), with 64-bit objects
# renamed to .64o
#
your_intr64 _OFILES = your_intr .64o
INCFLAGS = -I${MAKETOP}/bos/diag/tu/tu_dir \
-I${MAKETOP}bos/usr/include
LIBS = ${KERNEXT_LIBS}
.include <${RULES_MK}>
참고: 이 예를 쓰려면 환경 변수와 파일 이름을 자기 것으로 바꿉니다.
영어 원문
Example TU interrupt handler makefile
(52줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
Note: Replace the environment variables and file names with your own names to customize this example for your own use.
진단 응용 프로그램 예
진단 응용 프로그램(DA)의 예입니다.
/*
* COMPONENT_NAME : DAXYZ - diagnostic application for resource xyz
*
* FUNCTIONS : main
tu_test
clean_up
stand_by_screen
loop_stand_by_screen
check_rc
ela
check_microcode
*/
#include <stdio.h>
#include <locale.h>
#include <cf.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/ldr.h>
/* ... etc (any necessary system header files)*/
#include <diag/da.h>
#include <diag/diago.h>
#include <diag/diag.h>
#include <diag/tm_input.h>
#include <diag/tmdefs.h>
#include <diag/diag_exit.h>
#include "dxyz_msg.h"
#include "dxyz.h"
/************************************************/
/* If the application wants detailed error data */
/* then include the header file containing the */
/* structures for the error or output data, else*/
/* do not include. This header file is normally */
/* dropped with the test unit code. */
/************************************************/
#include "device_err_detail.h"
/************************************************/
/* If the application uses special input data */
/* then include the header file which must be */
/* common between the DA and TU, else */
/* do not include. Manufacturing and HTX use */
/* only. This header file is normally */
/* dropped with the test unit code. */
/************************************************/
#include "device_input_params.h"
/************************************************/
/* Include the tucb header file. */
/************************************************/
#include <diag/tucb.h>
/* TU operation defines */
#define TU_OPEN 1
#define TU_CLOSE 0xEFFF
/* OTHERS AS REQUIRED */
int reg_tu_seq[6] =
{
TU_OPEN,
18,
19,
3,
4,
TU_CLOSE /*Problem determination sequence*/
};
int sys_tu_seq[8] =
{
TU_OPEN,
18,
19,
3,
4,
8,
17,
TU_CLOSE /*System checkout sequence*/
};
/*fru_bucket is a structure that holds information for the diagnostic
program to return to the diagnostic controller when a failure is
found that needs to be reported. (FRU means Field Replaceable Unit).
*/
struct fru_bucket frub[] =
{
{"", FRUB1, 0x849, 0x210, R_XYZ_ADAPTER,
{
{87,"","",0,DA_NAME,NONEXEMPT},
{13,"DRAM Sip","00-00-00",F_XYZ_DRAM,NOT_IN_DB,EXEMPT},
},
},
{"", FRUB1, 0x849, 0, R_ELA,
{
{90,"","",0,DA_NAME,NONEXEMPT},
{10,"","",0,PARENT_NAME, NONEXEMPT},
},
},
{"", FRUB1, 0x849, 0x160, R_V35_CABLE,
{
{95,"V35 Cable", "",CABLEFRU,0,0},
{5,"","",0,DA_NAME,NONEXEMPT},
},
},
};
struct msglist plug_37[] = {
{Q_PLUG_37_PIN,Q_PLUG_37_PIN_TITLE},
{Q_PLUG_37_PIN,Q_PLUG_37_PIN_YES},
{Q_PLUG_37_PIN,Q_PLUG_37_PIN_NO},
{Q_PLUG_37_PIN,Q_PLUG_37_PIN_ACTION},
NULL
};
/* The above messages are stored in the DA message file - dxyz.msg.
The following screen will be displayed by making an ASL
call during the execution of this DA. The complete DA will have
more menus displayed during different instances. */
원문은 여기서 DA가 표시하는 다음 화면을 보여 줍니다(37핀 랩 플러그가 있는지 묻는 화면).
TESTING XYZ ADAPTER xyz0 IN ADVANCED MODE xxx001
The following test requires a 37-pin wrap plug, Part Number xxxxxxx.
Do you have this wrap plug?
Move cursor to selection, then press Enter.
YES
NO
F3=Cancel F10=Exit
#define IS_CONSOLE ((int)(tm_input.console == CONSOLE_TRUE))
/* include your own macros here */
static ASL_SCR_INFO q_plug_37[DIAG_NUM_ENTRIES(plug_37)];
/* include additional msglist here */
static ASL_SCR_TYPE menutype = DM_TYPE_DEFAULTS;
/* static variables */
struct tm_input tm_input;
struct errdata err_data;
struct stat *tmpbuf;
int envflag;
char *slot;
char *libpath = NULL;
nl_catd fdes;
short state;
int diskette_based;
int fd;
int rc;
int i;
int val;
int (*tu_entry)();
FILE *fd;
TU_TYPE dev_tucb;
TU_TYPE *dev_tucb_ptr;
TU_INFO_HANDLE *tu_handle = (TU_INFO_HANDLE *)NULL;
TU_RETURN_TYPE tu_rc;
void tu_test(int);
/* external functions */
extern getdainput();
extern addfrub();
unsigned int dtoh();
main()
{
/*variables declaration */
DA_SETRC_STATUS(DA_STATUS_GOOD);
DA_SETRC_ERROR(DA_ERROR_NONE);
DA_SETRC_USER(DA_USER_NOKEY);
DA_SETRC_TESTS(DA_TEST_FULL);
DA_SETRC_MORE(DA_MORE_NOCONT);
/*initialize locale environment*/
setlocale(LC_ALL, "");
/*initialize the Configuration database*/
init_dgodm();
/* get input environment */
if (getdainput(&tm_input)!= 0) {
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
}
/*if using console - initialize ASL and open message catalog*/
if (IS_CONSOLE) {
diag_asl_init("DEFAULT");
fdes=diag_catopen(MF_XYZ,0);
}
/*display initial screen depending on loopmode*/
if(tm_input.loopmode==LOOPMODE_NOTLM) {
stand_by_screen();
}
else
loop_stand_by_screen();
/*verify existence of any microcode needed to run*/
check_microcode();
/* TU initialization*/
dev_tucb_ptr = &dev_tucb;
dev_tucb_ptr->resource_name = tm_input.dname;
/* If detailed output data is not desired, then set to NULL */
dev_tucb_ptr->parms.data_log = (void *)NULL;
dev_tucb_ptr->parms.data_log_length = (long)0;
/* Else If detailed output data is expected, then malloc some space */
dev_tucb_ptr->parms.data_log =
(OUTPUT_DATA*)malloc(sizeof(OUTPUT_DATA));
/* This particular test wants to use the crc_test structure */
/* See {device}_err_detail.h file for details */
dev_tucb_ptr->parms.data_log_length = (long)sizeof(
dev_tucb_ptr->parms.data_log->crc_test);
/* If specific input data is not used, then set to NULL */
dev_tucb_ptr->parms.tu_data = (void *)NULL;
dev_tucb_ptr->parms.tu_data_length = (long)0;
/* Else If specific input data is used, then malloc some space */
dev_tucb_ptr->parms.tu_data = (INPUT_DATA *)malloc(sizeof(INPUT_DATA));
dev_tucb_ptr->parms.tu_data_length = (long)sizeof(
dev_tucb_ptr->parms.tu_data);
/* and set whatever input parameters required */
dev_tucb_ptr->parms.tu_data->mfg_mode = 5;
/* If not using a file for debug messages, set to NULL */
/* Use the environment variable DIAG_DEBUG */
if( (char *)getenv("DA_DEBUG") == (char *)NULL)
dev_tucb_ptr->parms.msg_file = (FILE *)NULL;
/* Else open a file and set FILE * */
else {
fd = (FILE *)fopen("/tmp/debug.file", "w");
dev_tucb_ptr->parms.msg_file = fd;
}
/*--------------------------------------*/
/*- Load the Test Unit Library -*/
/*--------------------------------------*/
/* The path for the test unit library will be */
/* in /usr/lpp/diagnostics/lib directory. */
if( (libpath = (char *)getenv("DIAGNOSTICS_TU_LIB")) != NULL )
tu_entry = load("libtu_device", L_LIBPATH_EXEC, libpath);
else
tu_entry = load("/usr/lpp/diagnostics/lib/libtu_device",
L_LIBPATH_EXEC, (char *)NULL);
if (tm_input.dmode!=DMODE_ELA) {
if(tm_input.system==SYSTEM_TRUE) {
/* System Checkout*/
if (tm_input.loopmode==LOOPMODE_NOTLM)
stand_by_screen();
else
loop_stand_by_screen();
/* Execute system checkout sequence*/
for(i=0;i<10; ++i)
tu_test(sys_tu_seq[i]);
}
/* Diagnostic Routines */
else if (tm_input.loopmode==LOOPMODE_NOTLM) {
stand_by_screen();
if (IS_CONSOLE) {
/*Execute problem determination sequence */
for (i=0; i<9; ++i)
/*Problem Determination */
tu_test(reg_tu_seq[i]);
/* After running "regular" TUs,
see if Advanced Diag is invoked */
if(tm_input.advanced==ADVANCED_TRUE) {
/* Ask user if a particular wrap plug
is available */
rc=diag_diplay(0x00,fdes,plug_37,DIAG_IO,
ASL_DIAG_LIST_CANCEL_EXIT_SC,&menutype,q_plug_37);
check_rc(rc);
if (rc==DIAG_ASL_COMMIT)
switch (DIAG_ITEM_SELECTED(menutype)) {
case 1: /* Answer is YES */
slot = tm_input.dnameloc;
rc=diag_msg(0x902000,fdes,
PLUG_37_PIN,
PLUG_37_PIN_TITLE,slot);
check_rc(rc);
stand_by_screen();
tu_test(10);
rc=diag_msg(0x902001,fdes,
UNPLUG_37_PIN,
UNPLUG_37_PIN_TITLE,slot);
check_rc(rc);
break;
case 2: /* Answer is NO */
break;
default:
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
break;
} /* end switch */
}/* end Advanced Tests*/
stand_by_screen();
/* execute remaining tests
in problem determination, if any */
tu_test(17);
}
else { /*Console false - execute System Checkout
sequence */
for (i=0; i<10; ++i)
tu_test(sys_tu_seq[i]);
}
} /* end problem determination - diagnostic routines */
else
{/* Must be loop mode */
switch (tm_input.loopmode) {
case LOOPMODE_ENTERLM:
loop_stand_by_screen();
val = 0;
putdavar(tm_input.dname, "vname",
DIAG_INT, &val);
/* Do what is necessary - enter loop mode */
ela();
break;
case LOOPMODE_INLM:
loop_stand_by_screen();
getdavar(tm_input.dname, "vname",
DIAG_INT, &val);
/* Do what is necessary - IN loop mode */
break;
case LOOPMODE_EXITLM:
getdavar(tm_input.dname, "vname",
DIAG_INT, &val);
/* Do what is necessary - EXIT loop mode.
For example,put of menus to restore
machine’s original state. */
break;
default:
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
break;
} /* end switch - loop mode */
} /* end if-else - loop mode */
} /* end if ! ELA */
/* Performing Error Log Analysis */
if (((tm_input.dmode==DMODE_PD) || (tm_input.dmode==DMODE_ELA))
&& (tm_input.loopmode==LOOPMODE_NOTLM))
ela();
DA_SETRC_ERROR(DA_ERROR_NONE);
DA_SETRC_TESTS(DA_TEST_FULL);
clean_up();
} /*end main */
/*
* NAME : tu_test
*
* FUNCTION : Executes test units and reports FRUs to the controller
* if a failure is found.
*
* EXECUTION ENVIRONMENT :
*
* Called by the main program to execute test units.
* Call external routine exectu to actually execute the test units.
* Call external routine diag_asl_read to get user’s input to screen
* e.g. Cancel or Exit.
* Call external routines insert_frub and addfrub when a failure
* is found.
* Call clean_up after a fru is reported to the controller.
*
* RETURNS : NONE
*
*/
void tu_test(int tunum)
{
ulong major_rc; /*return code from test unit */
dev_tucb_ptr->parms.tu = tunum;
dev_tucb_ptr->parms.loop = 1; /* command loop */
major_rc = tu_entry(dev_tucb_ptr, &tu_handle, &tu_rc);
if ( fd != (FILE *) NULL)
fprintf( fd,"(DA)TU_OPEN - major_rc = %d\n", tu_rc.major_rc);
if (IS_CONSOLE) {
rc = diag_asl_read(ASL_DIAG_KEYS_ENTER_SC,FALSE,NULL);
check_rc(rc);
}
if (major_rc !=0 ) {
switch (tunum) {
case 1:
if (major_rc < 0x00) {
rc = insert_frub(&tm_input,&frub[2]);
if (rc != 0) {
DA_SETRC_STATUS(DA_STATUS_BAD);
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
}
strncpy (frub[2].dname,
tm_input.dname,sizeof(frub[0].dname));
addfrub(&frub[2]);
}
break;
case 3:
case 9:
case 10:
/*etc*/
case 16:
break;
default :
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
break;
} /* end switch*/
DA_SETRC_STATUS(DA_STATUS_BAD);
DA_SETRC_MORE(DA_MORE_NOCONT);
DA_SETRC_TESTS(DA_TEST_FULL);
clean_up();
} /* end - if*/
} /* end tu_test */
/* clean_up */
clean_up()
{
if (fd>0)
close (fd);
/*--------------------------------------*/
/*- UnLoad the Test Unit Library -*/
/*--------------------------------------*/
rc = unload((void *)tu_entry);
/* Restore machine to original state, if you need to switch back
microcode, do it here. */
if (IS_CONSOLE) {
diag_asl_quit(); /* close ASL */
catclose(fdes);
}
term_dgodm(); /* close ODM */
DA_EXIT();
} /* end clean_up*/
/*stand_by_screen*/
int
stand_by_screen()
{
char *text_array[3];
text_array[0] = diag_cat_gets(fdes, DESC, MSG1 );
text_array[1] = tm_input.dname;
text_array[2] = tm_input.dnameloc;
if (IS_CONSOLE) {
switch (tm_input.advanced) {
case ADVANCED_TRUE:
rc = diag_display_menu(ADVANCED_TESTING_MENU,0x902002,
text_array,0,0);
break;
case ADVANCED_FALSE:
rc = diag_display_menu(CUSTOMER_TESTING_MENU,0x902003,
text_array,0,0);
break;
default:
break;/*not really necessary*/
}
check_rc(rc);
}
} /*end stand_by_screen */
/* loop_stand_by_screen */
int
loop_stand_by_screen()
{
char *text_array[3];
text_array[0] = diag_cat_gets(fdes, DESC, MSG1 );
text_array[1] = tm_input.dname;
text_array[2] = tm_input.dnameloc;
if (IS_CONSOLE) {
rc = diag_display_menu(LOOPMODE_TESTING_MENU,0x902004,
text_array, tm_input.lcount,tm_input.lerrors);
check_rc(rc);
}
} /*end loop_stand_by_screen */
/* check_rc */
int
check_rc(rc)
int rc; /* user’s input */
{
if (rc == DIAG_ASL_CANCEL) {
/*force microcode swap - if applies */
tm_input.loopmode = LOOPMODE_EXITLM;
DA_SETRC_USER(DA_USER_QUIT);
DA_SETRC_TESTS(DA_TEST_FULL);
clean_up();
}
if (rc == DIAG_ASL_EXIT) {
DA_SETRC_USER(DA_USER_EXIT);
DA_SETRC_TESTS(DA_TEST_FULL);
clean_up();
}
return (rc);
} /* end check_rc */
/* ela */
int
ela()
{
char crit[255];
sprintf(crit, "-N %s %s", tm_input.dname,tm_input.date);
rc = error_log_get (INIT,crit,&err_data);
while (rc !=0) {
if (rc == -1) {
DA_SETRC_STATUS(DA_STATUS_GOOD);
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
}
else if (rc>0) {
if((err_data.err_id == 0x0000000)
|| (err_data.err_id == 0x000000)) {
rc = insert_frub(&tm_input,&frub[1]);
if (rc !=0) {
DA_SETRC_STATUS(DA_STATUS_GOOD);
DA_SETRC_ERROR(DA_ERROR_OTHER);
DA_SETRC_TESTS(DA_TEST_FULL);
clean_up();
}
strncpy (frub[1].dname,tm_input.dname,
sizeof(frub[1].dname));
addfrub (&frub[1]);
DA_SETRC_STATUS(DA_STATUS_BAD);
clean_up();
} /* end if */
rc = error_log_get (SUBSEQ,crit,&err_data);
}
rc = error_log_get (TERMI,crit,&err_data);
if (rc == -1) {
DA_SETRC_STATUS(DA_STATUS_GOOD);
DA_SETRC_ERROR(DA_ERROR_OTHER);
clean_up();
}
}
}
/* check_microcode */
int
check_microcode()
{
char mpath[255];
char *no_rcm_msg;
char *no_diag_msg;
/* Check if the functional microcode file xxxx.xxx is present.
Check only if diagnostics is run off hard disk */
envflag = ipl_mode(&diskette_based);
if (diskette_based == DIAG_FALSE) {
if (0 > (rc = findmcode("funcmcode",mpath,VERSIONING, NULL))) {
sprintf(no_rcm_msg,catgets(fdes,NO_RCM,NO_RCM_TITLE,
NULL));
menugoal(no_rcm_msg);
}
}
/* Check if all the diagnostic microcode files are present. */
if (0 > (rc = findmcode("diagmcode", mpath, VERSIONING, NULL))) {
sprintf(no_diag_msg,catgets(fdes,MENU_SET,NO_
DIAGMICROCODE_MENU,NULL));
menugoal(no_diag_msg);
clean_up();
}
}
영어 원문
Example diagnostic application
(109줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
TESTING XYZ ADAPTER xyz0 IN ADVANCED MODE xxx001
The following test requires a 37-pin wrap plug, Part Number xxxxxxx.
Do you have this wrap plug? Move cursor to selection, then press Enter.
YES NO
F3=Cancel F10=Exit
(403줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
진단 응용 프로그램 메시지 파일 예
진단 응용 프로그램이 쓰는 메시지 파일(.msg)의 예입니다. 메뉴 텍스트와 FRU 설명이 들어 있으며, $로 시작하는 줄은 번역자를 위한 주석입니다.
$
$ COMPONENT_NAME: DAXYZ
$
$ FUNCTIONS: dxyz.msg - message file for screen display when diagnostic
$ application dxyz is invoked.
$
$ Compilation: Use AIX command mkcatdefs to create header file containing
$ symbols for use in C source code.
$ GENERAL NOTES FOR TRANSLATION PURPOSES
$
$ Do not translate %c, %d, %s, %x, %07X, or \t in any messages. They
$ are used for word or number substitution and are noted in the
$ comments for the individual messages. The 1$, 2$, 3$, etc,
$ within the substitutions are used to denote the order of the
$ substitutions.
$
$ These comments concern the TITLE LINES at the top the diagnostic screen.
$ The title must be in all capital letters. The first line
$ of the title cannot be longer than 65 characters starting from
$ column 1. If the line is greater than 65, it may be continued on
$ the next line. Leave line spacing as shown: one blank line after
$ the last title line. For example:
$
$ *****
$ TESTING PORT 12 OF THE 16-PORT ASYNCHRONOUS ADAPTER IN PLANAR SLOT 2
$ IN ADVANCED MODE
$
$ Please stand by.
$ *****
$
$ These comments concern the user ACTIONS in all caps.
$ If translations require the creation of new lines, begin the
$ new lines in the column immediately following the row of periods.
$ For example:
$
$ *****
$ ACTION.........one line of English might require several when translated, so
$ begin the next line at the same point of the previous line.
$ ACTION.........the next action follows with no blank line preceding it.
$ *****
$
$ The location of a resource is in the form of xx-xx-xx where x is an
$ alpha-numeric character. The location is not translatable. It is
$ an alpha-numeric descriptor of where the resource can be found.
$
$ END OF GENERAL NOTES
$set DESC
$quote "
$
MSG1 "XYZ ADAPTER"
$
$ Leave line spacing as shown. See general notes on length of title line.
$set SRNS
$ ---------------------------------------------------------------
$ Reason code set used by device type "XYZ"
R_XYZ_ADAPTER "An error was found on the adapter."
R_V35_CABLE "An error was found with the XYZ interface adapter cable."
R_ELA "Error log analysis indicates a hardware error."
R_DD "Adapter hardware has caused a software failure."
F_XYZ_DRAM "DRAM SIPs on the adapter card"
$ DRAM stands for Dynamic Random Access Memory. SIP stands for
$ Single In-line Package.
CABLEFRU "Cable Part Number xxxxxxxx"
$set Q_PLUG_37_PIN
Q_PLUG_37_PIN_TITLE "TESTING XYZ ADAPTER IN ADVANCED MODE\n\n\
The following test requires a 37 pin wrap plug, Part Number xxxxxxx.\n\n\
Do you have this wrap plug ?"
$
$ Check for appropriate part number in translating country.
$ Leave line spacing as shown. See general notes on length of title line.
Q_PLUG_37_PIN_YES "YES"
$ This option is shown when a YES answer is possible.
Q_PLUG_37_PIN_NO "NO"
$ This option is shown when a NO answer is possible.
Q_PLUG_37_PIN_ACTION "Move cursor to selection, then press Enter."
$ This message is shown when a multiple selection list is presented.
$set PLUG_37_PIN
$
PLUG_37_PIN_TITLE "TESTING XYZ ADAPTER IN ADVANCED MODE\n\n\
REMOVE.........the cable, if attached, from the adapter in\n\
location %1$s.\n\
PLUG...........the wrap plug (Part Number xxxxxxx) into\n\
the adapter.\n\n\
When finished, press Enter."
$
$ %1$s is the location of the adapter as described in the general notes.
$ See general notes on how to expand ACTION lines if necessary.
$ Check for appropriate part number in translating country.
$ Leave line spacing as shown. See general notes on length of title line.
$set UNPLUG_37_PIN
$
UNPLUG_37_PIN_TITLE "TESTING XYZ ADAPTER IN ADVANCED MODE\n\n\
UNPLUG.........the wrap plug from the adapter.\n\
PLUG...........the interface cable, if it was removed,\n\
into the adapter.\n\n\
When finished, press Enter."
$
$ This line instructs the user to restore things to the original state
$ after testing is done.
$ See general notes on how to expand ACTION lines if necessary.
$ Leave line spacing as shown. See general notes on length of title line.
$set NO_RCM
$
NO_RCM_TITLE "902XXX \
XYZ OPERATIONAL MICROCODE IS MISSING\n\n\
The XYZ operational microcode is either\n\
missing or not accessible.\n\n\
This microcode is necessary in order to use the XYZ adapter card\n\
in normal system operations."
$
$ Leave line spacing as shown. See general notes on length of title.
$ Do not translate the number 902XXX at the beginning of the message.
$ Leave it exactly as shown.
영어 원문
Example diagnostic application message file
(113줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
관련 글: 응용 프로그램 테스트 단위, 진단 커널 확장 (1), 진단 라이브러리 (4), 진단 작업 매트릭스