亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? example2.c

?? ~{S2EL~}wdm~{G}6/~}
?? C
字號:

// Example2.c -- Some ATAPI command examples

#if 0

   Some simple instructions for those of you that would like to
   compile my driver code and try it.

   1) I've always used Borland C (or C++, the driver code is plain C
   code).  One file contains a few lines of embedded ASM code.

   2) I've always used small memory model but I think the driver code
   will work with any memory mode.

   3) Here is a very small program that shows how to use the driver
   code to issue some ATAPI commands.

   This program has one optional command line parameter to specify
   the device to run on: P0, P1, S0 or S1.

#endif

#define INCL_ISA_DMA 0     // set to 1 to include ISA DMA

#define INCL_PCI_DMA 1     // set to 1 to include PCI DMA

#if INCL_ISA_DMA && INCL_PCI_DMA

   #ERROR Only one type of DMA can be included !

#endif

// begin

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>

#include "ataio.h"

unsigned char * devTypeStr[]
       = { "no device found", "unknown type", "ATA", "ATAPI" };

unsigned char cdb[16];
unsigned char far * cdbPtr;

unsigned char buffer[4096];
unsigned char far * bufferPtr;

//**********************************************

// a little function to display all the error
// and trace information from the driver

void ShowAll( void );

void ShowAll( void )

{
   unsigned char * cp;

   printf( "ERROR !\n" );

   // display the command error information
   trc_err_dump1();           // start
   while ( 1 )
   {
      cp = trc_err_dump2();   // get and display a line
      if ( cp == NULL )
         break;
      printf( "* %s\n", cp );
   }

   // display the command history
   trc_cht_dump1();           // start
   while ( 1 )
   {
      cp = trc_cht_dump2();   // get and display a line
      if ( cp == NULL )
         break;
      printf( "* %s\n", cp );
   }

   // display the low level trace
   trc_llt_dump1();           // start
   while ( 1 )
   {
      cp = trc_llt_dump2();   // get and display a line
      if ( cp == NULL )
         break;
      printf( "* %s\n", cp );
   }

   // now clear the command history and low level traces
   trc_cht_dump0();     // zero the command history
   trc_llt_dump0();     // zero the low level trace
}

//**********************************************

