home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ida35bc.zip / BIOSDATA.IDC < prev    next >
Text File  |  1996-01-29  |  15KB  |  360 lines

  1. //
  2. //    This script creates a segment at paragraph 0x40 and
  3. //    makes comments to BIOS data area. To see mnemonical names of
  4. //    BIOS data area variables, please use this file:
  5. //
  6. //      - press F2 when running IDA
  7. //      - select this file
  8. //
  9. //                Ilfak Guilfanov, 16.03.94
  10.  
  11.  
  12.  
  13. //-------------------------------------------------------------------------
  14. static CW(off,name,cmt) {
  15.   auto x;
  16.   x = [ 0x40, off ];
  17.   MakeWord(x);
  18.   MakeName(x,name);
  19.   MakeRptCmt(x,cmt);
  20. }
  21.  
  22. //-------------------------------------------------------------------------
  23. static CD(off,name,cmt) {
  24.   auto x;
  25.   x = [ 0x40, off ];
  26.   MakeDword(x);
  27.   MakeName(x,name);
  28.   MakeRptCmt(x,cmt);
  29. }
  30.  
  31. //-------------------------------------------------------------------------
  32. static CB(off,name,cmt) {
  33.   auto x;
  34.   x = [ 0x40, off ];
  35.   MakeByte(x);
  36.   MakeName(x,name);
  37.   MakeRptCmt(x,cmt);
  38. }
  39.  
  40. //-------------------------------------------------------------------------
  41. static CmtBdata() {
  42.  CW(0x000,"com_port_1","Base I/O address of 1st serial I/O port");
  43.  CW(0x002,"com_port_2","Base I/O address of 2nd serial I/O port");
  44.  CW(0x004,"com_port_3","Base I/O address of 3rd serial I/O port");
  45.  CW(0x006,"com_port_4","Base I/O address of 4th serial I/O port");
  46.  
  47.  CW(0x008,"prn_port_1","Base I/O address of 1st parallel I/O port");
  48.  CW(0x00A,"prn_port_2","Base I/O address of 2nd parallel I/O port");
  49.  CW(0x00C,"prn_port_3","Base I/O address of 3rd parallel I/O port");
  50.  CW(0x00E,"prn_port_4","Base I/O address of 4th parallel I/O port");
  51.  
  52.  CW(0x010,"equip_bits",        "Equipment installed info bits\n"
  53.                      "15  14  13   12   11  10   9   8\n"
  54.                      "\\    /      game  \\       /\n"
  55.                      "# of print  port  # of RS-232\n"
  56.                      "ports 0-3   used   ports 0-4\n"
  57.                      "\n"
  58.                      "7   6    5    4    3   2   1   0\n"
  59.                      "\\   /    \\    /    \\   / Math  |\n"
  60.                      "# of   video mode  RAM    uP  no\n"
  61.                      "disk-  at boot up  00=16K    dsk\n"
  62.                      "ettes  00=EGA/VGA  01=32K   driv\n"
  63.                      " 1-4   01=CGA-40   10=48K   if 0\n"
  64.                      "if bit 10=CGA-80   11=64K\n"
  65.                      "0 = 1  11=MDA-80   (old PCs)\n"
  66.                      "\n"
  67.                      "Note: bit 13=modem on PC lap-tops\n"
  68.                      "      bit 2=mouse on MCA & others");
  69.  
  70.  CB(0x012,"manufactr_test",    "Manufacturing Test Byte\n"
  71.                      "bit 0 = 1 while in test mode\n"
  72.                      "MCA systems use other bits\n"
  73.                      "  during POST operations");
  74.  CW(0x013,"base_ram_size",    "Base memory size in KBytes (0-640)");
  75.  
  76.  CB(0x015,"mtest_scratchpad",    "[AT] {Manufacturing test scratch pad}\n"
  77.                      "[Compaq Deskpro 386] previous scan code");
  78.  CB(0x016,"error_codes",    "[AT] {Manufacturing test scratch pad}\n"
  79.                      "[PS/2 Mod 30] {BIOS control flags}\n"
  80.                      "[Compaq Deskpro 386] keyclick loudness (00h-7Fh)");
  81.  CB(0x017,"keybd_flags_1",    "Keyboard flag bits\n"
  82.                      "  7   6   5   4    3   2   1   0\n"
  83.                      "ins- cap num scrl alt ctl lef rig\n"
  84.                      "sert --toggles--- --shifts down--");
  85.  CB(0x018,"keybd_flags_2",    "Keyboard flag bits\n"
  86.                      "   7     6     5     4   \n"
  87.                      "insert  caps  num  scroll\n"
  88.                      "------now depressed------\n"
  89.                      "\n"
  90.                      "   3     2     1     0\n"
  91.                      " pause  sys   left right\n"
  92.                      " lock request -alt-down-");
  93.  CB(0x019,"keybd_alt_num",    "Alt-nnn keypad workspace");
  94.  CW(0x01A,"keybd_q_head",     "pointer to next character in keyboard buffer");
  95.  CW(0x01C,"keybd_q_tail",     "pointer to first free slot in keyboard buffer");
  96.  CW(0x01E,"keybd_queue",    "Keyboard circular buffer");
  97.  MakeArray([0x40,0x01E ], 16 );
  98.  CB(0x03E,"dsk_recal_stat",    "Recalibrate floppy drive bits\n"
  99.                      "   3       2       1       0\n"
  100.                      "drive-3 drive-2 drive-1 drive-0\n"
  101.                      "\n"
  102.                      "bit 7 = interrupt flag");
  103.  CB(0x03F,"dsk_motor_stat",    "Motor running status & disk write\n"
  104.                      " bit 7=1 disk write in progress\n"
  105.                      " bits 6&5 = drive selected 0 to 3\n"
  106.                      "    3       2       1       0\n"
  107.                      " drive-3 drive-2 drive-1 drive-0\n"
  108.                      " --------- 1=motor on-----------");
  109.  CB(0x040,"dsk_motor_timer",    "Motor timer, at 0, turn off motor");
  110.  CB(0x041,"dsk_ret_code",    "Controller return code\n"
  111.                      " 00h = ok\n"
  112.                      " 01h = bad command or parameter\n"
  113.                      " 02h = can't find address mark\n"
  114.                      " 03h = can't write, protected dsk\n"
  115.                      " 04h = sector not found\n"
  116.                      " 08h = DMA overrun\n"
  117.                      " 09h = DMA attempt over 64K bound\n"
  118.                      " 10h = bad CRC on disk read\n"
  119.                      " 20h = controller failure\n"
  120.                      " 40h = seek failure\n"
  121.                      " 80h = timeout, no response");
  122.  
  123.  CB(0x042,"dsk_status_1",    "Status bytes-disk controller chip\n"
  124.                      " Note: 7 info bytes returned from\n"
  125.                      " controller are saved here. Refer\n"
  126.                      " to the NEC uPD 765 chip manual\n"
  127.                      " for the specific info, depending\n"
  128.                      " on the previous command issued.");
  129.  CB(0x043,"dsk_status_2",    "");
  130.  CB(0x044,"dsk_status_3",    "");
  131.  CB(0x045,"dsk_status_4",    "");
  132.  CB(0x046,"dsk_status_5",    "");
  133.  CB(0x047,"dsk_status_6",    "");
  134.  CB(0x048,"dsk_status_7",    "");
  135.  
  136.  CB(0x049,"video_mode",        "Present display mode");
  137.  CW(0x04A,"video_columns",    "Number of columns");
  138.  CW(0x04C,"video_buf_size",    "Video buffer size in bytes\n"
  139.                      "  Note: size may be rounded up to\n"
  140.                      "  the nearest 2K boundary.  For\n"
  141.                      "  example, 80x25 mode=4000 bytes,\n"
  142.                      "  but value may be 4096.");
  143.  CW(0x04E,"video_pageoff",    "Video page offset of the active\n"
  144.                      "  page, from start of current \n"
  145.                      "  video segment.");
  146.  CW(0x050,"vid_curs_pos0",    "Cursor position page 0\n"
  147.                      "  bits 15-8=row, bits 7-0=column");
  148.  CW(0x052,"vid_curs_pos1",    "Cursor position page 1\n"
  149.                 "  bits 15-8=row, bits 7-0=column");
  150.  CW(0x054,"vid_curs_pos2",    "Cursor position page 2\n"
  151.                 "  bits 15-8=row, bits 7-0=column");
  152.  CW(0x056,"vid_curs_pos3",    "Cursor position page 3\n"
  153.                 "  bits 15-8=row, bits 7-0=column");
  154.  CW(0x058,"vid_curs_pos4",    "Cursor position page 4\n"
  155.                 "  bits 15-8=row, bits 7-0=column");
  156.  CW(0x05A,"vid_curs_pos5",    "Cursor position page 5\n"
  157.                 "  bits 15-8=row, bits 7-0=column");
  158.  CW(0x05C,"vid_curs_pos6",    "Cursor position page 6\n"
  159.                 "  bits 15-8=row, bits 7-0=column");
  160.  CW(0x05E,"vid_curs_pos7",    "Cursor position page 7\n"
  161.                 "  bits 15-8=row, bits 7-0=column");
  162.  CW(0x060,"vid_curs_mode",    "Active cursor, start & end lines \n"
  163.                      "  bits 12 to 8 for starting line\n"
  164.                      "  bits 4  to 0 for ending line");
  165.  CB(0x062,"video_page",        "Present page");
  166.  CW(0x063,"video_port",        "Video controller base I/O address");
  167.  CB(0x065,"video_mode_reg",    "Hardware mode register bits");
  168.  CB(0x066,"video_color",    "Color set in CGA modes");
  169.  CW(0x067,"gen_use_ptr",    "General use offset pointer");
  170.  CW(0x069,"gen_use_seg",    "General use segment pointer");
  171.  CB(0x06B,"gen_int_occurd",    "Unused interrupt occurred\n"
  172.                      "  value holds the IRQ bit 7-0 of\n"
  173.                      "  the interrupt that occurred");
  174.  CW(0x06C,"timer_low",         "Timer, low word, cnts every 55 ms");
  175.  CW(0x06E,"timer_high",        "Timer, high word");
  176.  CB(0x070,"timer_rolled",    "Timer overflowed, set to 1 when\n"
  177.                 " more than 24 hours have elapsed");
  178.  CB(0x071,"keybd_break",    "Bit 7 set if break key depressed");
  179.  CW(0x072,"warm_boot_flag",    "Boot (reset) type\n"
  180.                      "  1234h=warm boot, no memory test       \n"
  181.                      "  4321h=boot & save memory");
  182.  CB(0x074,"hdsk_status_1",    "Hard disk status\n"
  183.                 " 00h = ok\n"
  184.                 " 01h = bad command or parameter\n"
  185.                 " 02h = can't find address mark\n"
  186.                 " 03h = can't write, protected dsk\n"
  187.                 " 04h = sector not found\n"
  188.                 " 05h = reset failure\n"
  189.                 " 07h = activity failure\n"
  190.                 " 08h = DMA overrun\n"
  191.                 " 09h = DMA attempt over 64K bound\n"
  192.                 " 0Ah = bad sector flag\n"
  193.                 " 0Bh = removed bad track\n"
  194.                 " 0Dh = wrong # of sectors, format\n"
  195.                 " 0Eh = removed control data addr\n"
  196.                 "        mark\n"
  197.                 " 0Fh = out of limit DMA\n"
  198.                 "        arbitration level\n"
  199.                 " 10h = bad CRC or ECC, disk read\n"
  200.                 " 11h = bad ECC corrected data\n"
  201.                 " 20h = controller failure\n"
  202.                 " 40h = seek failure\n"
  203.                 " 80h = timeout, no response\n"
  204.                 " AAh = not ready\n"
  205.                 " BBh = error occurred, undefined\n"
  206.                 " CCh = write error, selected dsk\n"
  207.                 " E0h = error register = 0\n"
  208.                 " FFh = disk sense failure");
  209.  CB(0x075,"hdsk_count",        "Number of hard disk drives");
  210.  CB(0x076,"hdsk_head_ctrl",    "Head control (XT only)");
  211.  CB(0x077,"hdsk_ctrl_port",    "Hard disk control port (XT only)");
  212.  CB(0x078,"prn_timeout_1",    "Countdown timer waits for printer\n"
  213.                 "  to respond (printer 1)");
  214.  CB(0x079,"prn_timeout_2",    "Countdown timer waits for printer\n"
  215.                 "  to respond (printer 2)");
  216.  CB(0x07A,"prn_timeout_3",    "Countdown timer waits for printer\n"
  217.                 "  to respond (printer 3)");
  218.  CB(0x07B,"prn_timeout_4",    "Countdown timer waits for printer\n"
  219.                 "  to respond (printer 4)");
  220.  CB(0x07C,"rs232_timeout_1",    "Countdown timer waits for RS-232 (1)");
  221.  CB(0x07D,"rs232_timeout_2",    "Countdown timer waits for RS-232 (2)");
  222.  CB(0x07E,"rs232_timeout_3",    "Countdown timer waits for RS-232 (3)");
  223.  CB(0x07F,"rs232_timeout_4",    "Countdown timer waits for RS-232 (4)");
  224.  CW(0x080,"keybd_begin",    "Ptr to beginning of keybd queue");
  225.  CW(0x082,"keybd_end",        "Ptr to end of keyboard queue");
  226.  CB(0x084,"video_rows",        "Rows of characters on display - 1");
  227.  CW(0x085,"video_pixels",    "Number of pixels per charactr * 8");
  228.  CB(0x087,"video_options",    "Display adapter options\n"
  229.                 "  bit 7 = clear RAM\n"
  230.                 "  bits 6,5 = memory on adapter\n"
  231.                 "              00 - 64K\n"
  232.                 "              01 - 128K\n"
  233.                 "              10 - 192K\n"
  234.                 "              11 - 256K\n"
  235.                 "  bit 4 = unused\n"
  236.                 "  bit 3 = 0 if EGA/VGA active\n"
  237.                 "  bit 2 = wait for display enable\n"
  238.                 "  bit 1 = 1 - mono monitor\n"
  239.                 "        = 0 - color monitor\n"
  240.                 "  bit 0 = 0 - handle cursor, CGA");
  241.  CB(0x088,"video_switches",    "Switch setting bits from adapter\n"
  242.                 "  bits 7-4 = feature connector\n"
  243.                 "  bits 3-0 = option switches");
  244.  CB(0x089,"video_1_save",    "Video save area 1-EGA/VGA control\n"
  245.                 "  bit 7 = 200 line mode\n"
  246.                 "  bits 6,5 = unused\n"
  247.                 "  bit 4 = 400 line mode\n"
  248.                 "  bit 3 = no palette load\n"
  249.                 "  bit 2 = mono monitor\n"
  250.                 "  bit 1 = gray scale\n"
  251.                 "  bit 0 = unused");
  252.  CB(0x08A,"video_2_save",    "Video save area 2");
  253.  
  254.  CB(0x08B,"dsk_data_rate",    "Last data rate for diskette\n"
  255.                 " bits 7 & 6 = 00 for 500K bit/sec\n"
  256.                 "            = 01 for 300K bit/sec\n"
  257.                 "            = 10 for 250K bit/sec\n"
  258.                 "            = 11 for 1M bit/sec\n"
  259.                 " bits 5 & 4 = step rate"
  260.                 "Rate at start of operation\n"
  261.                 " bits 3 & 2 = 00 for 500K bit/sec\n"
  262.                 "            = 01 for 300K bit/sec\n"
  263.                 "            = 10 for 250K bit/sec\n"
  264.                 "            = 11 for 1M bit/sec");
  265.  CB(0x08C,"hdsk_status_2",    "Hard disk status");
  266.  CB(0x08D,"hdsk_error",        "Hard disk error");
  267.  CB(0x08E,"hdsk_complete",    "When the hard disk controller's\n"
  268.                 " task is complete, this byte is\n"
  269.                 " set to FFh (from interrupt 76h)");
  270.  CB(0x08F,"dsk_options",    "Diskette controller information\n"
  271.                 " bit 6 = 1 Drv 1 type determined\n"
  272.                 "     5 = 1 Drv 1 is multi-rate\n"
  273.                 "     4 = 1 Drv 1 change detect\n"
  274.                 "     2 = 1 Drv 0 type determined\n"
  275.                 "     1 = 1 Drv 0 is multi-rate\n"
  276.                 "     0 = 1 Drv 0 change detect");
  277.  CB(0x090,"dsk0_media_st",    "Media state for diskette drive 0\n"
  278.                 "    7      6      5      4\n"
  279.                 " data xfer rate  two   media\n"
  280.                 "  00=500K bit/s  step  known\n"
  281.                 "  01=300K bit/s\n"
  282.                 "  10=250K bit/s\n"
  283.                 "  11=1M bit/sec\n"
  284.                 "    3      2      1      0\n"
  285.                 " unused  -----state of drive-----\n"
  286.                 "         bits floppy  drive state\n"
  287.                 "         000=  360K in 360K, ?\n"
  288.                 "         001=  360K in 1.2M, ?\n"
  289.                 "         010=  1.2M in 1.2M, ?\n"
  290.                 "         011=  360K in 360K, ok\n"
  291.                 "         100=  360K in 1.2M, ok\n"
  292.                 "         101=  1.2M in 1.2M, ok\n"
  293.                 "         111=  720K in 720K, ok\n"
  294.                 "           or 1.44M in 1.44M\n"
  295.                 "        (state not used for 2.88)");
  296.  CB(0x091,"dsk1_media_st",    "Media state for diskette drive 1\n"
  297.                 " (see dsk0_media_st)");
  298.  CB(0x092,"dsk0_start_st",    "Starting state for drive 0");
  299.  CB(0x093,"dsk1_start_st",    "Starting state for drive 1");
  300.  CB(0x094,"dsk0_cylinder",    "Current track number for drive 0");
  301.  CB(0x095,"dsk1_cylinder",    "Current track number for drive 1");
  302.  CB(0x096,"keybd_flags_3",    "Special keyboard type and mode\n"
  303.                 " bit 7 Reading ID of keyboard\n"
  304.                 "     6 last char is 1st ID char\n"
  305.                 "     5 force num lock\n"
  306.                 "     4 101/102 key keyboard\n"
  307.                 "     3 right alt key down\n"
  308.                 "     2 right ctrl key down\n"
  309.                 "     1 E0h hidden code last\n"
  310.                 "     0 E1h hidden code last");
  311.  CB(0x097,"keybd_flags_4",    "Keyboard Flags (advanced keybd)\n"
  312.                 "  7      6       5     4  3 2 1 0\n"
  313.                 "xmit   char   Resend  Ack   \   /\n"
  314.                 "error was ID  Rec'd  Rec'd   LEDs");
  315.  
  316.  CW(0x098,"timer_waitoff",    "Ptr offset to wait done flag");
  317.  CW(0x09A,"timer_waitseg",    "Ptr segment to wait done flag");
  318.  CW(0x09C,"timer_clk_low",    "Timer low word, 1 microsecond clk");
  319.  CW(0x09E,"timer_clk_high",    "Timer high word");
  320.  CB(0x0A0,"timer_clk_flag",    "Timer flag 00h = post acknowledgd\n"
  321.                 "           01h = busy\n"
  322.                 "           80h = posted");
  323.  CB(0x0A1,"lan_bytes",        "Local area network bytes (7)");
  324.  MakeArray([0x40,0xA1],7);
  325.  
  326.  CD(0x0A8,"video_sav_tbl",    "Pointer to a save table of more\n"
  327.                 "pointers for the video system \n"
  328.                 "           SAVE TABLE\n"
  329.                 " offset type    pointer to\n"
  330.                 " ────── ──── ────────────────────\n"
  331.                 "   0     dd  Video parameters\n"
  332.                 "   4     dd  Parms save area\n"
  333.                 "   8     dd  Alpha char set\n"
  334.                 "  0Ch    dd  Graphics char set\n"
  335.                 "  10h    dd  2nd save ptr table\n"
  336.                 "  14h    dd  reserved (0:0)\n"
  337.                 "  18h    dd  reserved (0:0)\n"
  338.                 " \n"
  339.                 " 2ND SAVE TABLE (from ptr above)\n"
  340.                 " offset type functions & pointers\n"
  341.                 " ────── ──── ────────────────────\n"
  342.                 "   0     dw  Bytes in this table\n"
  343.                 "   2     dd  Combination code tbl\n"
  344.                 "   6     dd  2nd alpha char set\n"
  345.                 "  0Ah    dd  user palette tbl\n"
  346.                 "  0Eh    dd  reserved (0:0)\n"
  347.                 "  12h    dd  reserved (0:0)\n"
  348.                 "  16h    dd  reserved (0:0)");
  349.  CW(0x0CE,"days_since1_80",    "Days since 1-Jan-1980 counter");
  350.  MakeArray(0x4AC,0xCE-0xAC);
  351. }
  352.  
  353. //-------------------------------------------------------------------------
  354. static main() {
  355.   SegCreate(0x400,0x4D0,0x40,0,0,2);
  356.   SegRename(0x400,"bdata");
  357.   SegClass(0x400,"BIOSDATA");
  358.   CmtBdata();
  359. }
  360.