Difference between revisions of "ZSeries/Part 3"

From Free Pascal wiki
Jump to navigationJump to search
(new)
 
 
(4 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
This continues the list from part 2 of an examination of every unit in the compiler and where changes/additions need to be made for the addition of a new CPU and/or operating system environment.
 
This continues the list from part 2 of an examination of every unit in the compiler and where changes/additions need to be made for the addition of a new CPU and/or operating system environment.
  
==Unit link==
+
=Units I will have to create=
 +
==Unit i_vse==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
(To be added later)
+
This will be related to use of the compiler under one of the standard IBM operating systems, including VS/1, VM, CMS, or possibly as a program running on the CICS transaction monitor.  More on this later.
Linker and binder calls.
 
  
==Unit dbgbase==
+
==t_s370.pas==
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
+
(The cross-compiler instructions say I'll need this. It will be in the '''systems''' subdirectory.  Will figure out later.)  It appears to be used for running the support programs such as the assembler and the linker.
(To be added later)
 
==Unit import==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit export==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit tokens==
 
:''Called from: '''compiler.pas; parser.pas; symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit pass_1==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit wpobase==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit wpo==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cpupara==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cpupi==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cgcpu==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cpunode==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cputarg==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit globtype==
 
:''Called from: '''compiler.pas; verbose.pas; comphook.pas; cfileutl.pas; cclasses.pas; options.pas; parser.pas; symtable.pas; assemble.pas''''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
 
 
==Unit finput==
 
:''Called from: '''verbose.pas; comphook.pas; parser.pas; assemble.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cmsgs==
 
:''Called from: '''verbose.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cstreams==
 
:''Called from: '''cclasses.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cpuinfo==
 
:''Called from: '''options.pas; parser.pas; cpuinfo.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit comprsrc==
 
:''Called from: '''options.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit version==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit switches==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit symbase==
 
:''Called from: '''parser.pas; symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit symdef==
 
:''Called from: '''parser.pas; symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit symsym==
 
:''Called from: '''parser.pas; symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit fppu==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit aasmbase==
 
:''Called from: '''parser.pas; assemble.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit aasmtai==
 
:''Called from: '''parser.pas; symtable.pas; assemble.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit aasmdata==
 
:''Called from: '''parser.pas; symtable.pas; assemble.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cgbase==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit script==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit gendef==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit scanner==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit scandir==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit pbase==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit ptype==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit psystem==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit pmodules==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit psub==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit ncgrtti==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit htypechk==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit cresstr==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit procinfo==
 
:''Called from: '''parser.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit symtype==
 
:''Called from: '''symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit ppu==
 
:''Called from: '''symtable.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
==Unit ogbase==
 
:''Called from: '''assemble.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(To be added later)
 
 
 
=Units I will have to create=
 
==Unit i_i370==
 
:''Called from: '''compiler.pas''', includes '''fpcdefs.inc''', no called units noted''
 
(This will be created later once I know what has to go into it)
 
==t_i370.pas==
 
(The cross-compiler instructions say I'll need this. It will be in the '''systems''' subdirectory.  Will figure out later.)  It appears to be used for running the support programs such as the assembler and the linker, if so, it's going to be a stub.
 
  
 
=Other files=
 
=Other files=
Line 155: Line 17:
 
       TCpu=(
 
       TCpu=(
 
         c_i386,c_m68k,c_powerpc,c_sparc,c_x86_64,c_arm,c_powerpc64,c_avr,c_armeb,
 
         c_i386,c_m68k,c_powerpc,c_sparc,c_x86_64,c_arm,c_powerpc64,c_avr,c_armeb,
         c_armel,c_mips,c_mipsel,c_mips64,c_mips64el,c_i370
+
         c_armel,c_mips,c_mipsel,c_mips64,c_mips64el,c_s370
 
       );
 
       );
  
Line 163: Line 25:
 
         o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
 
         o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
 
         o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,o_iphonesim,
 
         o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,o_iphonesim,
         o_wii,o_i370
+
         o_wii,o_s370
 
       );
 
       );
 
</code>
 
</code>
Line 170: Line 32:
 
       CpuStr : array[TCpu] of string=(
 
       CpuStr : array[TCpu] of string=(
 
         'i386','m68k','powerpc','sparc','x86_64','arm','powerpc64','avr','armeb',
 
         'i386','m68k','powerpc','sparc','x86_64','arm','powerpc64','avr','armeb',
         'armel', 'mips', 'mipsel', 'mips64', 'mips64el','i370'
+
         'armel', 'mips', 'mipsel', 'mips64', 'mips64el','s370'
 
       );
 
       );
  
 
       CpuSuffix : array[TCpu] of string=(
 
       CpuSuffix : array[TCpu] of string=(
 
         '_i386','_m68k','_powerpc','_sparc','_x86_64','_arm','_powerpc64','avr',
 
         '_i386','_m68k','_powerpc','_sparc','_x86_64','_arm','_powerpc64','avr',
         '_armeb', '_armel', '_mips', '_mipsel', '_mips64', '_mips64el','_i370'
+
         '_armeb', '_armel', '_mips', '_mipsel', '_mips64', '_mips64el','_s370'
 
       );
 
       );
  
 
       ppcSuffix : array[TCpu] of string=(
 
       ppcSuffix : array[TCpu] of string=(
 
         '386','m68k','ppc','sparc','x86_64','arm','ppc64','avr','armeb', 'armel',
 
         '386','m68k','ppc','sparc','x86_64','arm','ppc64','avr','armeb', 'armel',
         'mips', 'mipsel', 'mips64', 'mips64el','i370'
+
         'mips', 'mipsel', 'mips64', 'mips64el','s370'
 
       );
 
       );
  
Line 188: Line 50:
 
         'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
 
         'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
 
         'win64','wince','gba','nds','embedded','symbian','nativent',
 
         'win64','wince','gba','nds','embedded','symbian','nativent',
         'iphonesim', 'wii','i370'
+
         'iphonesim', 'wii','vse'
 
       );
 
       );
  
Line 196: Line 58:
 
         '_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
 
         '_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
 
         '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',
 
         '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',
         '_iphonesim','_wii','_i370'
+
         '_iphonesim','_wii','_vse'
 
       );
 
       );
 
</code>
 
</code>
Line 204: Line 66:
 
       { This table is kept OS,Cpu because it is easier to maintain (PFV) }
 
       { This table is kept OS,Cpu because it is easier to maintain (PFV) }
 
       OSCpuPossible : array[TOS,TCpu] of boolean = (
 
       OSCpuPossible : array[TOS,TCpu] of boolean = (
         { os          i386    m68k  ppc    sparc  x86_64 arm    ppc64  avr    armeb  armel  mips  mipsel mips64 misp64el, i370}
+
         { os          i386    m68k  ppc    sparc  x86_64 arm    ppc64  avr    armeb  armel  mips  mipsel mips64 misp64el, s370}
 
         { linux }  ( true,  true,  true,  true,  true,  true,  true,  false, true,  false, false, true,  false,  false,  true),
 
         { linux }  ( true,  true,  true,  true,  true,  true,  true,  false, true,  false, false, true,  false,  false,  true),
 
         { go32v2 }  ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
 
         { go32v2 }  ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
Line 236: Line 98:
 
         { iphonesim }( true,  false, false, false, false, false, false, false, false, false, false, false, false, false,  false),
 
         { iphonesim }( true,  false, false, false, false, false, false, false, false, false, false, false, false, false,  false),
 
         { wii }    ( false, false, true,  false, false, false, false, false, false, false, false, false, false,  false,  false),
 
         { wii }    ( false, false, true,  false, false, false, false, false, false, false, false, false, false,  false,  false),
         { i370 }   ( false, false, false, false, false, false, false, false, false, false, false, false, false,  false,  true)
+
         { vse }     ( false, false, false, false, false, false, false, false, false, false, false, false, false,  false,  true)
 
       );
 
       );
 
</code>
 
</code>
  
 +
I compiled PP under Lazarus using parameters '''-dwin32 -di386''' and it compiles without error, so the changes have not damaged
 +
the original compiler.  The next thing to do is to see what happens when trying it with '''-ds370 -dlinux ''' or '''-ds370 -dvse''' and see if it fails, crashes or just does nothing.
  
 +
It does nothing.  It compiles okay with both of these.  Of course, the question now is where it would go to start code generation.  That will take a while.
  
 
:''[[ZSeries|Go back to zSeries]]'' &mdash; [[ZSeries/Part 2|Go Back to Part 2]] &mdash; [[ZSeries/Part 4|Go Forward to Part 4]]  
 
:''[[ZSeries|Go back to zSeries]]'' &mdash; [[ZSeries/Part 2|Go Back to Part 2]] &mdash; [[ZSeries/Part 4|Go Forward to Part 4]]  
 
{{Stub}}
 
{{Stub}}
 +
 +
[[Category:Mainframes]]
 +
[[Category:High-performance computing]]

Latest revision as of 19:27, 4 April 2013

Go back to zSeriesGo Back to Part 2Go Forward to Part 4

This continues the list from part 2 of an examination of every unit in the compiler and where changes/additions need to be made for the addition of a new CPU and/or operating system environment.

Units I will have to create

Unit i_vse

Called from: compiler.pas, includes fpcdefs.inc, no called units noted

This will be related to use of the compiler under one of the standard IBM operating systems, including VS/1, VM, CMS, or possibly as a program running on the CICS transaction monitor. More on this later.

t_s370.pas

(The cross-compiler instructions say I'll need this. It will be in the systems subdirectory. Will figure out later.) It appears to be used for running the support programs such as the assembler and the linker.

Other files

From the description for porting the compiler, a few other files have to be edited.

  • utils/fpcm/fpcmmain.pp - add a new entry at the end of TCpu and TOs, near line 85:

     TCpu=(
       c_i386,c_m68k,c_powerpc,c_sparc,c_x86_64,c_arm,c_powerpc64,c_avr,c_armeb,
       c_armel,c_mips,c_mipsel,c_mips64,c_mips64el,c_s370
     );
     TOS=(
       o_linux,o_go32v2,o_win32,o_os2,o_freebsd,o_beos,o_haiku,o_netbsd,
       o_amiga,o_atari, o_solaris, o_qnx, o_netware, o_openbsd,o_wdosx,
       o_palmos,o_macos,o_darwin,o_emx,o_watcom,o_morphos,o_netwlibc,
       o_win64,o_wince,o_gba,o_nds,o_embedded,o_symbian,o_nativent,o_iphonesim,
       o_wii,o_s370
     );

About line 81, add the new item to these entries:

     CpuStr : array[TCpu] of string=(
       'i386','m68k','powerpc','sparc','x86_64','arm','powerpc64','avr','armeb',
       'armel', 'mips', 'mipsel', 'mips64', 'mips64el','s370'
     );
     CpuSuffix : array[TCpu] of string=(
       '_i386','_m68k','_powerpc','_sparc','_x86_64','_arm','_powerpc64','avr',
       '_armeb', '_armel', '_mips', '_mipsel', '_mips64', '_mips64el','_s370'
     );
     ppcSuffix : array[TCpu] of string=(
       '386','m68k','ppc','sparc','x86_64','arm','ppc64','avr','armeb', 'armel',
       'mips', 'mipsel', 'mips64', 'mips64el','s370'
     );
     OSStr : array[TOS] of string=(
       'linux','go32v2','win32','os2','freebsd','beos','haiku','netbsd',
       'amiga','atari','solaris', 'qnx', 'netware','openbsd','wdosx',
       'palmos','macos','darwin','emx','watcom','morphos','netwlibc',
       'win64','wince','gba','nds','embedded','symbian','nativent',
       'iphonesim', 'wii','vse'
     );
     OSSuffix : array[TOS] of string=(
       '_linux','_go32v2','_win32','_os2','_freebsd','_beos','_haiku','_netbsd',
       '_amiga','_atari','_solaris', '_qnx', '_netware','_openbsd','_wdosx',
       '_palmos','_macos','_darwin','_emx','_watcom','_morphos','_netwlibc',
       '_win64','_wince','_gba','_nds','_embedded','_symbian','_nativent',
       '_iphonesim','_wii','_vse'
     );

And then this huge table is changed to the following:

     { This table is kept OS,Cpu because it is easier to maintain (PFV) }
     OSCpuPossible : array[TOS,TCpu] of boolean = (
       { os          i386    m68k  ppc    sparc  x86_64 arm    ppc64  avr    armeb  armel  mips   mipsel mips64 misp64el, s370}
       { linux }   ( true,  true,  true,  true,  true,  true,  true,  false, true,  false, false, true,  false,  false,  true),
       { go32v2 }  ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { win32 }   ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { os2 }     ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { freebsd } ( true,  true,  false, false, true,  false, false, false, false, false, false, false, false,  false,  false),
       { beos }    ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { haiku }   ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { netbsd }  ( true,  true,  true,  true,  false, false, false, false, false, false, false, false, false,  false,  false),
       { amiga }   ( false, true,  true,  false, false, false, false, false, false, false, false, false, false,  false,  false),
       { atari }   ( false, true,  false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { solaris } ( true,  false, false, true,  true,  false, false, false, false, false, false, false, false,  false,  false),
       { qnx }     ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { netware } ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { openbsd } ( true,  true,  false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { wdosx }   ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { palmos }  ( false, true,  false, false, false, true,  false, false, false, false, false, false, false,  false,  false),
       { macos }   ( false, false, true,  false, false, false, false, false, false, false, false, false, false,  false,  false),
       { darwin }  ( true,  false, true,  false, true,  true,  true,  false, false, false, false, false, false,  false,  false),
       { emx }     ( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { watcom }  ( true,  false, false, false ,false, false, false, false, false, false, false, false, false,  false,  false),
       { morphos } ( false, false, true,  false ,false, false, false, false, false, false, false, false, false,  false,  false),
       { netwlibc }( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { win64   } ( false, false, false, false, true,  false, false, false, false, false, false, false, false,  false,  false),
       { wince    }( true,  false, false, false, false, true,  false, false, false, false, false, false, false,  false,  false),
       { gba    }  ( false, false, false, false, false, true,  false, false, false, false, false, false, false,  false,  false),
       { nds    }  ( false, false, false, false, false, true,  false, false, false, false, false, false, false,  false,  false),
       { embedded }( true,  true,  true,  true,  true,  true,  true,  true,  true , false, false, false, false,  false,  false),
       { symbian } ( true,  false, false, false, false, true,  false, false, false, false, false, false, false,  false,  false),
       { nativent }( true,  false, false, false, false, false, false, false, false, false, false, false, false,  false,  false),
       { iphonesim }( true,  false, false, false, false, false, false, false, false, false, false, false, false, false,  false),
       { wii }     ( false, false, true,  false, false, false, false, false, false, false, false, false, false,  false,  false),
       { vse }     ( false, false, false, false, false, false, false, false, false, false, false, false, false,  false,  true)
     );

I compiled PP under Lazarus using parameters -dwin32 -di386 and it compiles without error, so the changes have not damaged the original compiler. The next thing to do is to see what happens when trying it with -ds370 -dlinux or -ds370 -dvse and see if it fails, crashes or just does nothing.

It does nothing. It compiles okay with both of these. Of course, the question now is where it would go to start code generation. That will take a while.

Go back to zSeriesGo Back to Part 2Go Forward to Part 4

An editor has declared this article to be a stub, meaning that it needs more information. Can you help out and add some? If you have some useful information, you can help the Free Pascal Wiki by clicking on the edit box on the left and expanding this page.