I want to create a 16bit OS in C++.
Which parameter do i need for g++ (under linux) to create a bootable 16bit image?
thank you very much for you help

While GAS is capable of generating 16 bit code if you know exactly what you're doing as even .code16 doesn't guarantee your code will run on a 286, it's a different ballgame when you're using it in the GCC - GAS - LD toolchain.jinksys wrote: gcc/gas provides the .code16, .code16gcc directives for producing 16 bit
code.
So, no luck in making G++ spit out 16bit code I'm afraid..code16gcc provides experimental support for generating 16-bit code from gcc, and differs from .code16 in that call, ret, enter, leave, push, pop, pusha, popa, pushf, and popf instructions default to 32-bit size. This is so that the stack pointer is manipulated in the same way over function calls, allowing access to function parameters at the same stack offsets as in 32-bit mode. .code16gcc also automatically adds address size prefixes where necessary to use the 32-bit addressing modes that gcc generates.