OS/2 构建说明
OS/2 移植版**尚未**完成。这些说明旨在帮助有意贡献者。
OS/2 上的先决条件
- 运行在 Intel 硬件上的 OS/2... ;-)
- GCC 3.3.5 CSD3
ftp://ftp.netlabs.org/pub/gcc/GCC-3.3.5-csd3.zip - 使用 wlink 作为链接器
ftp://ftp.netlabs.org/pub/gcc/wl-hll-r1.zip
确保设置EMXOMFLD_LINKER=wl.exe
和EMXOMFLD_TYPE=WLINK
。 - SDL
ftp://ftp.netlabs.org/pub/sdl/sdl-1.2.10-bin-20060602.zip
将此解压到tools/os2.x86/libsdl/v1.2.10-20060602/
,或者设置PATH_SDK_LIBSDL
环境变量指向您解压该归档的目录。如果在 SDL 头文件中遇到编译器错误,本页底部的补丁将对您有所帮助。 - glib 1.2 + libIDL 0.6
http://hobbes.nmsu.edu/cgi-bin/h-search?key=glibidl_20070521.zip
将此解压到tools/os2.x86/glibidl/
,或者设置VBOX_PATH_GLIB
和VBOX_PATH_LIBIDL
环境变量指向解压归档后的glibidl/gcc335/
子目录。 - 检出最新的 libc 主干。
- 最新的 Qt3 主干
http://svn.netlabs.org/repos/qt3/trunk/
将此检出到一个目录,根据构建说明进行构建,并设置QTDIR
环境变量指向您检出的目录。 - 当前的 BCC 端口要求
\tmp
目录存在。 - Subversion: http://www.smedley.info/os2ports/index.php?page=subversion
- 我们使用的 xerces 和 xalan 源代码以及相应的 kBuild makefile 可在此处找到:http://virtualbox.org/download/testcase/xerces-and-xalan-vbox-src.tar.bz2
将它们解压到 VirtualBox 主干目录中。
构建 VirtualBox
- 加载 gcc 环境 (gccenv.cmd)。
- 确保环境变量
USER
或USERNAME
已设置为一个合理的值。 - 切换到源代码的根目录并执行
kBuild\envos2.cmd
SET VBOX_OSE=1
- 为 kLdr 和 os2ddk 创建符号链接
kmk_ln -s <libc trunk>/libc/include/os2ddk src/VBox/Runtime/include/os2ddk kmk_ln -s <libc trunk>/kLdr src/VBox/Runtime/kLdr
- 要构建,请键入
kmk
默认是发布版本构建,如果您希望进行调试或性能分析构建,请将BUILD_TYPE=debug
或BUILD_TYPE=profile
作为参数添加到 kmk 命令中,或将其设置为环境变量。
运行 VirtualBox
由于这是正在进行的工作,目前只有测试用例和一个在某些显卡上存在显示问题的 VBoxBFE。
您可以在命令行执行 set VBOX_SUPLIB_FAKE=fake
,从而在不加载驱动程序且未启用原始模式的情况下运行它。另一种方法是将 VBoxDrv.sys 从 out\os2.x86\release\bin
复制到您的启动驱动器,并在 config.sys 中添加 DEVICE=c:\VBoxDrv.sys
语句。
如果您希望看到 VBoxBFE SDL 窗口并立即遇到断言错误,请执行此操作
- 将目录更改为
out\os2.x86\release\bin
- 将此目录添加到
BEGINLIBPATH
变量中(记住,使用完整路径)。 - 执行
.\VBoxBFE.exe -m 64
,您将遇到一个 BIOS 错误,提示无法读取启动驱动器。如果您有 knoppix iso 或类似的文件,请尝试使用-cdrom
和-boot d
选项启动它。
SDL 补丁
diff -rwu SDL/include/SDL_audio.h D:/coding/vbox/svn/trunk/tools/os2.x86/libsdl/v1.2.10-20060602/SDL/include/SDL_audio.h --- SDL/include/SDL_audio.h Mon May 1 03:03:00 2006 +++ D:/coding/vbox/svn/trunk/tools/os2.x86/libsdl/v1.2.10-20060602/SDL/include/SDL_audio.h Sat Jan 13 06:47:04 2007 @@ -76,6 +76,8 @@ #define AUDIO_S16SYS AUDIO_S16MSB #endif +/* A filter callback */ +typedef void (SDLCALL * SDL_AudioCVTFilterCall)(struct SDL_AudioCVT *cvt, Uint16 format); /* A structure to hold a set of audio conversion filters and buffers */ typedef struct SDL_AudioCVT { @@ -88,7 +90,7 @@ int len_cvt; /* Length of converted audio buffer */ int len_mult; /* buffer must be len*len_mult big */ double len_ratio; /* Given len, final size is len*len_ratio */ - void (SDLCALL *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); + SDL_AudioCVTFilterCall filters[10]; int filter_index; /* Current audio conversion function */ } SDL_AudioCVT; diff -rwu SDL/include/SDL_config_os2.h D:/coding/vbox/svn/trunk/tools/os2.x86/libsdl/v1.2.10-20060602/SDL/include/SDL_config_os2.h --- SDL/include/SDL_config_os2.h Mon May 1 03:03:00 2006 +++ D:/coding/vbox/svn/trunk/tools/os2.x86/libsdl/v1.2.10-20060602/SDL/include/SDL_config_os2.h Sat Jan 13 06:44:38 2007 @@ -27,6 +27,9 @@ /* This is a set of defines to configure the SDL features */ +#ifdef __GNUC__ +# include <stdint.h> +#else typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; @@ -37,6 +40,7 @@ typedef unsigned long uintptr_t; typedef signed long long int64_t; typedef unsigned long long uint64_t; +#endif #define SDL_HAS_64BIT_TYPE 1
注意: 查看 TracWiki 获取使用维基的帮助。