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

📄 make_pyos_kernel.cpp

📁 纯C论坛·电子杂志·2004.10期.SP1(总第1期)SP1
💻 CPP
字号:
/******************************************************************************************
* 辅助文件,用来将编译后得到的独立文件链接成一个 1.44M 的 img 映象文件
* 编写:谢煜波
* email:xieyubo@126.com
* 使用方法
* make_pyos_kernel 映象文件名 第一个被链接的文件 第二个被链接的文件 第三个被链接的文件 ...
*******************************************************************************************/

#include <fstream>
#include <cstdlib>
#include <iostream>

using namespace std ;

int main( int argc , char** argv )
{
  char ch ;
  argv++ ;
  unsigned int count = 0 ;
  if( argc == 1 ){
    cout << "make_pyos_kernel objfile sourcefile1 sourcefile2 ..." << endl ;
  }
  else{
	  ofstream outfile( *argv++ , ios_base::binary ) ;
    for( int i = 2 ; i < argc ; ++i ){
      ifstream infile( *argv++ ) ;
      while( infile.get( ch ) ){
        outfile.put( ch ) ;
        count++ ;
      }      
      infile.close() ;
    }
    ch = 0 ;
    while( count++ != 1474560 ){
      outfile.put( ch ) ;
    }
    outfile.close() ;
  }
}

⌨️ 快捷键说明

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