source: xtideuniversalbios/wiki/BuildInstructions.wiki@ 608

Last change on this file since 608 was 579, checked in by aitotat@…, 10 years ago

Restored pictures.

File size: 14.8 KB
RevLine 
[381]1#summary How to build XTIDE Universal BIOS.
[388]2*Table of Contents*
[450]3<wiki:toc max_depth="4" />
[388]4----
[381]5= Introduction =
6
[509]7This is a small tutorial on how to build XTIDE Universal BIOS on Windows. This tutorial is updated for XTIDE Universal BIOS v2.0.0 beta 3.
[381]8
9
10= Programs needed =
11
[387]12 * [http://tortoisesvn.tigris.org/ TortoiseSVN] (or any SVN client)
[383]13 * [http://tdm-gcc.tdragon.net/ MinGW] (only mingw32-make.exe is needed)
14 * [http://www.nasm.us/ NASM]
15 * [http://upx.sourceforge.net/ UPX] (optional)
16 * [http://strawberryperl.com/ Strawperry Perl] (optional)
[381]17
18
[388]19----
[384]20= Install Tortoise SVN =
[381]21
[384]22TortoiseSVN is a subversion client that is very easy to use since it integrates nicely to Windows. It is used to download XTIDE Universal BIOS sources. Anyone can download sources from coogle.code repository but you must be a project member to commit changes back to the repository.
23
[382]24First [http://tortoisesvn.net/downloads.html download and install TortoiseSVN]. You can use the default settings that the installer suggests. Next you need to create folder where you want to download the sources. We name the folder _XTIDE Universal BIOS sources_ in this example.
[381]25
[384]26== Downloading sources ==
[381]27
28Once the directory is created, open it and click right mouse button. You will find _SVN Checkout..._ from the menu.
[579]29https://xtideuniversalbios.googlecode.com/svn/wiki/pictures/TortoiseMenu.png
[381]30
31URL for the repository is http://xtideuniversalbios.googlecode.com/svn/trunk/. There is no need to alter other settings so just click OK. You have now downloaded all sources from XTIDE Universal BIOS project.
[579]32https://xtideuniversalbios.googlecode.com/svn/wiki/pictures/SvnCheckout.png
[381]33
[385]34
[384]35== Updating sources ==
[381]36
37If you have already done all above and want to get latest sources, go to the source folder you have created. Click right mouse button and select _SVN Update_. Using TortoiseSVN is really this easy!
38
39
40
[384]41= Install MinGW =
[381]42
[384]43MinGW is a free C/C++ compiler suite for Windows. We only need make utility from it but installing the whole MinGW is easier since it will add path to the environment variables automatically. Download the bundle installer ([http://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/tdm-gcc-4.6.1.exe/download tdm-gcc-4.6.1.exe] when writing this) and install it with default settings. It will install the MinGW to C:\MinGW32. Keep this in mind since you'll want to install NASM to C:\MinGW32\bin so there will be no need to change environment path.
[381]44
45
[384]46
47= Install NASM =
48
[382]49NASM is the assembler that is used to compile the sources. NASM v2.10 stable is what we are using when writing this. Download the [http://www.nasm.us/pub/nasm/releasebuilds/2.10/win32/nasm-2.10-win32.zip nasm-2.10-win32.zip] and extract nasm.exe to C:\MinGW32\bin (if you installed MinGW to C:\MinGW32\).
[381]50
51
52
[384]53= Install UPX (optional) =
[381]54
[384]55UPX is used to compress XTIDE Universal BIOS configurator. It is needed only for release build. The only advantage is that it makes the executable size smaller.
[381]56
57
[384]58
59= Install Strawberry Perl (optional) =
60
[381]61Strawberry Perl is required to execute optional scripts when building XTIDE Universal BIOS. Scripts include string compression (not needed unless you modify the sources) and checksum calculation. Just run the Strawberry Perl installer with default settings.
62
63
[388]64----
[381]65= Building XTIDE Universal BIOS =
66
[384]67Open command line window and go to the folder where you downloaded the sources with TortoiseSVN. Then go to the _XTIDE_Universal_BIOS_ folder. Write _mingw32-make all_ and everything should be build.
[381]68
69You might want to write _mingw32-make checksum_ if you installed Stawberry Perl. It will calculate checksum bytes to the binaries (You can use XTIDECFG.COM for that if you don't want to install Stawberry Perl).
70
[384]71You will find the binaries in _build\_ folder.
[381]72
73
74== Including and excluding optional modules ==
75
[450]76There are many optional modules (most of them are included in official release builds). Reason for modules is simple: it is not possible to get all features to fit in 8k ROM. Official builds are designed so that they include the features most users prefer.
[381]77
[387]78It is easy to include and exclude modules but it must be done by editing makefile. Makefile specifies how the binaries are build when you execute _mingw32-make_.
[381]79
[509]80Open makefile with Windows Notepad (or [http://notepad-plus-plus.org/ Notepad++]). You will now see all the modules and short description about them. The makefile looks like below for XTIDE Universal BIOS v2.0.0 beta 3:
[387]81{{{
[450]82####################################################################################################
83# Makefile to build XTIDE Universal BIOS. #
84# #
85# Valid makefile targets are: #
86# all Removes existing files and builds binary files in \Build #
87# small Builds 8 kiB binaries only (without checksum) #
[509]88# large Builds 12 kiB binaries only (without checksum) #
[450]89# clean Removes all files from \Build #
90# checksum* Builds all and then generates checksum byte to all binary files #
91# strings* Compress src\Strings.asm to src\StringsCompressed.asm #
[509]92# unused* Checks if there are any unused functions that can be removed to save space #
[450]93# #
94# * at the end of target name means that Perl is required for the job. #
95# Build directory must be created manually if it does not exist. #
96# #
97# #
98# Following modules can be included or excluded: #
99# MODULE_8BIT_IDE Support for 8-BIT IDE cards like XTIDE #
[495]100# MODULE_8BIT_IDE_ADVANCED Support for memory mapped and DMA based cards like JRIDE and XTCF #
[450]101# MODULE_ADVANCED_ATA Native support for some VLB IDE controllers #
102# MODULE_BOOT_MENU Boot Menu for selection of drive to boot from #
103# MODULE_EBIOS Enhanced functions for accessing drives over 8.4 GB #
104# MODULE_HOTKEYS Hotkey Bar to boot from any drive #
105# MODULE_IRQ IDE IRQ support #
106# MODULE_SERIAL Virtual hard disks using serial port #
107# MODULE_SERIAL_FLOPPY Virtual floppy drives using serial port (requires MODULE_SERIAL) #
108# MODULE_STRINGS_COMPRESSED Use compressed strings to save space #
109# MODULE_FEATURE_SETS Power Management support #
110# #
111# Not modules but these affect the assembly: #
112# ELIMINATE_CGA_SNOW Prevents CGA snowing at the cost of a few bytes #
113# RELOCATE_INT13H_STACK Relocates INT 13h stack to top of stolen conventional memory #
114# RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes #
115# USE_186 Use instructions supported by 80188/80186 and V20/V30 and later #
[509]116# USE_286 Use instructions supported by 286 and later (defines USE_UNDOC_INTEL)#
117# USE_386 Use instructions supported by 386 and later (defines USE_286) #
[450]118# USE_AT Use features supported on AT and later systems (not available on XT) #
[494]119# USE_UNDOC_INTEL Optimizations for Intel CPU:s - do NOT use on NEC V20/V30/Sony CPU:s #
[450]120# #
121####################################################################################################
[387]122}}}
[381]123
[387]124I'm sure there will be more modules in the future so always read up to date makefile for all available modules.
125
126Scroll down the makefile to find Assembler preprocessor defines and other variables:
127{{{
128#################################################################
129# Assembler preprocessor defines. #
130#################################################################
[509]131DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_EBIOS MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER
132DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED
[387]133
[509]134DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED
[450]135DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
[509]136DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 RELOCATE_INT13H_STACK MODULE_IRQ MODULE_ADVANCED_ATA
[387]137
[450]138DEFINES_XT_LARGE = $(DEFINES_XT) $(DEFINES_COMMON_LARGE)
139DEFINES_XTPLUS_LARGE = $(DEFINES_XTPLUS) $(DEFINES_COMMON_LARGE)
140DEFINES_AT_LARGE = $(DEFINES_AT) $(DEFINES_COMMON_LARGE)
[387]141
[450]142DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE
143DEFINES_386_8K = $(DEFINES_AT) USE_386
[387]144
[509]145DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS
146
147
[387]148###################
149# Other variables #
150###################
151
152# Target size of the ROM, used in main.asm for number of 512B blocks and by checksum Perl script below
[509]153BIOS_SIZE = 8192 # For BIOS header (use even multiplier!)
154ROMSIZE = $(BIOS_SIZE) # Size of binary to build when building with make checksum
155BIOS_SIZE_LARGE = 12288
156ROMSIZE_LARGE = $(BIOS_SIZE_LARGE)
[387]157}}}
158
159These are the only parts in the makefile that you need to edit. The defines tell what modules are included in what builds.
160
[509]161DEFINES_COMMON define the modules that are included in all builds and DEFINES_COMMON_LARGE define additional modules for all large builds.
[387]162
[450]163DEFINES_XT, DEFINES_XTPLUS and DEFINES_AT define what modules are included in the 8k XT, XT+ and AT builds in addition to the ones in DEFINES_COMMON.
[387]164
[509]165DEFINES_XT_LARGE, DEFINES_XTPLUS_LARGE and DEFINES_AT_LARGE are for large builds (12k by default).
[387]166
[450]167Finally there are DEFINES_XT_TINY (XT build with minimal features) and DEFINES_386_8K (AT build for 386+).
[387]168
[450]169If you want to make your own 8k AT build, for example, modify DEFINES_COMMON and DEFINES_AT to include the modules you want. Then rebuild with _mingw32-make all_ or _mingw32-make checksum_.
[387]170
[509]171One more thing you might want to change is the size of large build. It is 12k by default (12288 bytes). If you want 16k binary, set ROMSIZE_LARGE to 16384. For 32k build set it to 32768.
[387]172
173
[450]174=== Module information ===
175
176====*MODULE_8BIT_IDE*====
[509]177This module contains support for XTIDE rev 1 and 2 and Lo-tech XT-CF v2/v3/Lite PIO mode.
[450]178
[494]179====*MODULE_8BIT_IDE_ADVANCED* _(requires and automatically includes MODULE_8BIT_IDE)_====
[509]180This module contains support for JR-IDE/ISA and more advanced modes for XT-CF v2.
[450]181
182====*MODULE_ADVANCED_ATA*====
183Adds native support for VLB (and eventually PCI) IDE Controllers. At the moment there is support for QDI Vision QD6500 and QD6580 VLB IDE controllers.
184
[509]185====*MODULE_EBIOS*====
186Support for Phoenix Enhanced Disk Drive Specification. Allows to access more than 8 GB but requires support from operating system (Windows 9x and later).
187
[494]188====*MODULE_BOOT_MENU*====
[509]189Boot menu displays drive details and allows selecting drive more easily but essentially it has all the same features as MODULE_HOTKEYS. It can also be included without MODULE_HOTKEYS, in which case the menu is always entered during the boot process.
[450]190
[509]191====*MODULE_HOTKEYS*====
192Displays hotkeys during drive detections. Hotkeys allows boot drive selection, ROM Boot, Serial Drive Scanning and Boot Menu.
193
[450]194====*MODULE_IRQ*====
195Adds IRQ support (you also need to enable IRQ with XTIDECFG.COM). IRQs have no real benefit for DOS (but can actually slow transfer rates a bit). You might want to use IRQs with more capable operating systems.
196
197====*MODULE_SERIAL*====
198Virtual hard disks using serial port. [http://code.google.com/p/xtideuniversalbios/wiki/SerialDrives Instructions for emulating Serial Drives with the XTIDE Universal BIOS]
199
200====*MODULE_SERIAL_FLOPPY* _(requires and automatically includes MODULE_SERIAL)_====
201Virtual floppy drives using serial port.
202
203====*MODULE_STRINGS_COMPRESSED*====
204Use compressed strings to save space. This module should be always included.
205
206====*MODULE_FEATURE_SETS*====
207Power Management support (you also need to enable it with XTIDECFG.COM).
208
209
210=== Other features that affect assembly ===
211
212====*ELIMINATE_CGA_SNOW*====
213Prevents CGA snowing at the cost of a few bytes.
214
215====*RELOCATE_INT13H_STACK*====
216Relocates INT 13h stack to top of stolen conventional memory. Has no noticeable performance penalty for AT systems but might slow down XT systems. If you include this to XT builds, make sure that Full Operating Mode is enabled with XTIDECFG.COM. Otherwise stack won't be relocated.
217
218====*RESERVE_DIAGNOSTIC_CYLINDER*====
219Old BIOSes reserve one diagnostic cylinder that is not used for anything. Do not include this if you have use for one extra cylinder. Note that this can cause compatibility problems if you move drives between different systems.
220
221====*USE_186, USE_286 and USE_386*====
222Determines what CPU instructions are allowed. USE_186 limits instructions to those supported by 80188/80186 and NEC V20/V30. USE_286 limits instructions for 286 compatible code and USE_386 limits instructions for 386 compatible code. XTIDE Universal BIOS uses macros that emulate the missing instructions when necessary. Do not use any of the mentioned preprocessor directives if you want to generate 8088/8086 compatible code.
223
[509]224====*USE_UNDOC_INTEL*====
225Allows to use undocumented Intel opcodes that are not supported by NEC V20/V30. This is defined automatically when USE_286 or USE_386 is defined.
226
[450]227====*USE_AT*====
228Assembles code targeted for AT systems. For example AT builds always operate in full operating mode. Another difference is that AT builds use some BIOS functions that are not available on XT systems.
229
[388]230----
[381]231= Building Configurator (XTIDECFG.COM) =
232
233You should always use up to date configurator but note that configurator usually lags behind XTIDE Universal BIOS when new features are concerned.
234
[384]235Go to _XTIDE_Universal_BIOS_Configurator_v2_ folder and write _mingw32-make all_ to build the XTIDECFG.COM. You should write _mingw32-make release_ if you installed UPX.
[381]236
[384]237Again you will find the binaries in _build\_ folder.
Note: See TracBrowser for help on using the repository browser.