none
Raw Binary Compile ? RRS feed

  • Question

  • So i'm trying to write my first OS... But i can not find any tutorial, how the set up the Visual Studio's linker to generate Raw flat binaries, not PE files...
    I've tried using GCC, but since that is a very piece of useless shit, i'd rather spend some time to set up Visual Studio formy reuirements...
    So, how can I ue the VS 2013 IDE, to generate flat binaries ? From C and C++ codes, without built-in OS headers as well...
    Just a plain raw Code...
    • Edited by [HUN]Rabir Tuesday, April 7, 2015 6:53 PM
    • Moved by Tina-Shi Wednesday, April 8, 2015 8:22 AM the issue is related to the c++
    Tuesday, April 7, 2015 6:46 PM

Answers

  • "So, how can I ue the VS 2013 IDE, to generate flat binaries ? From C and C++ codes, without built-in OS headers as well..."

    That isn't possible, the VC++ compiler generates PE files and nothing else.

    It is possible to build your own OS using VC++ but the OS needs to use the PE file format for its executables (all OSes have some kind of executable format, flat binaries isn't exactly the norm).

    Additionally, it may be possible to write a tool which converts a PE file to another format. I've never tried this but if you know about assembly and executable formats I don't see why it wouldn't be possible.

    • Marked as answer by Shu 2017 Tuesday, April 21, 2015 2:46 AM
    Wednesday, April 8, 2015 8:43 AM
    Moderator
  • "Can GCC handle Visual Studio's .obj files ?"

    No idea, you'll have to ask in a GCC forum. The VC++ .obj files use the COFF format which originated in the UNIX world so I wouldn't be too surprised if GCC can read them.

    • Marked as answer by Shu 2017 Tuesday, April 21, 2015 2:46 AM
    Wednesday, April 8, 2015 9:55 AM
    Moderator

All replies

  • Hi,

    Thank you for posting in MSDN forum.

    Since this case is related to the C++, so we will move this case to the C++ forum:https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=vcgeneral , you will get better support.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 8, 2015 8:21 AM
  • "So, how can I ue the VS 2013 IDE, to generate flat binaries ? From C and C++ codes, without built-in OS headers as well..."

    That isn't possible, the VC++ compiler generates PE files and nothing else.

    It is possible to build your own OS using VC++ but the OS needs to use the PE file format for its executables (all OSes have some kind of executable format, flat binaries isn't exactly the norm).

    Additionally, it may be possible to write a tool which converts a PE file to another format. I've never tried this but if you know about assembly and executable formats I don't see why it wouldn't be possible.

    • Marked as answer by Shu 2017 Tuesday, April 21, 2015 2:46 AM
    Wednesday, April 8, 2015 8:43 AM
    Moderator
  • OOokay, so since I only have problem with the GCC Compiler, what about using VS to create the Object files... If i know right, they are still PE independent, but then use the GCC's LD command to turn them into flat binaries... Can GCC handle Visual Studio's .obj files ?
    Wednesday, April 8, 2015 9:15 AM
  • "Can GCC handle Visual Studio's .obj files ?"

    No idea, you'll have to ask in a GCC forum. The VC++ .obj files use the COFF format which originated in the UNIX world so I wouldn't be too surprised if GCC can read them.

    • Marked as answer by Shu 2017 Tuesday, April 21, 2015 2:46 AM
    Wednesday, April 8, 2015 9:55 AM
    Moderator