How To Build KaffePC/VM

This document describe how to compile KaffePC/VM.

1. Setting of development environment

1.1 Machine environment

OS
Windows95/98 (Windows NT unusable)
Phisical Memory
64MB over
HDD
50MB over

1.2 Installation of DJGPP

To development of KaffePC, we use DJGPP. Please download listed below from DJGPP FTP site, and extract. (about overlapping files, you can overwrite have no problem).

1.3 Setting of shell

Mkdir \bin on current drive and cp bash.exe arleady extracted above process to \bin\sh.exe.

1.4 Installation of JDK

Install JDK1.1.X or JDK1.2.X. It is needed to make JAR file.

2. Building KaffePC/VM

Show sample building KaffePC/VM. First, we assume that some required software by building process listed below are arleady installed in described location.
djgpp
d:/djgpp
KaffePC/VM binary
d:/kaffepc
KaffePC/VM source
d:/kaffepc-1.0.b3
JDK
d:/java/jdk1.1.7B

2.1 Setting of environment variables

Show the sample setting of environment variables below.
rem --------------------------------------------------------------------------
rem Modify the following environment variables.
rem 
set JDKHOME=d:/java/jdk1.1.7B
set DJGPPHOME=d:/djgpp
set KAFFEHOME=d:/kaffepc
set KAFFESRCHOME=d:/kaffepc-1.0.b3
rem --------------------------------------------------------------------------

set PATH=%DJGPPHOME%/bin;%KAFFEHOME%/bin;%JDKHOME%/bin
set DJGPP=%DJGPPHOME%/djgpp.env
set LFN=y

set VPATHSEP=;
set CC=gcc
set AR=ar rc
set RANLIB=ranlib
set LIBS=-ltcp -lserio
set STD_LIBRARIES=-ltcp -lserio
set EXTRA_CFLAGS=-DDEBUG
set SHELL=%DJGPPHOME%/bin/bash.exe
set CFLAGS=-O2

set CLASSPATH=.;%KAFFESRCHOME%/kaffe-1.0.b3/libraries/javalib/pizza.jar

set LANG=ja_JP.SJIS
set TZ=JST-9

rem for wattcp
set LAB=%KAFFESRCHOME%
set WATTCPHOME=%LAB%/tcplib
set C_INCLUDE_PATH=%C_INCLUDE_PATH%;%WATTCPHOME%/include
set C_INCLUDE_PATH=%C_INCLUDE_PATH%;%WATTCPHOME%/include/tcp
set LIBRARY_PATH=%WATTCPHOME%

rem for bcsio20
set BCSIO20HOME=%KAFFESRCHOME%/bcsio20
set C_INCLUDE_PATH=%C_INCLUDE_PATH%;%BCSIO20HOME%
set LIBRARY_PATH=%LIBRARY_PATH%;%BCSIO20HOME%

rem for gmp
set GMPHOME=%KAFFESRCHOME%/gmp-2.0.2
set C_INCLUDE_PATH=%C_INCLUDE_PATH%;%GMPHOME%
set LIBRARY_PATH=%LIBRARY_PATH%;%GMPHOME%

rem for zlib
set ZLIBHOME=%KAFFESRCHOME%/zlib-1.12
set C_INCLUDE_PATH=%C_INCLUDE_PATH%;%ZLIBHOME%
set LIBRARY_PATH=%LIBRARY_PATH%;%ZLIBHOME%

2.2 Running make

Run make at KaffePC/VM source directory. With make, some targets available:
all
to make kaffe.exe, compile all C source of KaffePC/VM.
buildjar
to make klasses.jar and kaffepc.jar, recompile all Java source. (If you don't modify Java source in KaffePC/VM, you have no need to execute the target)
buildbin
to pack running environment, mkdir kpcbin on current directory, collect all of KaffePC/VM binaries needed into kpcbin and pack it.
allclean
delete all of binaries produced.

3. About modification of cwsdpmi.exe

The reason of the mismatch of hardware interrupt mechanism of KaffePC/VM and DJGPP, we modify DPMI server module of DJGPP, namely cwsdpmi.exe. the modified module is included in source and binary release of KaffePC/VM.