int main( int ac, char * av[] )
{
   int base = 0x1f0;
   int intnum = 14;
   int dev = 0;
   int numDev;
   int rc;
   int ndx;

   printf( "EXAMPLE2 Version " ATA_DRIVER_VERSION ".\n" );

   // initialize far pointer to the I/O buffers
   bufferPtr = (unsigned char far *) buffer;
   cdbPtr = (unsigned char far *) cdb;

   // process command line parameter
   if ( ac > 1 )
   {
      if ( ! strnicmp( av[1], "p0", 2 ) )
         /* do nothing */ ;
      else
      if ( ! strnicmp( av[1], "p1", 2 ) )
         dev = 1;
      else
      if ( ! strnicmp( av[1], "s0", 2 ) )
      {
         base = 0x170;
         intnum = 15;
      }
      else
      if ( ! strnicmp( av[1], "s1", 2 ) )
      {
         base = 0x170;
         intnum = 15;
         dev = 1;
      }
      else
      {
         printf( "\nInvalid command line parameter !\n" );
         return 1;
      }
   }

   // 1) must tell the driver what the I/O port addresses.
   //    note that the driver also supports all the PCMCIA
   //    PC Card modes (I/O and memory).
   pio_set_iobase_addr( base, base + 0x200 );
   printf( "\nUsing I/O base addresses %03X and %03X with IRQ %d.\n",
           base, base + 0x200, intnum );

   // 2) find out what devices are present -- this is the step
   // many driver writers ignore.  You really can't just do
   // resets and commands without first knowing what is out there.
   // Even if you don't care the driver does care.
   numDev = reg_config();
   printf( "\nFound %d devices on this ATA interface:\n", numDev );
   printf( "   Device 0 type is %s.\n", devTypeStr[ reg_config_info[0] ] );
   printf( "   Device 1 type is %s.\n", devTypeStr[ reg_config_info[1] ] );
   printf( "\nDevice %d is the selected device for this run...\n", dev );

   // turn on the ~100ms delay for atapi devices
   reg_atapi_delay_flag = 1;

   // that's the basics, now do some stuff in polling mode
   // (see example1.c for interrupt mode use)

   // do an ATA soft reset (SRST) and return the command block
   // regs for device 0 in struct reg_cmd_info
   printf( "Soft Reset...\n" );
   rc = reg_reset( 0, dev );
   if ( rc )
      ShowAll();

   // do an ATAPI Identify command in LBA mode
   printf( "ATAPI Identify, polling...\n" );
   memset( buffer, 0, sizeof( buffer ) );
   rc = reg_pio_data_in_lba(
               dev, CMD_IDENTIFY_DEVICE_PACKET,
               0, 0,
               0L,
               FP_SEG( bufferPtr ), FP_OFF( bufferPtr ),
               1, 0 );
   if ( rc )
      ShowAll();
   else
   {
      // you get to add the code here to display the ID data
   }

   // do an ATAPI Request Sense command and display some of the data
   printf( "ATAPI Request Sense, polling...\n" );
   memset( cdb, 0, sizeof( cdb ) );
   cdb[0] = 0x03;    // RS command code
   cdb[4] = 32;      // allocation length
   memset( buffer, 0, sizeof( buffer ) );
   rc = reg_packet(
               dev,
               12, FP_SEG( cdbPtr ), FP_OFF( cdbPtr ),
               0,
               4096, FP_SEG( bufferPtr ), FP_OFF( bufferPtr )
               );
   if ( rc )
      ShowAll();
   else
   {
      // here I'll give you some help -- lets look at the RS data
      // first a problem with ATAPI device: how much data was
      // really transferred?  You can never really be sure...
      if ( reg_cmd_info.totalBytesXfer != ( 8U + buffer[7] ) )
         printf( "Number of bytes transferred (%ld) does not match \n"
                 "8 + byte 7 in the RS data received (%u) ! \n",
                 reg_cmd_info.totalBytesXfer,
                 8U + buffer[7] );
      // display some of the RS data
      printf( "Error code=%02X, Sense Key=%02X, ASC=%02X, ASCQ=%02X\n",
              buffer[0], buffer[2] & 0x0f, buffer[12], buffer[13] );
   }

   // do an ATAPI Read TOC command and display the TOC data
   printf( "ATAPI CD-ROM Read TOC, polling...\n" );
   memset( cdb, 0, sizeof( cdb ) );
   cdb[0] = 0x43;    // command code
   cdb[1] = 0x02;    // MSF flag
   cdb[7] = 0x10;    // allocation length
   cdb[8] = 0x00;    //    of 4096
   cdb[9] = 0x80;    // TOC format
   memset( buffer, 0, sizeof( buffer ) );
   rc = reg_packet(
               dev,
               12, FP_SEG( cdbPtr ), FP_OFF( cdbPtr ),
               0,
               4096, FP_SEG( bufferPtr ), FP_OFF( bufferPtr )
               );
   if ( rc )
      ShowAll();
   else
   {
      // and here too I'll give you some help looking at the TOC data
      // again, check the number of bytes transferred (notice
      // how every SCSI like command is different here?
      if ( reg_cmd_info.totalBytesXfer
           !=
           ( 2U + ( buffer[0] * 256U ) + buffer[1] )
         )
         printf( "Number of bytes transferred (%ld) does not match \n"
                 "2 + bytes 0-1 in the TOC data received (%u) ! \n",
                 reg_cmd_info.totalBytesXfer,
                 2U + ( buffer[0] * 256U ) + buffer[1] );
      // display the TOC data
      printf( "First Session=%02X, Last Session=%02X\n",
               buffer[2], buffer[3] );
      printf( "TOC entries (11 bytes each)... \n" );
      rc = ( ( buffer[0] * 256U ) + buffer[1] - 2U ) / 11;
      ndx = 4;
      while ( rc > 0 )
      {
         printf( "   %02X %02X %02X "
                    "%02X %02x %02X "
                    "%02X %02X %02X "
                    "%02X %02x \n",
                     buffer[ndx+0], buffer[ndx+1], buffer[ndx+2],
                     buffer[ndx+3], buffer[ndx+4], buffer[ndx+5],
                     buffer[ndx+6], buffer[ndx+7], buffer[ndx+8],
                     buffer[ndx+9], buffer[ndx+10], buffer[ndx+11]
               );
         rc -- ;
         ndx = ndx + 11;
      }
   }

#if INCL_ISA_DMA

   // If you set INCL_ISA_DMA to 1 AND you have read the Driver
   // User's Guide AND you have an ISA bus ATA host adapter with
   // the two additional wires installed (for DMARQ and DMACK), then
   // you can have fun with the following...

   // You MUST config the DMA channel to use.  Only
   // ISA DMA channels 5, 6 or 7 can be used and your ISA
   // ATA host adapter MUST be setup to use the selected
   // channel.  Lets use channel 6.

   rc = dma_isa_config( 6 );
   if ( rc )
      printf( "ERROR !  Call to dma_isa_config() failed!\n" );
   else
   {
      // do an ATAPI Read TOC command and display the TOC data
      // but do it in DMA mode
      printf( "ATAPI CD-ROM Read TOC in DMA, polling...\n" );
      memset( cdb, 0, sizeof( cdb ) );
      cdb[0] = 0x43;    // command code
      cdb[1] = 0x02;    // MSF flag
      cdb[7] = 0x10;    // allocation length
      cdb[8] = 0x00;    //    of 4096
      cdb[9] = 0x80;    // TOC format
      memset( buffer, 0, sizeof( buffer ) );
      rc = dma_isa_packet(
                  dev,
                  12, FP_SEG( cdbPtr ), FP_OFF( cdbPtr ),
                  0,
                  4096, FP_SEG( bufferPtr ), FP_OFF( bufferPtr )
                  );
      if ( rc )
         ShowAll();
      else
      {
         // and here too I'll give you some help looking at the TOC data
         // again, check the number of bytes transferred (notice
         // how every SCSI like command is different here?
         if ( reg_cmd_info.totalBytesXfer
              !=
              ( 2U + ( buffer[0] * 256U ) + buffer[1] )
            )
            printf( "Number of bytes transferred (%ld) does not match \n"
                    "2 + bytes 0-1 in the TOC data received (%u) ! \n",
                    reg_cmd_info.totalBytesXfer,
                    2U + ( buffer[0] * 256U ) + buffer[1] );
         // display the TOC data
         printf( "First Session=%02X, Last Session=%02X\n",
                  buffer[2], buffer[3] );
         printf( "TOC entries (11 bytes each)... \n" );
         rc = ( ( buffer[0] * 256U ) + buffer[1] - 2U ) / 11;
         ndx = 4;
         while ( rc > 0 )
         {
            printf( "   %02X %02X %02X "
                       "%02X %02x %02X "
                       "%02X %02X %02X "
                       "%02X %02x \n",
                        buffer[ndx+0], buffer[ndx+1], buffer[ndx+2],
                        buffer[ndx+3], buffer[ndx+4], buffer[ndx+5],
                        buffer[ndx+6], buffer[ndx+7], buffer[ndx+8],
                        buffer[ndx+9], buffer[ndx+10], buffer[ndx+11]
                  );
            rc -- ;
            ndx = ndx + 11;
         }
      }
   }

#endif

#if INCL_PCI_DMA

   // If you set INCL_PCI_DMA to 1 AND you have read the Driver
   // User's Guide AND you have an PCI bus ATA host adapter and
   // you must know the I/O address of the Bus Master Control
   // Registers (BMCR or SFF-8038) registers. This address is
   // found by scanning all the PCI bus devices and finding the
   // ATA host adapter you want to use. The BMCR I/O address
   // is at offset 20H of the PCI configuration space for the
   // ATA host adapter.

   #define BMCR_IO_ADDR 0xFF00   // YOU MUST SUPPLY THIS VALUE

   // first, tell the driver where the BMCR is located.

   rc = dma_pci_config( BMCR_IO_ADDR );
   if ( rc )
   {
      printf( "ERROR !  Call to dma_pci_config() failed,\n" );
      printf( "         dma_pci_config() returned %d!\n", rc );
   }
   else
   {
      // do an ATAPI Read TOC command and display the TOC data
      // but do it in DMA mode
      printf( "ATAPI CD-ROM Read TOC in DMA, polling...\n" );
      memset( cdb, 0, sizeof( cdb ) );
      cdb[0] = 0x43;    // command code
      cdb[1] = 0x02;    // MSF flag
      cdb[7] = 0x10;    // allocation length
      cdb[8] = 0x00;    //    of 4096
      cdb[9] = 0x80;    // TOC format
      memset( buffer, 0, sizeof( buffer ) );
      rc = dma_pci_packet(
                  dev,
                  12, FP_SEG( cdbPtr ), FP_OFF( cdbPtr ),
                  0,
                  4096, FP_SEG( bufferPtr ), FP_OFF( bufferPtr )
                  );
      if ( rc )
         ShowAll();
      else
      {
         // and here too I'll give you some help looking at the TOC data
         // again, check the number of bytes transferred (notice
         // how every SCSI like command is different here?
         if ( reg_cmd_info.totalBytesXfer
              !=
              ( 2U + ( buffer[0] * 256U ) + buffer[1] )
            )
            printf( "Number of bytes transferred (%ld) does not match \n"
                    "2 + bytes 0-1 in the TOC data received (%u) ! \n",
                    reg_cmd_info.totalBytesXfer,
                    2U + ( buffer[0] * 256U ) + buffer[1] );
         // display the TOC data
         printf( "First Session=%02X, Last Session=%02X\n",
                  buffer[2], buffer[3] );
         printf( "TOC entries (11 bytes each)... \n" );
         rc = ( ( buffer[0] * 256U ) + buffer[1] - 2U ) / 11;
         ndx = 4;
         while ( rc > 0 )
         {
            printf( "   %02X %02X %02X "
                       "%02X %02x %02X "
                       "%02X %02X %02X "
                       "%02X %02x \n",
                        buffer[ndx+0], buffer[ndx+1], buffer[ndx+2],
                        buffer[ndx+3], buffer[ndx+4], buffer[ndx+5],
                        buffer[ndx+6], buffer[ndx+7], buffer[ndx+8],
                        buffer[ndx+9], buffer[ndx+10], buffer[ndx+11]
                  );
            rc -- ;
            ndx = ndx + 11;
         }
      }
   }

#endif

   return 0;
}

