亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产在线精品一区二区夜色| 青青青伊人色综合久久| 狠狠色丁香九九婷婷综合五月 | 一区二区三区在线观看视频 | 一区二区久久久久| 日韩午夜激情视频| 国产揄拍国内精品对白| 日韩一区国产二区欧美三区| jiyouzz国产精品久久| 蜜臀av一区二区在线免费观看| 久久免费精品国产久精品久久久久| 制服丝袜在线91| 国产乱子伦视频一区二区三区 | 日韩毛片精品高清免费| 一区二区三区国产精品| 91热门视频在线观看| 日韩电影一二三区| 精品捆绑美女sm三区| 91丨porny丨最新| 99re成人在线| 亚洲欧洲在线观看av| 在线观看日韩国产| 一本久久a久久免费精品不卡| 色婷婷香蕉在线一区二区| 成av人片一区二区| 国产在线不卡一区| 一本大道久久精品懂色aⅴ| 国产精品亚洲午夜一区二区三区| 国产福利视频一区二区三区| 99在线精品视频| 97se狠狠狠综合亚洲狠狠| 色婷婷精品大视频在线蜜桃视频| 91精品在线观看入口| 色综合久久综合| xfplay精品久久| 国产日韩欧美一区二区三区综合| 一区二区三区日韩| 不卡av在线网| 欧美精品九九99久久| 91福利视频网站| 日韩三级高清在线| 亚洲欧洲另类国产综合| 亚洲国产精品尤物yw在线观看| 成人av资源站| 日韩一级片网站| 日韩精品高清不卡| 91丨九色porny丨蝌蚪| 欧美一区二区国产| 天天综合日日夜夜精品| 95精品视频在线| 中文字幕一区二区不卡| 国产suv精品一区二区883| 51精品视频一区二区三区| 午夜精品福利视频网站| 成人av在线看| 国产精品色哟哟| 成人激情午夜影院| 国产精品国产三级国产三级人妇| 色综合欧美在线视频区| 欧美国产成人在线| 91久久国产综合久久| 日韩国产精品久久久| 国产精品色在线观看| 色偷偷久久人人79超碰人人澡| 国产亚洲精品超碰| 91九色最新地址| 日本午夜精品视频在线观看| 欧美精品久久久久久久多人混战| 久久国产夜色精品鲁鲁99| 日韩欧美色综合| 成人免费看黄yyy456| 国产人妖乱国产精品人妖| 欧美视频三区在线播放| 韩国成人精品a∨在线观看| 欧美精品一区男女天堂| 911精品国产一区二区在线| 97精品电影院| 国产精品自在在线| 欧美国产精品专区| 国产a精品视频| 一区二区三区四区高清精品免费观看| 国产麻豆一精品一av一免费| 久久精品人人做人人爽人人| 欧美日韩视频专区在线播放| 国产精品亚洲综合一区在线观看| 亚洲韩国精品一区| 91精品国产乱码久久蜜臀| 日本道在线观看一区二区| 国产乱人伦偷精品视频免下载| 亚洲欧美日韩中文播放| 久久久精品综合| 欧美大片在线观看一区二区| 欧美日韩一卡二卡| 在线一区二区观看| 色综合色狠狠天天综合色| 在线不卡免费欧美| 色菇凉天天综合网| 亚洲制服丝袜一区| 日本一区二区三区dvd视频在线| 精品国产自在久精品国产| 中文字幕一区二区不卡| 亚洲一区二区综合| 亚洲国产aⅴ天堂久久| 国产在线精品视频| 色悠悠亚洲一区二区| 久久久久国产精品免费免费搜索| 正在播放一区二区| 精品国产伦一区二区三区观看体验| 亚洲欧美日韩电影| 一区二区三区四区在线免费观看 | 久久精品人人做| 日韩一区中文字幕| 99久久精品99国产精品| 99国产精品99久久久久久| 在线观看欧美精品| 国产精品麻豆视频| 激情欧美一区二区三区在线观看| 国产欧美精品一区二区色综合朱莉| 中文字幕在线不卡视频| 韩日欧美一区二区三区| 欧美日韩一区二区在线视频| 久久精品亚洲精品国产欧美kt∨| 日本少妇一区二区| 91精品欧美综合在线观看最新 | 99在线视频精品| 精品国产精品网麻豆系列| 蜜桃视频免费观看一区| www.日本不卡| 亚洲成a人v欧美综合天堂| 91蜜桃在线免费视频| 亚洲一区二区欧美| 精品日韩一区二区| 成人综合婷婷国产精品久久 | 亚洲免费观看高清在线观看| 老色鬼精品视频在线观看播放| 欧美精品乱码久久久久久| 亚洲一区二区三区四区在线| 欧美日韩1234| 91女厕偷拍女厕偷拍高清| 婷婷综合五月天| 成人在线视频首页| 国产精品理论在线观看| 成人做爰69片免费看网站| 亚洲高清视频在线| 国产情人综合久久777777| 91麻豆swag| 久久国产精品99精品国产| 欧美韩国日本不卡| 成人精品电影在线观看| 亚洲精品综合在线| 欧美日韩国产一二三| 欧美日韩免费高清一区色橹橹 | 亚洲一二三区在线观看| 日本精品免费观看高清观看| 日本午夜精品视频在线观看 | 国产精一区二区三区| 亚洲欧美一区二区三区极速播放| 欧美猛男超大videosgay| 亚洲一区免费观看| 国产精品成人免费| 欧美一区二区日韩一区二区| 欧美日韩1234| 日韩精品一区二区三区四区| 精品视频在线免费看| 337p亚洲精品色噜噜| 国产乱淫av一区二区三区 | 一区二区三区在线免费观看| 欧美一区二区三区白人| 51精品久久久久久久蜜臀| 欧美日韩中文国产| 欧美国产精品久久| 国产三级一区二区| 麻豆成人91精品二区三区| 久久91精品国产91久久小草| 欧美无砖砖区免费| 日韩免费看的电影| 国产午夜精品久久| 精品免费日韩av| 亚洲精品久久久蜜桃| 亚洲国产精品麻豆| 成人一级片在线观看| 欧美三级电影在线看| 欧美精品久久一区| 亚洲精品国产一区二区精华液 | 91小视频免费看| av电影在线观看一区| 欧美日韩国产美| 日韩理论电影院| 国产69精品久久久久777| 91精品欧美久久久久久动漫| 欧美久久久久免费| 精品蜜桃在线看| 久久66热re国产| 久久久国产精品麻豆| 日韩va亚洲va欧美va久久| 91啦中文在线观看| 日韩精品一区二| 激情小说亚洲一区| 日韩一区二区影院| 秋霞电影网一区二区|