<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.amc-os.com/index.php?action=history&amp;feed=atom&amp;title=Compiling_and_Linking</id>
	<title>Compiling and Linking - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.amc-os.com/index.php?action=history&amp;feed=atom&amp;title=Compiling_and_Linking"/>
	<link rel="alternate" type="text/html" href="http://wiki.amc-os.com/index.php?title=Compiling_and_Linking&amp;action=history"/>
	<updated>2026-04-20T10:19:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.12</generator>
	<entry>
		<id>http://wiki.amc-os.com/index.php?title=Compiling_and_Linking&amp;diff=32&amp;oldid=prev</id>
		<title>Kindman: /* AMC-OS Kernel, drivers and applications */</title>
		<link rel="alternate" type="text/html" href="http://wiki.amc-os.com/index.php?title=Compiling_and_Linking&amp;diff=32&amp;oldid=prev"/>
		<updated>2012-08-14T20:38:16Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;AMC-OS Kernel, drivers and applications&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:38, 14 August 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l84&quot;&gt;Line 84:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 84:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===AMC-OS Kernel, drivers and applications===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===AMC-OS Kernel, drivers and applications===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All other code for AMC-OS is linked with specific [[AMC-OS Linker]] which produces [[AMCX &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;File Format&lt;/del&gt;|AMCX files]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All other code for AMC-OS is linked with specific [[AMC-OS Linker]] which produces [[AMCX &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;file format&lt;/ins&gt;|AMCX files]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kindman</name></author>
	</entry>
	<entry>
		<id>http://wiki.amc-os.com/index.php?title=Compiling_and_Linking&amp;diff=30&amp;oldid=prev</id>
		<title>Kindman: Initial page</title>
		<link rel="alternate" type="text/html" href="http://wiki.amc-os.com/index.php?title=Compiling_and_Linking&amp;diff=30&amp;oldid=prev"/>
		<updated>2012-08-14T19:51:40Z</updated>

		<summary type="html">&lt;p&gt;Initial page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Compilation==&lt;br /&gt;
&lt;br /&gt;
===Building everything===&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; is present for building everything, and should work with any available &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; tool (VC, TASM...). Compilation can be done in DOS or Windows without problems as soon as environment variables are set correctly. Then just type :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; CD SRC&lt;br /&gt;
&amp;gt;SRC&amp;gt; make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All object files are moved in &amp;lt;code&amp;gt;OBJ\&amp;lt;/code&amp;gt; directory. Complete listing is written in &amp;lt;code&amp;gt;LST\&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
After linkage, final binary files are stored in &amp;lt;code&amp;gt;BIN\&amp;lt;/code&amp;gt;directory.&lt;br /&gt;
&lt;br /&gt;
===Assembly Code===&lt;br /&gt;
&lt;br /&gt;
AMC-OS code written in ASM is to be compiled with Turbo Assembler v4 (TASM). It has not yet been tested with free  [http://www.phatcode.net/downloads.php?id=308 Lazy Assembler]. Typical command for compiling ASM source code is :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TASM32 /c/m5/ml/w2/la/z /I$INC $ASM,$OBJ,$LST&lt;br /&gt;
&lt;br /&gt;
/c  : Compile only (no link)&lt;br /&gt;
/m5 : Make up to 5 passes to solve forward references&lt;br /&gt;
/ml : Case sensitivity on all symbols&lt;br /&gt;
/w2 : Set all warnings&lt;br /&gt;
/la : Generate expanded listing&lt;br /&gt;
/z  : Display source line with error message&lt;br /&gt;
/I  : Specified directory used as include directory&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C Code===&lt;br /&gt;
&lt;br /&gt;
AMC-OS code written in C is to be compiled with [http://www.openwatcom.org/ Watcom C/C++]. Typical command for compiling S source code is :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
wcc386 -3r -ecd -we -wx -zl -obhkmrtl+ -zz -ms -s -i=$INC -fo=$OBJ $C&lt;br /&gt;
&lt;br /&gt;
-3r  : Compile for 386 architecture&lt;br /&gt;
-ecd : Default calling convention to __syscall&lt;br /&gt;
-we  : Warning treated as errors&lt;br /&gt;
-wx  : Maximum warning level&lt;br /&gt;
-zl  : Remove default library information&lt;br /&gt;
-o*  : Optimization levels (optimize for speed)&lt;br /&gt;
-zz  : Remove @size for __stdcall function names (for compatibility with ASM)&lt;br /&gt;
-ms  : Small memory model (only 1 code segment and 1 data segment)&lt;br /&gt;
-s   : Remove stack overflow checks&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Listing is then produced with OBJ2ASM tool :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
OBJ2ASM -o -x $OBJ &amp;gt; $LST&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Combining==&lt;br /&gt;
&lt;br /&gt;
Source OBJ files are combined together using the LIB tool (with VC, VBDOS, TASM...) which build a LIB file to simplify rebuilding and command lignes in DOS. Usage is :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LIB $LIB +$OBJ,,$LIB&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Linking==&lt;br /&gt;
&lt;br /&gt;
===AMC-OS Loader, boot sector and raw data===&lt;br /&gt;
AMC-OS Loader, boot sector writer and raw data are linked with standard Turbo Linker (TLINK) bundled with TASM. Typical command for linking with TLINK is :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TLINK /d/m/3/s/c/C&lt;br /&gt;
&lt;br /&gt;
/d : Warn if duplicate symbol&lt;br /&gt;
/m : Map including public names&lt;br /&gt;
/3 : 32-bit processing&lt;br /&gt;
/s : Map plus detailed segment map&lt;br /&gt;
/c : Case sensitive symbols&lt;br /&gt;
/C : Case sensitive import/export&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For pure code without header (eg AMC-OS Loader, keyboard layout, ...), &amp;lt;code&amp;gt;EXE2SYS&amp;lt;/code&amp;gt; is used to strip EXE header and generate a SYS file :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
EXE2SYS $EXE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===AMC-OS Kernel, drivers and applications===&lt;br /&gt;
All other code for AMC-OS is linked with specific [[AMC-OS Linker]] which produces [[AMCX File Format|AMCX files]].&lt;/div&gt;</summary>
		<author><name>Kindman</name></author>
	</entry>
</feed>