Изучение структурі и порядка программирования CMOS памяти персональной ПЭВМ, страница 2

switch (bit[7])

{

case 0: printf("Real-time clock battery OK\n");break;

case 1: printf("Real-time clock battery died\n");break;

}

switch (bit[6])

{

case 0: printf("CMOS RAM checksum is OK\n");break;

case 1: printf("CMOS RAM checksum is BAD\n");break;

}

switch (bit[5])

{

case 0: printf("Configuration record is OK\n");break;

case 1: printf("Configuration record is invalid\n");break;

}

switch (bit[4])

{

case 0: printf("ROM size is right\n");break;

case 1: printf("ROM size is not right\n");break;

}

switch (bit[3])

{

case 0: printf("Hard disk is bad\n");break;

case 1: printf("Hard disk is OK\n");break;

}

switch (bit[2])

{

case 0: printf("Time is valid\n");break;

case 1: printf("Time is invalid\n");break;

}

printf("\nShutdown status byte:\n");

switch (cmos[15])

{

case 0: printf("Soft reset or unexpected shutdown\n");break;

case 1: printf("Shutdown after memory size is determined\n");break;

case 2: printf("Shutdown after memory test is performed\n");break;

case 3: printf("Shutdown after memory error\n");break;

case 4: printf("Shutdown with bootstrap loader request\n");break;

case 5: printf("Shutdown with FAR JMP\n");break;

case 6: printf("Shutdown after passing a protected mode test\n");break;

case 7: printf("Shutdown after passing a protected mode test\n");break;

case 8: printf("Shutdown after passing a protected mode test\n");break;

case 9: printf("Shutdown after performing block move\n");break;

case 10: printf("Shutdown with FAR JMP\n");break;

}

printf("\nDiskette drive type:\n");

tobit(cmos[16]);

printf("First diskette drive: ");

switch (bit[1]+bit[0])

{

case 2: printf("No drive\n");break;

case 1: printf("360k drive\n");break;

case 0: printf("Hi-capacity drive\n");break;

}

printf("Second diskette drive: ");

switch (bit[5]+bit[4])

{

case 0: printf("No drive\n");break;

case 1: printf("360k drive\n");break;

case 2: printf("Hi-capacity drive\n");break;

}

printf("\nHard disk drive type:\n");

tobit(cmos[18]);

printf("First HDD pre-defined type ID: %d%d%d%d\n",bit[3],bit[2],bit[1],bit[0]);

printf("Second HDD pre-defined type ID: %d%d%d%d\n",bit[7],bit[6],bit[5],bit[4]);

printf("\nEquipment byte\n");

tobit(cmos[20]);

printf("Diskette drives: ");

switch (bit[7]*10+bit[6])

{

case 1: printf("0\n");break;

case 0: printf("1\n");break;

case 10: printf("2\n");break;

case 11: printf("3\n");break;

}

printf("Primary display: ");

switch (bit[5]*10+bit[4])

{

case 0: printf("None or EGA\n");break;

case 1: printf("40-clm CGA\n");break;

case 10: printf("80-clm CGA\n");break;

case 11: printf("TTL Monochrome\n");break;

}

switch (bit[1])

{

case 0: printf("80287 math co-processor not installed\n");break;

case 1: printf("80287 math co-processor installed\n");break;

}

switch (bit[0])

{

case 0: printf("Diskette drive(s) installed\n");break;

case 1: printf("Diskette drive(s) not installed\n");break;

}

printf("\nBase memory:%uk\n",cmos[21]+cmos[22]*255);

printf("\nExtended memory:%uk\n",cmos[23]+cmos[24]*255);

getch();

}

Работа программы:

Исследование оперативной памяти компьютера в ОС реального режима с помощью системных утилит MEM, MSD, программ CHECIT, SIс занесением в сравнительную таблицу показаний этих программ по всем видам памяти ПЭВМ:

Размер памяти в Kb

Программа

CMA

UMA

HMA

XMA

EMS

XMS

MEM

638k

0k

-

31294

30976

30656

MSD

638k

-

-

31744

30976

5552 (av)

SI

638k

-

-

31744

30976

30592

CHECIT

640k

-

-