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

📄 main.cpp

📁 MONA是为数不多的C++语言编写的一个很小的操作系统
💻 CPP
字号:
#include <sys/types.h>#include <monapi.h>#include <pci/Pci.h>using namespace MonAPI;#define MAIN_2#ifdef MAIN_1//Yamami FileOutputStream巊梡僥僗僩int MonaMain(List<char*>* pekoe){    //Yamami 僥僗僩儘僕僢僋    int reti;    char buf[1024];    memset(buf, 0, sizeof(buf));    sprintf(buf , "protType:%04x \n",1234);    //FileOutputStream 偺僥僗僩    FileOutputStream fos("YTEST.TXT");    printf("fileout:open=%d\n", fos.open());    reti = fos.write((byte*)buf , 512);    printf("fileout:read=%d\n", reti);    printf("fos close pre\n");    fos.close();    printf("fos close after\n");    return 0;}#endif#ifdef MAIN_2//Yamami Pci儔僀僽儔儕巊梡僥僗僩int MonaMain(List<char*>* pekoe){    PciInf *pciinfo;        //PCI儔僀僽儔儕僋儔僗偺僀儞僗僞儞僗壔    Pci* pcilib = new Pci();        pciinfo = pcilib->CheckPciExist(0x10EC,0x8029);        if(pciinfo->Exist == 0){        //僨僶僀僗偑尒偮偐傟偽丄偦偺忣曬傪昞帵        //printf("VendorName=%s\n",(const char*)pciinfo->VendorName);        //printf("DeviceName=%s\n",(const char*)pciinfo->DeviceName);        printf("DeviceNo=%d\n",pciinfo->DeviceNo);        printf("BaseAd=%x\n",pciinfo->BaseAd);        printf("IrqLine=%x\n",pciinfo->IrqLine);    }    else{        printf("Device Not Exist!! \n");    }            pciinfo = pcilib->CheckPciExist(0x10AA,0x80AA);        if(pciinfo->Exist == 0){        //僨僶僀僗偑尒偮偐傟偽丄偦偺忣曬傪昞帵        //printf("VendorName=%s\n",(const char*)pciinfo->VendorName);        //printf("DeviceName=%s\n",(const char*)pciinfo->DeviceName);        printf("DeviceNo=%d\n",pciinfo->DeviceNo);        printf("BaseAd=%x\n",pciinfo->BaseAd);        printf("IrqLine=%x\n",pciinfo->IrqLine);    }    else{        printf("Device Not Exist!! \n");    }        return 0;}#endif

⌨️ 快捷键说明

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