// end example2.c

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女久久久久aⅴ国产馆| 亚洲一区二区三区中文字幕在线 | 奇米影视7777精品一区二区| 综合激情成人伊人| 蜜桃精品视频在线| 色婷婷av一区| 国产精品青草综合久久久久99| 久久久久久久久免费| 亚洲在线视频网站| 97精品久久久久中文字幕| 欧美电影免费观看高清完整版| 日韩精品在线看片z| 亚洲精品欧美在线| 成人avav影音| 国产日韩av一区二区| 欧美a一区二区| 欧美欧美欧美欧美首页| 亚洲日本乱码在线观看| 亚洲人成亚洲人成在线观看图片| 伊人夜夜躁av伊人久久| 成人免费视频国产在线观看| 久久网这里都是精品| 美国十次了思思久久精品导航| 国产一区二区三区黄视频| 日韩视频一区二区三区| 天堂成人免费av电影一区| 精品综合久久久久久8888| 欧美电影影音先锋| 亚洲不卡在线观看| 欧美婷婷六月丁香综合色| 欧美变态凌虐bdsm| 老司机一区二区| 99久久综合国产精品| 国产精品美女久久久久久久久久久| 一区二区三区精品在线| 日韩精品高清不卡| 欧美蜜桃一区二区三区| 日韩高清在线一区| 欧美一级片在线看| 极品销魂美女一区二区三区| 91丨porny丨蝌蚪视频| 国产精品午夜免费| 视频一区视频二区中文| 91精品国产欧美一区二区18| 国产精品国产三级国产普通话99| 亚洲高清免费在线| 91麻豆精品国产91久久久更新时间| 中文字幕不卡的av| 免费成人你懂的| 色综合咪咪久久| 午夜不卡av在线| 精品国产乱码久久久久久久| 国产v日产∨综合v精品视频| 日韩一区二区精品在线观看| 国产精一品亚洲二区在线视频| 欧美日韩国产中文| 国产一区 二区 三区一级| 中文字幕的久久| 国产精品亚洲а∨天堂免在线| 欧美三片在线视频观看| 久久er99精品| 成人欧美一区二区三区| 国产东北露脸精品视频| 亚洲男人的天堂一区二区| 91精品国产黑色紧身裤美女| 国产乱子伦视频一区二区三区| 日韩一本二本av| 成人不卡免费av| 婷婷久久综合九色国产成人| 国产亚洲精品久| 欧美绝品在线观看成人午夜影视| 亚洲影视资源网| 欧美精品一区二| 欧美视频一区二区在线观看| 一区二区免费在线| 久久久久久亚洲综合影院红桃| 国产中文一区二区三区| 一区二区三区高清| 欧洲激情一区二区| 国产一区二区精品久久91| 久久综合丝袜日本网| 欧美日韩久久一区| 成人手机电影网| 国内精品视频666| 婷婷六月综合网| 亚洲欧美日韩系列| 国产欧美日韩不卡| 日韩亚洲欧美成人一区| 精品一区二区三区免费毛片爱| 337p粉嫩大胆色噜噜噜噜亚洲| 国产一区二区三区日韩| 国产精品女主播在线观看| 欧美sm极限捆绑bd| 欧美日韩卡一卡二| 久久机这里只有精品| 性欧美疯狂xxxxbbbb| 综合久久给合久久狠狠狠97色| 91成人国产精品| 99精品视频在线观看免费| 国产一区二区免费看| 久久国产成人午夜av影院| 强制捆绑调教一区二区| 婷婷国产在线综合| 国产欧美一区二区精品忘忧草| 成人毛片在线观看| 丁香桃色午夜亚洲一区二区三区| 国产精品伦一区| 国产精品区一区二区三区| 国产欧美日韩久久| 欧美男男青年gay1069videost| 另类欧美日韩国产在线| 国产精品美女久久久久高潮| 欧美激情一区三区| 欧美日韩性生活| 欧美猛男超大videosgay| 欧美人成免费网站| 7777精品伊人久久久大香线蕉的 | 91精品国产一区二区人妖| 久久99精品久久久| 亚洲欧美偷拍另类a∨色屁股| 91精品国产综合久久香蕉麻豆| 国产成人亚洲综合a∨婷婷图片| 亚洲丝袜精品丝袜在线| 日韩一区二区三区免费观看| 欧美一级片免费看| 欧美精品一区二区高清在线观看| 91日韩在线专区| 欧美在线视频日韩| 国产精品中文字幕日韩精品 | 久久这里只有精品首页| 久久综合九色综合欧美就去吻 | 成人免费观看av| 青青国产91久久久久久| 一区二区视频在线看| 亚洲国产精品久久久久婷婷884| 久久久夜色精品亚洲| 国产午夜精品一区二区三区四区| 欧美美女黄视频| 精品久久人人做人人爱| 欧美国产精品中文字幕| 日韩亚洲国产中文字幕欧美| 国产亚洲人成网站| 亚洲美女免费视频| 麻豆91在线播放免费| 不卡的av在线| 91精品国产黑色紧身裤美女| 亚洲国产激情av| 久久人人97超碰com| 欧美一级在线观看| 国产精品久久久久三级| 性久久久久久久久| 丰满放荡岳乱妇91ww| 国产伦精品一区二区三区在线观看 | 成人sese在线| 丁香六月久久综合狠狠色| 欧美在线看片a免费观看| 精品美女被调教视频大全网站| 欧美日韩国产中文| 国产精品三级av| 久久精品国产99久久6| 色噜噜狠狠成人中文综合 | 成人免费高清在线| 国产一区二区三区久久久| 狠狠色狠狠色综合| 久久成人18免费观看| 久久99精品国产麻豆婷婷| 一本久久综合亚洲鲁鲁五月天 | 风间由美一区二区三区在线观看| 久久av资源网| 国产呦萝稀缺另类资源| 欧美日韩精品专区| 欧美一区二区在线播放| 亚洲欧美一区二区三区国产精品| 亚洲免费在线看| 国产91丝袜在线播放九色| 从欧美一区二区三区| 日韩欧美中文一区| 日韩精品国产精品| 国产一区二区网址| 日韩视频免费直播| 亚洲电影视频在线| 日本韩国精品在线| 中文av字幕一区| 成人亚洲一区二区一| 精品国产91九色蝌蚪| 青青青爽久久午夜综合久久午夜| 精品一区精品二区高清| 在线不卡免费av| 亚洲成人资源网| 欧美午夜精品久久久久久超碰| 欧美一三区三区四区免费在线看 | 久久久天堂av| 丝袜a∨在线一区二区三区不卡| 韩国v欧美v亚洲v日本v| 欧美一区二区三区人| 日韩电影在线一区二区| 日韩一区二区精品| 久久91精品国产91久久小草| 成人午夜在线视频| 欧美日韩国产片|