https://wiki.freepascal.org/index.php?title=Porting_Free_Pascal_Example&feed=atom&action=history
Porting Free Pascal Example - Revision history
2024-03-29T15:06:06Z
Revision history for this page on the wiki
MediaWiki 1.35.6
https://wiki.freepascal.org/index.php?title=Porting_Free_Pascal_Example&diff=47630&oldid=prev
Chronos: Category and see also link
2011-02-01T11:48:04Z
<p>Category and see also link</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 11:48, 1 February 2011</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l169" >Line 169:</td>
<td colspan="2" class="diff-lineno">Line 169:</td></tr>
<tr><td class='diff-marker'> </td><td style="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;"></td><td class='diff-marker'> </td><td style="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;"></td></tr>
<tr><td class='diff-marker'> </td><td style="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;"><div>TODO</div></td><td class='diff-marker'> </td><td style="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;"><div>TODO</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;">==See also==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;">* [[Porting Free Pascal]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="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;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Tutorials]]</ins></div></td></tr>
</table>
Chronos
https://wiki.freepascal.org/index.php?title=Porting_Free_Pascal_Example&diff=42081&oldid=prev
PascalDragon: start of an example port of Free Pascal
2010-04-18T16:47:27Z
<p>start of an example port of Free Pascal</p>
<p><b>New page</b></p><div>This is an example of how to port Free Pascal to a new target. The target used here is i386-minix, which is a Unix based microkernel system. Host system is a i386-linux system. For more information about the port see [[Target_Minix|here]].<br />
<br />
'''this example is a work in progress'''<br />
<br />
== Prerequisites ==<br />
<br />
You'll need the source code of Free Pascal (preferably the most recent version in svn), a SVN client, a working last release of Free Pascal (currently 2.4.0) and a working version of GCC.<br />
<br />
It's best to create a new directory where you'll work in.<br />
<br />
mkdir $HOME/minix-port<br />
cd $HOME/minix-port<br />
<br />
Then either copy an existing Free Pascal working copy on your machine or load a fresh one from the repository. I'll use the second possibility here (for additional help see [[Getting_Lazarus#Installing_the_compiler|here]]):<br />
<br />
svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc<br />
<br />
=== Binutils ===<br />
<br />
The first compiler for a new target is always a cross compiler, so we need utilities that allow us to create executables for our target on our host system.<br />
<br />
Minix supports the GNU binutils. As the current binutils (2.20) are not "up to date" regarding the output format of Minix we will use the port provided by the Minix distribution. <br />
<br />
svn --username anonymous checkout https://gforge.cs.vu.nl/svn/minix/trunk/bigports/binutils-2.16.1 minix-binutils<br />
<br />
We also need the source of Minix, cause we need two include files to build the binutils successfully.<br />
<br />
svn --username anonymous checkout https://gforge.cs.vu.nl/svn/minix/trunk/src minix<br />
<br />
Now copy the needed include files to a directory that is included by the makefiles:<br />
<br />
cp minix/include/minix/a.out.h minix-binutils/include/minix-a.out.h<br />
cp minix/include/ansi.h minix-binutils/include/ansi.h<br />
<br />
You also need to change the include line in ''minix-binutils/bfd/i386minix.c'' from<br />
<br />
#include <a.out.h><br />
<br />
to<br />
<br />
#include <minix-a.out.h><br />
<br />
Now we can build the binutils:<br />
<br />
cd minix-binutils<br />
./configure --host=i686-minix --prefix=../minix-binutils-bin/<br />
make<br />
make install<br />
cd ..<br />
<br />
== Compiler ==<br />
<br />
=== Modifications ===<br />
<br />
The following diff shows the changes that were done in already existing files in ''compiler'' and ''utils'' directories:<br />
<br />
<pre><br />
Index: compiler/i386/cputarg.pas<br />
===================================================================<br />
--- compiler/i386/cputarg.pas (Revision 15151)<br />
+++ compiler/i386/cputarg.pas (Arbeitskopie)<br />
@@ -80,6 +80,9 @@<br />
{$ifndef NOTARGETNATIVENT}<br />
,t_nativent<br />
{$endif}<br />
+ {$ifndef NOTARGETMINIX}<br />
+ ,t_minix<br />
+ {$endif}<br />
<br />
{**************************************<br />
Assemblers<br />
Index: compiler/systems.pas<br />
===================================================================<br />
--- compiler/systems.pas (Revision 15151)<br />
+++ compiler/systems.pas (Arbeitskopie)<br />
@@ -151,6 +151,7 @@<br />
system_mips_linux, { 66 }<br />
system_mipsel_linux, { 67 }<br />
system_i386_nativent, { 68 }<br />
+ system_i386_minix { 69 }<br />
);<br />
<br />
type<br />
Index: compiler/compiler.pas<br />
===================================================================<br />
--- compiler/compiler.pas (Revision 15151)<br />
+++ compiler/compiler.pas (Arbeitskopie)<br />
@@ -113,6 +113,9 @@<br />
{$ifdef nativent}<br />
,i_nativent<br />
{$endif nativent}<br />
+{$ifdef minix}<br />
+ ,i_minix<br />
+{$endif minix}<br />
,globtype;<br />
<br />
function Compile(const cmd:string):longint;<br />
Index: utils/fpcm/fpcmake.ini<br />
===================================================================<br />
--- utils/fpcm/fpcmake.ini (Revision 15151)<br />
+++ utils/fpcm/fpcmake.ini (Arbeitskopie)<br />
@@ -972,6 +972,14 @@<br />
SHORTSUFFIX=nativent<br />
endif<br />
<br />
+# Minix<br />
+ifeq ($(OS_TARGET),minix)<br />
+BATCHEXT=.sh<br />
+EXEEXT=<br />
+HASSHAREDLIB=0<br />
+SHORTSUFFIX=minix<br />
+endif<br />
+<br />
else<br />
# long version for 1.0.x - target specific extensions<br />
<br />
Index: utils/fpcm/fpcmmain.pp<br />
===================================================================<br />
--- utils/fpcm/fpcmmain.pp (Revision 15151)<br />
+++ utils/fpcm/fpcmmain.pp (Arbeitskopie)<br />
@@ -70,7 +70,8 @@<br />
o_linux,o_go32v2,o_win32,o_os2,o_freebsd,o_beos,o_haiku,o_netbsd,<br />
o_amiga,o_atari, o_solaris, o_qnx, o_netware, o_openbsd,o_wdosx,<br />
o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,<br />
- o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent<br />
+ o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,<br />
+ o_minix<br />
);<br />
<br />
TTargetSet=array[tcpu,tos] of boolean;<br />
@@ -92,14 +93,16 @@<br />
'linux','go32v2','win32','os2','freebsd','beos','haiku','netbsd',<br />
'amiga','atari','solaris', 'qnx', 'netware','openbsd','wdosx',<br />
'palmos','macos','darwin','emx','watcom','morphos','netwlibc',<br />
- 'win64','wince','gba','nds','embedded','symbian','nativent'<br />
+ 'win64','wince','gba','nds','embedded','symbian','nativent',<br />
+ 'minix'<br />
);<br />
<br />
OSSuffix : array[TOS] of string=(<br />
'_linux','_go32v2','_win32','_os2','_freebsd','_beos','_haiku','_netbsd',<br />
'_amiga','_atari','_solaris', '_qnx', '_netware','_openbsd','_wdosx',<br />
'_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',<br />
- '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent'<br />
+ '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',<br />
+ '_minix'<br />
);<br />
<br />
{ This table is kept OS,Cpu because it is easier to maintain (PFV) }<br />
@@ -133,7 +136,8 @@<br />
{ nds } ( false, false, false, false, false, true, false, false, false, false, false, false, false, false),<br />
{ embedded }( true, true, true, true, true, true, true, true, true , false, false, false, false, false),<br />
{ symbian } ( true, false, false, false, false, true, false, false, false, false, false, false, false, false),<br />
- { nativent }( true, false, false, false, false, false, false, false, false, false, false, false, false, false)<br />
+ { nativent }( true, false, false, false, false, false, false, false, false, false, false, false, false, false),<br />
+ { minix } ( true, false, false, false, false, false, false, false, false, false, false, false, false, false)<br />
);<br />
<br />
type<br />
</pre><br />
<br />
You also need to add the files i_minix.pas and t_minix.pas in compiler/systems directory. <br />
<br />
TODO<br />
<br />
=== Compiling ===<br />
<br />
== Adding the new RTL ==<br />
<br />
TODO</div>
PascalDragon