OK - you are using C, so firstly, make sure you are using a C compiler *which supports 16 bit code* (not GCC). You will either need to specify a command-line option or use a linker (like LD), to link at 0x1000. A linker script may have code like:
Code:
ENTRY(__main);
phys = 0x1000;
SECTIONS
{
.text phys : AT(phys) {
...
...
}
or something similar. You will have to know the specific command line option / script command for the 16 bit toolchain you are using.
The code output by your compiler is not position-independant. This means that the binary has to know where it is expecting to be loaded in memory. That's why you need to specify this value. Your exe loader needs to honour the expected entry point in order for the code to work.
I know this is probably extremely hypocritical of me
, but I think you really need to know more about your chosen toolchain before attempting to develop an OS in it. There is normally a manual (online or otherwise) for the compiler which will explain what command switches do.
Granted - these online references can be a bit cryptic at times!
Cheers,
Adam