Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
VSE mini-clone
I have now proved the concept sufficiently.
If you write your programs a certain way, you can stand up a clone anywhere (e.g. you can run VSE programs on z/OS). But I have my own environment - z/PDOS-generic, so that's what I am using. Here is what a VSE program looks like when running: (I renamed the executable from pdptest.exe to vsetest.exe) 18:48:59 /(0009) vsetest.exe 18:48:59 got request to open vsetest.exe 18:48:59 in LoadVSE 18:48:59 about to call app at address 04ECE818 18:48:59 got service call 0 18:48:59 len is 8 18:48:59 msg is MADE IT! 18:48:59 got service call 7 18:48:59 return from app is hex 3 18:48:59 18:48:59 enter a command That same program running under DOS/VS: 19:00:12 BG 19:00:12 * 19:00:12 BG 19:00:12 * 19:00:12 BG 19:00:12 * Now run the app 19:00:12 BG 19:00:12 * 19:00:12 BG 19:00:12 MADE IT! 19:00:12 BG 19:00:12 * 19:00:12 BG Using this JCL: * First we get the main phase off tape, and into 80-byte blocks * using objmaint * // UPSI 1 // ASSGN SYS004,TAPE // DLBL UOUT,'PDPPUNCH.DAT',0,SD // EXTENT SYS005,,,,10000,2000 SPACE-PHASE // ASSGN SYS005,SYS000 // EXEC OBJMAINT,SIZE=AUTO ./COPY /* // UPSI 0 // ASSGN SYS005,SYSLST // ASSGN SYS004,UA * * * * * * * * Then we put the phase into the CIL, using LNKEDT * // DLBL IJSYSLN,,0,SD // EXTENT SYSLNK,,,,12000,2000 SPACE-LINK ASSGN SYSLNK,SYS000 // OPTION CATAL // DLBL IJSYSIN,'PDPPUNCH.DAT' ASSGN SYSIPT,SYS000 INCLUDE CLOSE SYSIPT,READER // EXEC LNKEDT ASSGN SYSLNK,UA * * * * * * * Now run the app * // EXEC PDPTEST,SIZE=AUTO,PARM='PaulEdwards two Three' And here is the program itself: 000000 40D7C8C1 E2C540D7 C4D7E3C5 E2E36BE2 PHASE PDPTEST,S 000010 4EE77DF0 F0F0F0F5 F07D4040 40404040 +X'000050' 000020 40404040 40404040 40404040 40404040 000030 40404040 40404040 40404040 40404040 000040 40404040 40404040 40404040 40404040 000050 02C5E2C4 40404040 40400010 40400001 .ESD .. .. 000060 D7C4D7E3 C5E2E340 007000C8 40001330 PDPTEST ...H ... 000070 40404040 40404040 40404040 40404040 000080 40404040 40404040 40404040 40404040 000090 40404040 40404040 40404040 F0F0F0F1 0001 0000A0 02E3E7E3 407000C8 40400038 40400001 .TXT ..H .. .. 0000B0 47F0F010 D7C7C3E7 00000004 00000000 .00.PGCX........ 0000C0 5810F070 58101000 12114780 F02C90EC ..0.........0... 0000D0 D00C41D0 D05018CF 47F0C040 18CF187E }..}}&...0{ ...= 0000E0 5830C074 5840C078 40404040 F0F0F0F2 ..{.. {. 0002 0000F0 02E3E7E3 40700100 40400038 40400001 .TXT ... .. .. 000100 5850C07C 41D0C088 4190D050 5090D04C .&{@.}{h..}&&.}< 000110 58F0C080 05EF58F0 C07418E7 5810C070 .0{....0{..X..{. 000120 58101000 12114780 C06E5BD0 C08458E0 ........{>$}{d.\ 000130 D00C980C D01407FE 40404040 F0F0F0F3 }.q.}... 0003 000140 02E3E7E3 40700138 40400038 40400001 .TXT ... .. .. 000150 007000D4 00000003 00000004 00000005 ...M............ 000160 0070122C 00000050 00000000 00000000 .......&........ ... 001AB0 05EF1F22 18F258D0 D00458ED 000C980C .....2.}}.....q. 001AC0 D01407FE 00000000 D4C1C4C5 40C9E35A }.......MADE IT! 001AD0 00000150 00701340 40404040 F0F0F8F5 ...&... 0085 001AE0 02E3E7E3 40701328 40400038 40400001 .TXT ... .. .. 001AF0 09000000 00000000 00701344 FFFF8000 ................ 001B00 00000007 00000008 00701250 47F0F00A ...........&.00. 001B10 055F5F73 766390EC D00C58F0 D04C50D0 .^^.....}..0}<&} 001B20 F00450F0 D00818DF 40404040 F0F0F8F6 0.&0}... 0086 001B30 02E3E7E3 40701360 40400038 40400001 .TXT ..- .. .. 001B40 18B105C0 5AF0C080 50F0D04C 58A0C084 ...{!0{.&0}<..{d 001B50 5820C088 58202000 12224770 C040D203 ..{h........{ K. 001B60 D058B000 D203D05C B004D203 D060B008 }...K.}*..K.}-.. 001B70 4110D058 58F0C08C 40404040 F0F0F8F7 ..}..0{. 0087 001B80 02E3E7E3 40701398 40400038 40400001 .TXT ..q .. .. 001B90 05EF182F 5020D068 47F0C06E 5820C088 ....&.}..0{>..{h 001BA0 58202000 D203D058 B000D203 D05CB004 ....K.}...K.}*.. 001BB0 D203D060 B0085820 220C4110 D05841F0 K.}-........}..0 001BC0 200005EF 182F5020 40404040 F0F0F8F8 ......&. 0088 001BD0 02E3E7E3 407013D0 40400028 40400001 .TXT ..} .. .. 001BE0 D06858F0 D06858D0 D00458ED 000C980C }..0}..}}.....q. 001BF0 D01407FE 00000070 007013F4 007000D4 }..........4...M 001C00 007010F0 00701364 40404040 40404040 ...0.... 001C10 40404040 40404040 40404040 F0F0F8F9 0089 001C20 02D9D3C4 40404040 40400038 40404040 .RLD .. 001C30 00010001 0D700138 0D700148 0D7011C8 ...............H 001C40 0D7011D4 0D7011D8 0D701224 0D701228 ...M...Q........ 001C50 0D701324 0D701330 0D701340 0D7013E8 ........... ...Y 001C60 0D7013EC 0C7013F0 40404040 F0F0F9F0 .......0 0090 001C70 02D9D3C4 40404040 40400004 40404040 .RLD .. 001C80 00010001 0D7013F4 40404040 40404040 .......4 001C90 40404040 40404040 40404040 40404040 001CA0 40404040 40404040 40404040 40404040 001CB0 40404040 40404040 40404040 F0F0F9F1 0091 001CC0 02C5D5C4 407000C8 40404040 40400001 .END ..H .. 001CD0 40404040 40404040 40404040 40404040 001CE0 40404040 40404040 40404040 40404040 001CF0 40404040 40404040 40404040 40404040 001D00 40404040 40404040 40404040 F0F0F9F2 0092 001D10 615C4040 40404040 40404040 40404040 /* 001D20 40404040 40404040 40404040 40404040 001D30 40404040 40404040 40404040 40404040 001D40 40404040 40404040 40404040 40404040 001D50 40404040 40404040 40404040 40404040 (and attached in full) There is still one technical problem I'm waiting on (malformed RLD), but it doesn't stop it from running. The technique I am using involves getting z/PDOS-generic to zap the executable on loading. The start assembler needs to look like this: __crt0: B skiphdr # .byte "PGCX" # PDOS-generic (or compatible) extension # Needs to be in EBCDIC .byte 0xd7, 0xc7, 0xc3, 0xe7 # .long 4 # length of header data .DC F'4' .globl __pgparm __pgparm: .long 0 # This will be zapped by z/PDOS-generic if running under it skiphdr: L R1,=V(__pgparm) L R1,0(,R1) LTR R1,R1 BZ notpdos STM r14,r12,12(r13) LA r13,80(,r13) LR r12,r15 .drop r15 .using __crt0, r12 B BYPASS1 notpdos: LR r12,r15 pgparm gets zapped by z/pdos-generic like this: #ifdef NEED_VSE os.Xservice = service_call; if (memcmp(entry_point + 4, "PGCX", 4) == 0) { *(void **)(entry_point + 12) = &os; } #endif Service calls are handled like this: #ifdef NEED_VSE #include <mfsup.h> static int service_call(int svcnum, void *a, void *b) { printf("got service call %d\n", svcnum); if (svcnum == 0) { REGS *regs; CCB *ccb; CCW *ccw; char *msg; regs = a; ccb = (CCB *)regs->r[1]; ccw = ccb->actual.ccw_address; msg = (char *)(ccw->actual.addr & 0xffffff); printf("len is %d\n", ccw->actual.len); printf("msg is %.*s\n", ccw->actual.len, msg); } return (0); } #endif This C code in the application avoids doing a real SVC: int __svc(int svcnum, void *regsin, void *regsout) { if (__pgparm == 0) { return (__svcreal(svcnum, regsin, regsout)); } else { return (__pgparm->Xservice(svcnum, regsin, regsout)); } } On real DOS/VSE (or z/VSE) it will do a real SVC. It is my intention to stand up CMS and MVS mini-clones the same way. To the point where they can at least run arbitrary C programs. I'm not sure what to do then though. I'm not sure if there is a market for a mini clone of a mainframe OS. I'm not necessarily trying to be in a market though. But maybe it would be good if someone else was so that IBM had some competition. I was thinking of maybe setting up a rival to India in Vietnam. BFN. Paul. |
// DLBL IJSYSLN,,0,SD // EXTENT SYSLNK,,,,12000,2000 SPACE-LINK ASSGN SYSLNK,SYS000 // OPTION CATAL // DLBL IJSYSIN,'PDPPUNCH.DAT' ASSGN SYSIPT,SYS000? ?INCLUDE CLOSE SYSIPT,READER // EXEC LNKEDT ASSGN SYSLNK,UA What?is the purpose of this? ASSGN SYSLNK,SYS000 When you do this... ASSGN SYSIPT,SYS000? you override your SYSLNK?assignment. Joe On Sat, Sep 14, 2024 at 6:16?AM Paul Edwards via <mutazilah=[email protected]> wrote: I have now proved the concept sufficiently. |
On Sat, Sep 14, 2024 at 08:29 PM, Joe Monk wrote:
I don't know how it works, but I found what I believe is the source of the syntax: compvse.m4 in my fork of gcc 3.2.3 * assemble %s * // DLBL IJSYSLN,,0,SD // EXTENT SYSLNK,,,,14000,1000 SPACE-PHASE ASSGN SYSLNK,SYS000 // OPTION LINK // OPTION CATAL,LIST PHASE %s,S+80 // DLBL IJSYSIN,'%s.ASM' ASSGN SYSIPT,SYS000 // EXEC ASSEMBLY CLOSE SYSIPT,READER * * * * * link %s * INCLUDE VSESTART INCLUDE STDIO INCLUDE STRING INCLUDE STDLIB INCLUDE CTYPE INCLUDE ERRNO INCLUDE LOCALE INCLUDE MATH INCLUDE SIGNAL INCLUDE SETJMP INCLUDE ASSERT INCLUDE TIME INCLUDE START INCLUDE VSESUPA ENTRY @@MAIN // EXEC LNKEDT ASSGN SYSLNK,UA * BFN. Paul. |
to navigate to use esc to dismiss