Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ How to target ELKS using owtarget16:
* In a terminal window:
* Run: git clone https://github.com/pts/owtarget16
* cd into the extracted directory containing binl/owcc.
* Run: export WATCOM="$PWD"; export PATH="$WATCOM/binl:$PATH" INCLUDE="$WATCOM/h"
* Run: export WATCOM="$PWD"; export PATH="$WATCOM/binl:$PATH" INCLUDE="$WATCOM/lh"
* cd to the owtarget16 directory (created by `git clone' above).
* Run: ./compile.sh
* To try the example programs, in the same terminal window:
Expand Down
4 changes: 2 additions & 2 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
set -ex

# gcc -W -Wall -s -O2 -o prog16cv prog16cv.c # Any host.
owcc -W -Wall -Wextra -s -O2 -fno-stack-check -o prog16cv prog16cv.c # For the Linux host.
owcc -Wall -Wextra -s -O2 -fno-stack-check -o prog16cv prog16cv.c # For the Linux host.

for PROG in hello printarg rot13; do
# There is no -nostdinc.
# OpenWatcom 2 C compiler. https://open-watcom.github.io/
# -Wl,disable -Wl,1014 hides this: Warning! W1014: stack segment not found
# !! Specify the stack size in the .c file (?).
# Stack size: 0x400 is enough, 0x380 seems to be too low (fails with `"$PROG": Out of space) in ELKS 0.2.0.
owcc -bos2 -fnostdlib -Wl,disable -Wl,1014 -Wl,option -Wl,start=_start_ -Wl,option -Wl,dosseg -Wl,option -Wl,stack=0x400 -Os -s -fno-stack-check -march=i86 -W -Wall -Wextra -o "$PROG".os2 "$PROG".c
owcc -bos2 -march=i86 -I${WATCOM}/h -fnostdlib -Wl,disable -Wl,1014 -Wl,option -Wl,start=_start_ -Wl,option -Wl,dosseg -Wl,option -Wl,stack=0x400 -Os -s -fno-stack-check -Wall -Wextra -o "$PROG".os2 "$PROG".c
./prog16cv -f elks -o "$PROG".elks "$PROG".os2
rm -f "$PROG".os2
done
Expand Down
4 changes: 0 additions & 4 deletions prog16cv.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#include <sys/stat.h>
#include <unistd.h>

#if defined(__WATCOMC__) && defined(__LINUX__)
#undef O_BINARY /* Work around OpenWatcom libc bug. */
#endif

#ifndef O_BINARY
#define O_BINARY 0
#endif
Expand Down