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

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

?? old-fdc.c

?? 用于匯編領域的,運用于OS的MAIN函數.基于硬件基礎的源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
        }        else res = FDC_ERROR; /* Seek error */        if (tries != 2) recalibrate(fdd); /* Error, try again... */    }    /* Copy data from the DMA buffer into the caller's buffer */    if ((res == FDC_OK) && buffer)        fd32_memcpy_from_lowmem(buffer, dma_sel, 0, 512 * num_sectors);    motor_down(fdd);    busy = 0;    return res;}/* Writes sectors to the floppy, up to the end of the cylinder. */int fdc_write(Fdd *fdd, const Chs *chs, const BYTE *buffer, unsigned num_sectors){    unsigned tries;    int      res = FDC_ERROR;    if (fdd->dp->cmos_type == 0) return FDC_ERROR; /* Drive not available */    /* TODO: Place a timeout for Busy check */    while (busy); /* Wait while the floppy driver is already busy: BUSY WAIT! */    busy = 1;    motor_on(fdd);    specify(fdd);    fd32_memcpy_to_lowmem(dma_sel, 0, buffer, 512 * num_sectors);    for (tries = 0; tries < 3; tries++)    {        /* Move head to right track */        if (fdc_seek(fdd, chs->c) == FDC_OK)        {            /* If changeline is active, no disk is in drive */            if (fd32_inb(fdd->fdc->base_port + FDC_DIR) & 0x80)            {                LOG_PRINTF(("[FDC] fdc_write: no disk in drive\n"));                res = FDC_NODISK;                break;            }            res = fdc_xfer(fdd, chs, dma_addr, num_sectors, FDC_WRITE);            if (res == FDC_OK) break;        }        else res = FDC_ERROR; /* Seek error */        if (tries != 2) recalibrate(fdd); /* Error, try again... */    }    motor_down(fdd);    busy = 0;    return res;}/* Transfers data between a whole cylinder (both tracks of disk sides) and *//* and the DMA buffer, as fast as possible.                                *//* We get the current head position with READID, so we can start to        *//* transfer sectors from the first sector passing below the head. When the *//* disk completes a revolution, we finish transferring the first sectors.  *//* If buffer is NULL, the read data is discarded (may be used to probe).   */static int fdc_xfer_cylinder(Fdd *fdd, unsigned cyl, FdcTransfer op){    unsigned tries;               /* Count how many retries              */    Chs      chs = { cyl, 0, 1 }; /* Passed to fdc_xfer to read sectors  */    Chs      cur;                 /* Current position returned by READID */    unsigned sec_in_cyl;          /* Zero-based sector we start to read  */    int      res = FDC_ERROR;     /* This function's result...           */    motor_on(fdd);    specify(fdd);    for (tries = 0; tries < 3; tries++)    {        /* Move head to right track */        if (fdc_seek(fdd, cyl) == FDC_OK)        {            /* If changeline is active, no disk is in drive */            if (fd32_inb(fdd->fdc->base_port + FDC_DIR) & 0x80)            {                LOG_PRINTF(("[FDC] fdc_Xfer_cylinder: no disk in drive\n"));                res = FDC_NODISK;                break;            }            readid(fdd, &cur);            LOG_PRINTF(("[FDC] fdc_xfer_cylinder: readid=%u,%u,%u\n", cur.c, cur.h, cur.s));            /* Transfer from the current sector of head 0 to the end of cylinder */            cur.s++; /* The sector we read the Id is gone. Advance a bit */            sec_in_cyl = cur.s - 1;            if (cur.s > fdd->fmt->sec_per_trk)            {                cur.h++;                cur.s -= fdd->fmt->sec_per_trk;            }            chs.h = cur.h;            chs.s = cur.s;            LOG_PRINTF(("[FDC] fdc_xfer_cylinder: first round:%u sectors from %u\n",                        fdd->fmt->sec_per_trk * 2 - sec_in_cyl, sec_in_cyl));            res = fdc_xfer(fdd, &chs, dma_addr + 512 * sec_in_cyl,                           fdd->fmt->sec_per_trk * 2 - sec_in_cyl, op);            /* Read the first sectors, that we missed in the previous revolution */            if ((res == FDC_OK) && (sec_in_cyl > 0))            {                chs.h = 0;                chs.s = 1;                LOG_PRINTF(("[FDC] fdc_read_cylinder: second round:%u sectors from 0\n", sec_in_cyl));                res = fdc_xfer(fdd, &chs, dma_addr, sec_in_cyl, op);            }            if (res == FDC_OK) break;        }        else res = FDC_ERROR; /* Seek error */        if (tries != 2) recalibrate(fdd); /* Error, try again... */    }    motor_down(fdd);    return res;}/* Reads a whole cylinder (both tracks of disk sides) as fast as possible. *//* See fdc_xfer_cylinder for comments.                                     *//* If buffer is NULL, the read data is discarded (may be used to probe).   */int fdc_read_cylinder(Fdd *fdd, unsigned cyl, BYTE *buffer){    int res;    if (fdd->dp->cmos_type == 0) return FDC_ERROR; /* Drive not available */    /* TODO: Place a timeout for Busy check */    while (busy); /* Wait while the floppy driver is already busy: BUSY WAIT! */    busy = 1;    res = fdc_xfer_cylinder(fdd, cyl, FDC_READ);    if ((res == FDC_OK) && buffer)        fd32_memcpy_from_lowmem(buffer, dma_sel, 0, 512 * fdd->fmt->sec_per_trk * 2);    busy = 0;    return res;}/* Writes a whole cylinder (both tracks of disk sides) as fast as possible. *//* See fdc_read_cylinder for comments.                                      */int fdc_write_cylinder(Fdd *fdd, unsigned cyl, const BYTE *buffer){    int res;    if (fdd->dp->cmos_type == 0) return FDC_ERROR; /* Drive not available */    /* TODO: Place a timeout for Busy check */    while (busy); /* Wait while the floppy driver is already busy: BUSY WAIT! */    busy = 1;    fd32_memcpy_to_lowmem(dma_sel, 0, buffer, 512 * fdd->fmt->sec_per_trk * 2);    res = fdc_xfer_cylinder(fdd, cyl, FDC_WRITE);    busy = 0;    return res;}/* Ckecks for the specified disk format, by reading the last sector of the *//* last track of the last side of the specified format.                    *//* Returns zero if format is supported, or a negative value if not.        */static int probe_format(Fdd *fdd, unsigned format){    Chs chs = { 0, 0, 0 };    int res;    fdd->fmt = &floppy_formats[format];    chs.s = fdd->fmt->sec_per_trk;    res = fdc_read(fdd, &chs, NULL, 1);    LOG_PRINTF(("[FDC] probe_format: fdc_read returned %i\n", res));    if (res < 0) return res;    LOG_PRINTF(("%s format detected\n", fdd->fmt->name));    return FDC_OK;}/* Checks disk geometry. Call this after any disk change. *//* Returns 0 on success.                                  */int fdc_log_disk(Fdd *fdd){    unsigned k;    if (fdd->dp->cmos_type == 0) return FDC_ERROR; /* Drive not available */    fdd->fmt = &floppy_formats[fdd->dp->native_fmt];    reset_fdc(fdd->fdc);    reset_drive(fdd);    /* If changeline is active, no disk is in drive */    motor_on(fdd);    if (fd32_inb(fdd->fdc->base_port + FDC_DIR) & 0x80)    {        LOG_PRINTF(("[FDC] fdc_log_disk: no disk in drive\n"));        motor_down(fdd);        return FDC_NODISK;    }    fdd->flags &= ~DF_CHANGED;    for (k = 0; k < 8; k++)        if (probe_format(fdd, fdd->dp->detect[k]) == 0)        {            /* Finetune the probed format with boot sector informations */            int res = floppy_bootsector(fdd, floppy_formats, 32);            if (res >= 0) fdd->fmt = &floppy_formats[res];            return FDC_OK;        }    motor_down(fdd);    fdd->flags |= DF_CHANGED; /* Must log the disk again the next time */    return FDC_ERROR; /* If we arrive here, the autodetection failed */}/* Initializes a drive to a known state */static int setup_drive(Fdc *fdc, unsigned drive, unsigned cmos_type){    fdc->drive[drive].fdc       = fdc;    fdc->drive[drive].dp        = &default_drive_params[0];    /* No need to initialize fdc->drive[drive].fmt */    fdc->drive[drive].number    = drive;    fdc->drive[drive].flags     = 0;    fdc->drive[drive].track     = 0;    fdc->drive[drive].spin_down = -1;    if ((cmos_type > 0) && (cmos_type <= 6))    {        fd32_message("[FLOPPY] Drive %u set to %s\n", drive, default_drive_params[cmos_type].name);        fdc->drive[drive].dp        = &default_drive_params[cmos_type];        fdc->drive[drive].flags     = DF_CHANGED;    }    return FDC_OK;}#endif/* Initializes the low-level driver *///int fdc_setup(FdcSetupCallback *setup_cb)int fdc_setup(void){    unsigned k;    unsigned cmos_drive0;    unsigned cmos_drive1;    int      res;    //WORD     dma_seg, dma_off;    /* Setup IRQ and DMA */    /* TODO: Provide a way to save the old IRQ6 handler */    //fd32_irq_bind(6, irq6);    LOG_PRINTF(("IRQ6 handler installed\n"));    /* TODO: Find a decent size for the DMA buffer */    //dma_sel = fd32_dmamem_get(512 * 18 * 2, &dma_seg, &dma_off);    //if (dma_sel == 0) return FDC_ERROR; /* Unable to allocate DMA buffer */    //dma_addr = ((DWORD) dma_seg << 4) + (DWORD) dma_off;    //LOG_PRINTF(("DMA buffer allocated at physical address %08lxh\n", dma_addr));    /* Reset primary controller */    pri_fdc.base_port = FDC_BPRI;	printk("bef reset fdc\n");    reset_fdc(&pri_fdc);    sendbyte(pri_fdc.base_port, CMD_VERSION);    res = getbyte(pri_fdc.base_port);    //LOG_PRINTF(("Byte got from CMD_VERSION: %x\n", res));    printk("Byte got from CMD_VERSION: %x\n", res);	asm("int $0x25\n\t"::); // check irq 6    switch (res)    {        case 0x80: fd32_message("[FLOPPY] NEC765 FDC found on base port %x\n", pri_fdc.base_port); break;        case 0x90: fd32_message("[FLOPPY] Enhanced FDC found on base port %x\n", pri_fdc.base_port); break;        default  : fd32_message("[FLOPPY] FDC not found on base port %x\n", pri_fdc.base_port);    }   #ifdef MYFDC     /* Read floppy drives types from CMOS memory (up to two drives). */    /* They are supposed to belong to the primary FDC.               */    fd32_outb(0x70, 0x10);    k = fd32_inb(0x71);    cmos_drive0 = k >> 4;    cmos_drive1 = k & 0x0F;    setup_drive(&pri_fdc, 0, cmos_drive0);    setup_drive(&pri_fdc, 1, cmos_drive1);    for (res = FDC_OK, k = 0; k < MAXDRIVES; k++)        if (pri_fdc.drive[k].dp->cmos_type)            if (setup_cb(&pri_fdc.drive[k]) < 0) res = -1;    #ifdef HAS2FDCS    setup_drive(&sec_fdc, 0, 0);    setup_drive(&sec_fdc, 1, 0);    sec_fdc.base_port = FDC_BSEC;    reset_fdc(&sec_fdc);    for (k = 0; k < MAXDRIVES; k++)        if (setup_cb(&sec_fdc.drive[k]) < 0) res = -1;    #endif	#endif    return res;}#ifdef MYFDC /* Frees low-level driver resources */void fdc_dispose(void){    /* TODO: How to restore old handler? *///    fd32_irq_bind(6, &old_irq6);//    LOG_PRINTF(("IRQ6 handler uninstalled\n"));    /* TODO: Find a decent size for the DMA buffer */    fd32_dmamem_free(dma_sel, 512 * 18 * 2);    LOG_PRINTF(("DMA buffer freed\n"));    fd32_outb(pri_fdc.base_port + FDC_DOR, 0x0C); /* Stop motor forcefully */}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品美女久久久久久2018| 国产精品免费看片| 国产伦精品一区二区三区视频青涩 | 国产精品一区二区在线播放| 夜夜嗨av一区二区三区网页| 2017欧美狠狠色| 欧美美女直播网站| www.激情成人| 国产在线一区二区综合免费视频| 亚洲电影中文字幕在线观看| 久久女同性恋中文字幕| 欧美精选一区二区| 色婷婷亚洲综合| 国产成人在线免费观看| 日本亚洲三级在线| 亚洲国产日韩a在线播放 | 午夜精品久久久久久不卡8050| 国产亚洲成av人在线观看导航| 欧美丝袜第三区| 色老汉一区二区三区| 成人福利视频在线看| 久久99国产精品免费| 日韩vs国产vs欧美| 亚洲一区在线播放| 亚洲图片激情小说| 国产精品丝袜一区| 国产午夜精品久久久久久久| 欧美成人vps| 日韩精品一区二区在线| 在线成人小视频| 欧美午夜免费电影| 91久久人澡人人添人人爽欧美 | 国产精品资源在线观看| 日本成人在线一区| 亚洲亚洲精品在线观看| 亚洲午夜久久久久久久久电影网| 1024亚洲合集| 专区另类欧美日韩| ...av二区三区久久精品| 国产精品免费久久久久| 国产精品国产三级国产aⅴ无密码| 亚洲国产成人自拍| 国产午夜精品一区二区三区视频 | 国产欧美日韩另类一区| 精品国产乱码久久久久久影片| 日韩精品一区二区三区视频播放 | 综合久久久久久久| 中文字幕亚洲区| 中文字幕日韩欧美一区二区三区| 综合分类小说区另类春色亚洲小说欧美| 国产精品福利在线播放| 亚洲人成网站色在线观看| 国产精品免费av| 自拍偷拍欧美激情| 亚洲一区二区在线播放相泽 | 久久精品噜噜噜成人av农村| 久久www免费人成看片高清| 精品在线亚洲视频| 国产盗摄一区二区三区| av在线播放一区二区三区| 色先锋资源久久综合| 欧美日本一道本| 一区二区三区精品视频在线| 亚洲精品ww久久久久久p站| 亚洲综合一区二区三区| 亚洲成精国产精品女| 久久se精品一区精品二区| 成人午夜av电影| 日本韩国精品在线| 欧美一区二区视频免费观看| 久久精品夜色噜噜亚洲aⅴ| 亚洲欧美日韩在线| 午夜精品福利一区二区蜜股av| 久久成人精品无人区| 成人av午夜影院| 欧美精品一二三四| 久久噜噜亚洲综合| 亚洲天堂网中文字| 蜜臀av国产精品久久久久| 国产成人免费xxxxxxxx| 欧洲激情一区二区| 久久综合视频网| 亚洲欧美日韩一区二区三区在线观看| 日韩av在线免费观看不卡| 国产xxx精品视频大全| 欧美三级韩国三级日本一级| 久久丝袜美腿综合| 一区二区三区四区高清精品免费观看 | 国产在线国偷精品免费看| 日本伦理一区二区| 精品国产电影一区二区| 一区二区三区不卡视频| 久久99国产精品尤物| 在线亚洲+欧美+日本专区| 精品va天堂亚洲国产| 亚洲午夜免费电影| 国产大陆精品国产| 欧美日本视频在线| 中文字幕一区免费在线观看| 久久精品国产亚洲高清剧情介绍 | gogo大胆日本视频一区| 欧美一区二区成人6969| 亚洲天堂精品视频| 国产剧情一区在线| 欧美日韩dvd在线观看| 国产精品成人免费在线| 久久99久国产精品黄毛片色诱| 91福利国产成人精品照片| 国产精品五月天| 久99久精品视频免费观看| 欧美日韩一区二区在线观看视频| 国产精品久久久久aaaa樱花| 国产乱码字幕精品高清av| 7777精品伊人久久久大香线蕉经典版下载| 国产精品乱码人人做人人爱| 国产伦精一区二区三区| 91精品麻豆日日躁夜夜躁| 亚洲精品ww久久久久久p站| 成人av动漫网站| 久久精品人人爽人人爽| 麻豆国产欧美一区二区三区| 777a∨成人精品桃花网| 亚洲午夜在线观看视频在线| 色婷婷精品久久二区二区蜜臀av| 国产精品乱码一区二三区小蝌蚪| 丰满少妇久久久久久久| 久久久久国产精品麻豆| 国产久卡久卡久卡久卡视频精品| 天天色天天爱天天射综合| 色婷婷综合激情| 亚洲欧美日本在线| 91在线观看污| 自拍偷拍欧美激情| 91小视频在线| 一区二区三区在线影院| 一本久道久久综合中文字幕| 亚洲欧美在线aaa| 91在线观看一区二区| 亚洲精品国产品国语在线app| 91日韩精品一区| 一区二区欧美国产| 欧美吞精做爰啪啪高潮| 亚洲电影在线播放| 久久精品人人爽人人爽| 精品伊人久久久久7777人| 亚洲国产电影在线观看| 国产.精品.日韩.另类.中文.在线.播放 | 中文字幕在线免费不卡| 国产精一品亚洲二区在线视频| 欧美不卡在线视频| 精品中文字幕一区二区| 久久综合色播五月| 国产综合久久久久影院| 国产精品美女www爽爽爽| av中文字幕在线不卡| 亚洲免费在线播放| 欧美午夜精品久久久久久孕妇| 亚洲gay无套男同| 日韩一级完整毛片| 激情久久五月天| 国产精品免费视频网站| 在线观看亚洲一区| 日韩av电影免费观看高清完整版 | 成人精品小蝌蚪| 亚洲区小说区图片区qvod| 欧美视频在线观看一区二区| 麻豆91在线观看| 中文子幕无线码一区tr| 在线欧美小视频| 韩国女主播成人在线| 国产精品人成在线观看免费| 在线观看日韩毛片| 毛片av一区二区三区| 国产精品丝袜黑色高跟| 欧美日韩精品一区二区天天拍小说| 狠狠色狠狠色综合| 亚洲少妇中出一区| 日韩视频免费直播| av色综合久久天堂av综合| 五月激情综合网| 国产精品黄色在线观看| 欧美另类z0zxhd电影| 国产91精品久久久久久久网曝门| 亚洲综合免费观看高清完整版在线 | 日韩欧美另类在线| 波多野结衣欧美| 裸体健美xxxx欧美裸体表演| 国产精品护士白丝一区av| 欧美一区二区三区四区五区| 91女厕偷拍女厕偷拍高清| 麻豆久久一区二区| 亚洲色图制服诱惑| 久久久精品影视| 日韩一级黄色片| 欧美在线看片a免费观看| 国产精品亚洲一区二区三区妖精 | 香蕉久久一区二区不卡无毒影院| 国产日韩综合av| 91精品久久久久久久91蜜桃| 久久免费精品国产久精品久久久久|