title: How to generate 16-bit executable BINARY RAW format from C by Watcom compiler?
body: <p>I want to generate a 16-bit executable BINARY RAW format by <code>Watcom C compiler</code>. Something like an EXE file without any header that runs in Real Mode.</p>
  
  <p>I use <code>Large</code> memory model, Thus code segment and data segment may be different and can increase more than 64K bytes.</p>
  
  <p>I do like this:</p>
  
  <pre><code>// kernel.c
  void kernel(void)
  {
      /* Print Hello! */
      __asm
      {
          mov ah, 0x0E;
          mov bl, 7
  
          mov al, 'H'
          int 0x10
  
          mov al, 'e'
          int 0x10
  
          mov al, 'l'
          int 0x10
  
          mov al, 'l'
          int 0x10
  
          mov al, 'o'
          int 0x10
  
          mov al, '!'
          int 0x10
      }
      return;
  }
  </code></pre>
  
  <p>For compiling above code I run below batch file:</p>
  
  <pre><code>@rem build.bat
  
  @rem Cleaning.
  del *.obj
  del *.bin
  
  cls
  
  @rem Compiling.
  @rem 0:     8088 and 8086 instructions.
  @rem d0:    No debugging information.
  @rem ml:    The "large" memory model (big code, big data) is selected.
  @rem s:     Remove stack overflow checks.
  @rem wx:    Set the warning level to its maximum setting.
  @rem zl:    Suppress generation of library file names and references in object file.
  wcc -0 -d0 -ml -s -wx -zl kernel.c
  
  @rem Linking.
  @rem FILE:      Specify the object files.
  @rem FORMAT:    Specify the format of the executable file.
  @rem NAME:      Name for the executable file.
  @rem OPTION:    Specify options.
  @rem Note startup function (kernel_) implemented in kernel.c.
  wlink FILE kernel.obj FORMAT RAW BIN NAME kernel.bin OPTION NODEFAULTLIBS, START=kernel_
  
  del *.obj
  </code></pre>
  
  <p>After running <code>build.bat</code> the following message generated by Watcom compiler and linker:</p>
  
  <pre><code>D:\Amir-OS\ckernel&gt;wcc -0 -d0 -ml -s -wx -zl kernel.c
  Open Watcom C16 Optimizing Compiler Version 1.9
  Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
  Source code is available under the Sybase Open Watcom Public License.
  See http://www.openwatcom.org/ for details.
  kernel.c: 28 lines, included 35, 0 warnings, 0 errors
  Code size: 39
  
  D:\Amir-OS\ckernel&gt;wlink FILE kernel.obj FORMAT RAW BIN NAME kernel.bin OPTION N
  ODEFAULTLIBS, START=kernel_
  Open Watcom Linker Version 1.9
  Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
  Source code is available under the Sybase Open Watcom Public License.
  See http://www.openwatcom.org/ for details.
  loading object files
  Warning! W1014: stack segment not found
  creating a RAW Binary Image executable
  </code></pre>
  
  <p>Output files successfully generated.</p>
  
  <p>But my question is:</p>
  
  <p><strong>How can I resolve <code>W1014</code> warning?</strong></p>
  
  <p>And is there any way to specify initial CS value?</p>