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://www.ptt.cc/bbs/CompilerDev/M.1604025251.A.8AA.html