⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orig-floppy.c

📁 用于汇编领域的,运用于OS的MAIN函数.基于硬件基础的源代码
💻 C
字号:
#include "hos.h"static void reset_fdc(Fdc *fdc){   unsigned int k;   volatile int irq_timeout = 0;   int irq_timeout_event;   outp(fdc->base_port + FDC_DOR, 0); // stop the motor and disable IRQ   outp(fdc->base_port + FDC_DOR, 0x0C);// re-enable IRQ/DMA   fdc-dor = 0x0C;   // resetting triggered 4 interrupts. handle them   irq_timeout_event=fd32_event_post(default_drive_params[0].int_tmout, irq_timeout_cb, (void *) &irq_timeout);void floppy_isr(void);void floppy_handler(void){    printk("in floppy handler\n");	for(;;);	outbyte(0x20, 0x20);	/* EOI to Master */	outbyte(0xA0, 0x20);	/* EOI to Slave */}void init_floppy(void){    // some fdc init here    // and setting IDT	set_intr_gate(0x25, &floppy_isr);	unmask_irq(6);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -