作者descent (「雄辩是银,沉默是金」)
看板CompilerDev
标题Re: [分享] How to build DOS COM files with GCC
时间Fri Oct 30 10:33:58 2020
https://github.com/descent/simple_os/tree/cpp_runtime/cpp_runtime/global_object/dos_cpp
我有用过类似方式, 还可以使用 c++17 的功能,
自己补上 c/c++ runtime, 可以使用 gcc/g++ 编译出 dos com 档案,
也在真实机器 dos 上测试过
make reloc.bin 有所有编译指令
这个其实有点 bare-metal 的味道, gcc 提供的 c library 通通都不能用,
所以我有准备类似 itoa 这种函式
程式只能有 64k 大小, 因为 com 的关系, 不过对 bare-metal 程式来说,
64k 算是蛮大了
※ 引述《enthos (影斯作业系统)》之铭言:
: 之前意外看到的 gcc 特殊应用。
: https://nullprogram.com/blog/2014/12/09/
: "The most technically interesting part is that I didn’t need
: any DOS development tools to create this!"
--
纸上得来终觉浅,绝知此事要躬行。
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 61.218.53.138 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/CompilerDev/M.1604025251.A.8AA.html