PASE Nut Shell
Email from a IBM i community member to PASE team (me):
>> To most, including me, it (PASE) is just "the other side I rarely use". ... E-x-a-c-t-l-y. ... folks do not know and do not care PASE runs Java, PHP, SAP, and many other popular products on IBM i. ... only when you cross paths from "consumer" to "provider" does PASE become a mountain of knowledge to scale. ... but we do want to grow our IBM i "PASE Geek Squad" (ala Best Buy), so i am here to help
IBM i PASE Option 33 — installed on your IBM i machine, quietly running many popular products on IBM i (Java, PHP, SAP, etc.), but often shrouded in all the mystery of a good Indiana Jones movie.For those wishing to understand PASE with possibility of becoming a “provider” of PASE products (PHP, Ruby, etc.), you need a basic understanding of PASE expanded/enhanced IBM i job/processes.
PASE unveiled …
Put simply, AIX compiled binary code (PHP) is able to run inside same process as your ILE programs (RPG) “sharing” IBM i SLIC (OS/400 kernel) and Power PC hardware (figure below). IBM i PASE Option 33 re-distributes many common AIX binaries, so that you/customer do not have to go FTP them from another AIX machine (yep FTP binaries … just that simple … mostly)
"IBM i process/job shared kernel trick" WRKACTJOB picture below shows PASE PHP running in the same job as any ILE RPG program (or any IBM i system API, etc.) One job/process running both PASE binaries and ILE programs using the SAME SLIC kernel ("the trick"). -- WRKACTJOB -- :-------->ZEND2/QTMHHTTP/583559<------------: : : : |----------|---------| | : | |----------|---------| | PASE | | : | | OS/400 | | PHP libc.a | | : | | *PGM *SRVPGM | ========================| : |======================== MI (OS/400) AIX/PASE SYSCALL | : |MI instructions privileged mode boundary| : |privileged mode boundary ========================| : |======================== | IBM i SLIC kernel, same for OS/400 + PASE | | (completely replaced AIX kernel /unix) | |---------------------------------------------------| | POWER PC hardware processor | |---------------------------------------------------|
Notes:
- PASE/AIX compiled binaries are NOT emulated in any way, but instead run directly on same Power PC hardware processor (in same IBM i job/process due to “shared” SLIC).
- Power PC processor supports both AIX 32-bit binaries and 64-bit binaries, therefore PASE supports both 32/64-bit AIX binaries
- PASE will only allow you to run one model 32 or 64 in a single process/job (because AIX only allows one model in single process).
- PASE and ILE programs share same SLIC kernel, and also share same basic exception/signal processing
- PASE/ILE fit was not exact (in favour of ILE), so you often find you need to be careful around the termination/exception/signal coding
- PASE memory for program run stack/heap/shared memory is acquired from same SLIC teraspace pools use by ILE *PGM/*SRVPGM, however, PASE can ONLY see memory that PASE acquired through it’s own syscall APIs (teraspace memory alias mapped into PASE 32/64 bit process)
- to wit, ILE can see all of PASE memory if address is passed, but PASE can only see chucks of ILE memory, so ILE address passed to PASE may not be visible
- V6R1+, ILE and OPM program models are better converged, so PASE memory can also be used by OPM programs
- HEY, isn’t about time you moved up beyond V5R4???
With simple knowledge of “SLIC kernel sharing”, sharing memory model (teraspace), sharing exception/signal model, etc., you can use the APIs that PASE team added to both ILE (Qp2CallPase, etc.) and PASE side (_ILECALL, _PGMCALL, etc.) to call PASE<>ILE (yes, call PASE works from RPG as well, see XMLSERVICE code this site if you want a really fancy application template)
- Example code ILE<>PASE
- (ILE-2-PASE) Example
- (PASE -2-ILE) Example
- RPG < call > PASE Running example RPG program loading PASE shared library and calling function (PASE libmy.a → accounts)
- More …
- PASE −2-ILE functions in examples above are exactly how PASE calls DB2 CLI functions to enable PHP function like ibm_db2, pdo_ibm, odbc, etc. (PASE libdb400.a)
- same story for Java JDBC … same for SAP … and on and on …
- a case of learn a few APIs and the whole ILE<>PASE world falls right in your lap (± exception/signal/termination processing)
Most everything else to reach expanded knowledge you get reading IBM i manuals (ILE side) and the AIX manuals (PASE side).
For those that-read-all-fine-print … PASE tends to run 80–90% of all popular functions of AIX needed to run most popular software (Java, PHP, SAP, etc.), but it is NOT a complete AIX system (please buy AIX system for that). So here is an idea of what PASE decided not to support …
- … system management functions of AIX generally do not work (smit, etc.), because IBM i has it’s own (RSTLICPGM, etc.)
- … performance tools do not work the same as AIX, because IBM i has it own
- … “real time” functions tend not to work same (REAL CLOCK, etc.), because unlike AIX/Unix, IBM i is NEVER intended to launch/guide ordnance, etc,
- … tooling, tooling, tooling, … yep “geek” discussion, we just don’t have it all on IBM i (not an AIX developer machine)
CCSID issues
Have CCSID issues? Junk characters? Nothing works?
- IBM i actions, see CCSID
Author(s)
Tony “Ranger” Cairns - IBM i PHP / PASE