diff --git a/.github/build.sh b/.github/build.sh index 854f7ed0..272c7e17 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -14,9 +14,9 @@ mkdir Shrine.out # workaround fs bug in HolyCRT (fails to create necessary directories) mkdir -p Shrine.out/Compiler Shrine.out/Kernel -env STARTOS=BuildShrine ./$BIN --drive=C,..,Shrine.out +env STARTOS=Build/BuildShrine ./$BIN --drive=C,..,Shrine.out -ISO_FILE=Shrine.out/Tmp/ShrineDist.ISO.C +ISO_FILE=Shrine.out/Shrine.ISO ISO_SIZE=$(wc -c <$ISO_FILE) MIN_SIZE=100000 if [ $ISO_SIZE -le $MIN_SIZE ]; then diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cff3a6a3..d70fab2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,4 +17,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: ShrineDist.ISO - path: .build/Shrine.out/Tmp/ShrineDist.ISO.C + path: .build/Shrine.out/Shrine.ISO diff --git a/Adam/AutoComplete/ACDefs.DATA b/Adam/AutoComplete/ACDefs.DATA deleted file mode 100644 index b33e19dc..00000000 Binary files a/Adam/AutoComplete/ACDefs.DATA and /dev/null differ diff --git a/BuildShrine.HC b/Build/BuildShrine.HC similarity index 63% rename from BuildShrine.HC rename to Build/BuildShrine.HC index 7ff7dc2d..ab1bf29c 100644 --- a/BuildShrine.HC +++ b/Build/BuildShrine.HC @@ -25,8 +25,23 @@ WinVert(2,10); if (DrvIsWritable) DirMk("/Tmp"); //Good to have a Tmp -DirMk("/Home"); +DirMk("/Home"); // needed why? -DirMk("/0000Boot"); +DirMk("/0000Boot"); // needed why? #include "/Adam/Opt/Boot/MakeBoot" -#include "/Misc/DoDistro" +#include "/Adam/Opt/Utils/MakeUtils" + +Cd(__DIR__);; + +#include "ShrineCfg" +#include "ShrineDistro" + +// Make 128MB RAMdisk B: (Distro tree + ISO are built here) +CBlkDev* res; +res=BlkDevNextFreeSlot('B',BDT_RAM); +res->unit = 0; +res->max_blk = 0x40000-1; +BlkDevAdd(res,,TRUE,TRUE); + +MakeStdDistro; +CopySingle("B:/Shrine.ISO.C", "C:/Shrine.ISO"); diff --git a/Build/ShrineCfg.HC b/Build/ShrineCfg.HC new file mode 100644 index 00000000..03b034a7 --- /dev/null +++ b/Build/ShrineCfg.HC @@ -0,0 +1,61 @@ +#help_index "Misc/TOS/Cfg" + +#define SLOP BLK_SIZE + +U0 TOSDbgDistro1() +{ + CBinFile *bfh=mem_boot_base-sizeof(CBinFile); + bfh(I64)+=bfh->file_size-1; + DefinePrint("TOS_DBG_DISTRO","0x%X", + CeilI64(SYS_KERNEL_END+SLOP,BLK_SIZE)); + DefinePrint("TOS_DBG_DISTRO_END", "0x%X",FloorI64( + (BOOT_RAM_LIMIT-(BOOT_STK_SIZE+DVD_BOOT_LOADER_SIZE))>>4<<4- + (bfh(I64)-SYS_KERNEL_END)-SLOP,BLK_SIZE)); + DefinePrint("CFG_DBG_DISTRO_FILE","\"/Tmp/DbgDistro.BIN.Z\""); +} TOSDbgDistro1; + +U0 TOSDbgDistro2() +{ + DefinePrint("CFG_DBG_DISTRO","\"a0x%X\n0x%X\n\"",TOS_DBG_DISTRO, + (TOS_DBG_DISTRO_END-TOS_DBG_DISTRO)/BLK_SIZE); + DefinePrint("CFG_DBG_DISTRO_START","\"0x%X\"",TOS_DBG_DISTRO); +} TOSDbgDistro2; + +U0 TOSInit() +{ + switch (0) { + case 1: //TAD Native Machine + DefinePrint("CFG_RAM_DRVS", + "\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\""); + DefinePrint("CFG_HARD_DRVS","\"C\ns0xFE00\n0xFE10\n0\""); + DefinePrint("CFG_DVD_DRVS","\"Ts0x1F0\n1\""); + DefinePrint("CFG_DSK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\""); + DefinePrint("TOS_HDS","\"CD\""); + DefinePrint("TOS_MASTER_BOOT_DRVS","\"C\""); + break; + default: + DefinePrint("CFG_RAM_DRVS", + "\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\""); + DefinePrint("CFG_HARD_DRVS","\"\""); + DefinePrint("CFG_DVD_DRVS","\"\""); + DefinePrint("CFG_DSK_CACHE","\"Scale2Mem(0x80000,0x8000000)\n\""); + DefinePrint("TOS_HDS","\"CD\""); + DefinePrint("TOS_MASTER_BOOT_DRVS","\"C\""); + } +} TOSInit; + +#define TOS_ISO_NAME "B:/Shrine.ISO.C" +#define TOS_DISTRO_DIR "B:/Distro" +#define CFG_OPTS "StaffMode\nMountIDEAuto\nCT\n" +#define CFG_DBG_OPTS "StaffMode\nMountIDEAuto\nCT"\ + "HeapInit\n130\nMemInit\n131\nVarInit\n132\n\n" +#define CFG_DBGZ_OPTS "StaffMode\nMountIDEAuto\nCT"\ + "HeapInit\n0\nMemInit\n0\nVarInit\n0\n\n" +#define TOS_CFG "\n" CFG_RAM_DRVS CFG_DVD_DRVS CFG_HARD_DRVS "\n"\ + CFG_DSK_CACHE CFG_OPTS +#define TOS_DVD_CFG "TB\n0x20000\nT \n\n\nStaffMode\nMountIDEAuto\nCT\n" +#define TOS_DVD_DBG_CFG "A" CFG_DBG_DISTRO\ + "B\nScale2Mem(2048,0x40000)\n\n\n"\ + "NoMP\nTextMode\nDontProbe\nDbgDistro\n"\ + "C:" CFG_DBG_DISTRO_FILE "\n"\ + CFG_DBG_DISTRO_START "\n\n" diff --git a/Build/ShrineDistro.HC b/Build/ShrineDistro.HC new file mode 100644 index 00000000..73eca54b --- /dev/null +++ b/Build/ShrineDistro.HC @@ -0,0 +1,401 @@ +//The CFG defines are $LK,"~/TOS/TOSCfg.HC",A="FI:::/Demo/AcctExample/TOS/TOSCfg.HC"$. + +#define MAKE_LITE 0 +#define MAKE_DBG 0 +#define MAKE_STAFF 0 + +public U8 TOSGetDrv() +{//Pmt for drv let. + I64 res; + "Drive (%s):",TOS_HDS; + res=Let2Let(GetChar); + '\n'; + return res; +} + +public U0 TOSBootHDIns(U8 drv_let=0) +{//Make Compiler and Kernel. Reinstall Kernel. + drv_let=Let2Let(drv_let); + In(TOS_CFG); + BootHDIns(drv_let); + if (StrOcc(TOS_MASTER_BOOT_DRVS,drv_let)) + BootMHDIns(drv_let); +} + +public U0 TOSCopyDrv(U8 src,U8 dst) +{//Fmt dst and copy entire drv. + U8 buf_s[STR_LEN],buf_d[STR_LEN]; + src=Let2Let(src); + dst=Let2Let(dst); + + if (dst=='D') + Fmt(dst,,FALSE,FSt_FAT32); + else + Fmt(dst,,FALSE,FSt_REDSEA); + + StrPrint(buf_s,"%c:/",src); + StrPrint(buf_d,"%c:/",dst); + CopyTree(buf_s,buf_d); + + DocClear; + Drv(dst); + TOSBootHDIns(dst); +} + +public U0 TOSPmtAndCopyDrv() +{//Pmt for drv lets. Then, Fmt dst and copy entire drv. + I64 src,dst; + "$$RED$$\nCopy Src Drive:\n$$FG$$"; + src=TOSGetDrv; + "$$RED$$\nCopy Dst Drive:\n$$FG$$"; + dst=TOSGetDrv; + TOSCopyDrv(src,dst); +} + +U0 DistroPrep() +{ + AOnceFlush; //Don't want in Registry + OnceFlush; + + Del("/Home/Demo*"); + DelTree("/Home/*Tmp.DD.Z"); + + DelTree("/Tmp"); + DirMk("/Tmp"); + DirMk("/Tmp/ScrnShots"); + + Touch("/PersonalMenu.DD.Z","+T"); + Touch("/Home/PersonalMenu.DD.Z","+T"); + + DelTree("/Demo/AcctExample"); + CopyTree("/Home","/Demo/AcctExample"); + DelTree("/Demo/AcctExample/TAD"); + DelTree("/Demo/AcctExample/Sup1"); + DelTree("/Demo/AcctExample/Sup2"); + DelTree("/Demo/AcctExample/Sup3"); + Del("/Demo/AcctExample/Test*"); + if (FileFind("~/Sup1/Sup1Utils/SortHeaders.HC.Z")) + ExeFile("~/Sup1/Sup1Utils/SortHeaders.HC.Z"); + + // CursorRem("/*"); + DelTree("/Demo/*.BI*"); + // S2T("/*","+r+S"); + // DocOpt("/*","+R"); + Move(ACD_DEF_FILENAME,ACD_DEF_FILENAME_Z); +} + +U0 DbgDistroFilePrep() +{ + CBlkDev *bd; + if (!Let2Drv('A',FALSE)) { + In(CFG_DBG_DISTRO "\n"); + Mount; + } + bd=Let2BlkDev('A'); + Fmt('A',,FALSE,FSt_REDSEA); + + DirMk("A:/Compiler"); + Copy("C:/Compiler/Compiler.BIN.Z", "A:/Compiler"); + Copy("C:/Compiler/OpCodes.DD.Z", "A:/Compiler"); + Copy("C:/Compiler/CompilerA.HH.Z", "A:/Compiler"); + Copy("C:/Compiler/CompilerB.HH.Z", "A:/Compiler"); + + DirMk("A:/Kernel"); + Copy("C:/Kernel/*.HH*", "A:/Kernel"); + CopyTree("C:/Kernel/BlkDev", "A:/Kernel/BlkDev"); + + Copy("C:/Home/Sup1/Sup1Distro/DbgStartOS.HC.Z","A:/StartOS.HC.Z"); + + DirMk("A:/Adam"); + Copy("C:/Home/Sup1/Sup1Distro/DbgMakeAdam.HC.Z","A:/Adam/MakeAdam.HC.Z"); + Copy("C:/Home/Sup1/Sup1Distro/DbgMount.HC.Z","A:/Adam"); + Copy("C:/Adam/AExts.HC.Z", "A:/Adam"); + Copy("C:/Adam/AMath.HC.Z", "A:/Adam"); + Copy("C:/Adam/Training.HC.Z","A:/Adam"); + Copy("C:/Adam/AMem.HC.Z", "A:/Adam"); + Copy("C:/Adam/TaskRep.HC.Z", "A:/Adam"); + + FileWrite("C:" CFG_DBG_DISTRO_FILE, + bd->RAM_dsk,(bd->max_blk+1)<catch_except=TRUE; +} +UpdateISODocDefines; + + +I64 tos_progress; +F64 tos_progress_t0; + +U0 TOSProgress(U8 *st) +{ + U8 buf[STR_LEN]; + progress4=tos_progress; + progress3_max=1; + *progress4_desc=0; + progress4_max=9+MAKE_LITE+MAKE_DBG+MAKE_STAFF; + progress4_t0=tos_progress_t0; + StrPrint(buf,"%d. %s",++progress4,st); + "$$PURPLE$$$$TX+CX,\"%s\"$$$$FG$$\n",buf; + StrCpy(progress3_desc,buf); + tos_progress=progress4; +} + +public U0 DskChkAll() +{//DskChk on C & D. + U8 *ptr=TOS_HDS; + while (*ptr) { + "DskChk('%c')\n",*ptr; + DskChk(*ptr++,TRUE); + } +} + +U0 TOSRegen2() +{ + // I64 slash_home=0; + SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$ + tos_progress=-1; + tos_progress_t0=tS; + RegExe("TempleOS/TOSRegen"); + + TOSProgress("DskChk All"); + AutoComplete; + WinBorder; + WinMax; + DskChkAll; + + TOSProgress("Update Line Cnts"); + UpdateLineCnts; + + TOSProgress("Copy C to D"); + TOSCopyDrv('C','D'); + + TOSProgress("Make Standard Distro ISO"); + MakeStdDistro; + DocClear; + Move(TOS_ISO_NAME,"D:/Downloads/TOS_Distro.ISO"); + + TOSProgress("Make Supplemental1 ISO"); + RedSeaISO("D:/Downloads/TOS_Supplemental1","C:/Home/Sup1"); + + TOSProgress("Make Supplemental2 ISO"); + RedSeaISO("D:/Downloads/TOS_Supplemental2","C:/Home/Sup2"); + + TOSProgress("Make Supplemental3 ISO"); + RedSeaISO("D:/Downloads/TOS_Supplemental3","C:/Home/Sup3"); + +#if MAKE_LITE + TOSProgress("Make Lite Distro ISO"); + MakeLiteDistro; + DocClear; + Move(TOS_ISO_NAME,"D:/Downloads/TOS_Lite.ISO"); +#endif +#if MAKE_DBG + TOSProgress("Make Dbg Distro ISO"); + MakeDbgDistro; + DocClear; + Move(TOS_ISO_NAME,"D:/Downloads/TOS_Dbg.ISO"); +#endif +#if MAKE_STAFF + TOSProgress("Make Staff Distro ISO"); + MakeStaffDistro; + DocClear; + Move(TOS_ISO_NAME,"D:/Downloads/TOS_Staff.ISO"); +#endif + + UpdateISODocDefines; + Cd("C:/"); + DocClear; + + TOSProgress("Check for Long Lines"); + if (LongLines) + throw; + + DocClear; + TOSProgress("Check for Broken DolDoc Links"); + if (LinkChk) + throw; + + // TOSProgress("Find /Home"); + // slash_home=F2("/Home","-i+la"); + + TOSProgress("DskChk All"); + Drv('C'); + DskChkAll; + + TOSProgress("Done"); + SettingsPop; + // "F2(\"/Home\") Cnt\t:%d\n",slash_home; + "Elapsed Time\t:%5.3fs\n",tS-progress4_t0; + ProgressBarsRst("TempleOS/TOSRegen"); +} + +public U0 TOSRegen() +{//Generate distro ISO's + TOSBootHDIns('C'); + Once("TOSRegen2;"); + BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CFG",A="PF:::/Demo/AcctExample/TOS/TOSCfg.HC,TOS_CFG"$. +} diff --git a/Demo/AcctExample/TOS/TOSCfg.HC b/Demo/AcctExample/TOS/TOSCfg.HC index 19d19960..1f0e68e4 100644 --- a/Demo/AcctExample/TOS/TOSCfg.HC +++ b/Demo/AcctExample/TOS/TOSCfg.HC @@ -23,7 +23,7 @@ U0 TOSDbgDistro2() U0 TOSInit() { - switch (INS_REG_MACHINE_NUM) { + switch (0) { case 1: //TAD Native Machine DefinePrint("CFG_RAM_DRVS", "\"B\nScale2Mem(2048,0x100000,4*1024*1024*1024)\n\""); diff --git a/Misc/DoDistro.HC b/Misc/DoDistro.HC index 8f6a106c..09d36ade 100644 --- a/Misc/DoDistro.HC +++ b/Misc/DoDistro.HC @@ -31,7 +31,7 @@ U0 MakeMyISO(U8 *_out_iso_filename) CopyTree("/Misc", "/Distro/Misc"); //To save space, optionally delete dictionary. - Del("/Distro/Adam/AutoComplete/ACDefs.DATA"); + //Del("/Distro/Adam/AutoComplete/ACDefs.DATA"); CopyTree("/Downloads","/Distro/Downloads"); //You can leave this out. DirMk("/Distro/Tmp"); DirMk("/Distro/Tmp/ScrnShots"); @@ -44,6 +44,6 @@ U0 MakeMyISO(U8 *_out_iso_filename) Free(out_iso_filename); } -MakeMyISO("/Tmp/ShrineDist.ISO.C"); +MakeMyISO("/Tmp/MyDistro.ISO.C"); // Study my account examples $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.