Browse Source

Use MakeStdDistro instead of DoDistro and clean up a bunch

v6
minexew 1 year ago
parent
commit
4b873b8395
  1. 4
      .github/build.sh
  2. 2
      .github/workflows/build.yml
  3. BIN
      Adam/AutoComplete/ACDefs.DATA
  4. 21
      Build/BuildShrine.HC
  5. 61
      Build/ShrineCfg.HC
  6. 401
      Build/ShrineDistro.HC
  7. 2
      Demo/AcctExample/TOS/TOSCfg.HC
  8. 4
      Misc/DoDistro.HC

4
.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

2
.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

BIN
Adam/AutoComplete/ACDefs.DATA

Binary file not shown.

21
BuildShrine.HC → 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");

61
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"

401
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)<<BLK_SIZE_BITS);
}
U0 StdDistroPrep()
{
Drv('C');
DistroPrep;
In(STD_DISTRO_DVD_CFG);
BootDVDIns('C');
Fmt('B',,FALSE,FSt_REDSEA);
DelTree(TOS_DISTRO_DIR);
DirMk(TOS_DISTRO_DIR);
CopyTree("C:/0000Boot",TOS_DISTRO_DIR "/0000Boot");
CopyTree("C:/Adam",TOS_DISTRO_DIR "/Adam");
CopyTree("C:/Apps",TOS_DISTRO_DIR "/Apps");
CopyTree("C:/Compiler",TOS_DISTRO_DIR "/Compiler");
CopyTree("C:/Demo",TOS_DISTRO_DIR "/Demo");
CopyTree("C:/Doc",TOS_DISTRO_DIR "/Doc");
CopyTree("C:/Downloads",TOS_DISTRO_DIR "/Downloads");
DirMk(TOS_DISTRO_DIR "/Home");
CopyTree("C:/Kernel",TOS_DISTRO_DIR "/Kernel");
CopyTree("C:/Misc",TOS_DISTRO_DIR "/Misc");
// CopyTree("C:/User",TOS_DISTRO_DIR "/User");
Copy("C:/HomeKeyPlugIns.HC", TOS_DISTRO_DIR "/");
Copy("C:/HomeLocalize.HC", TOS_DISTRO_DIR "/");
Copy("C:/HomeSys.HC", TOS_DISTRO_DIR "/");
Copy("C:/HomeWrappers.HC", TOS_DISTRO_DIR "/");
Copy("C:/MakeHome.HC", TOS_DISTRO_DIR "/");
Copy("C:/Once.HC", TOS_DISTRO_DIR "/");
Copy("C:/PersonalMenu.DD", TOS_DISTRO_DIR "/");
Copy("C:/PersonalNotes.DD", TOS_DISTRO_DIR "/");
Copy("C:/StartOS.HC", TOS_DISTRO_DIR "/");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
}
U0 MakeStdDistro()
{
StdDistroPrep;
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
"Written %s.\n", TOS_ISO_NAME;
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
U0 LiteDistroPrep()
{
Drv('C');
DistroPrep;
In(STD_DISTRO_DVD_CFG);
BootDVDIns('C');
Fmt('B',,FALSE,FSt_REDSEA);
DelTree(TOS_DISTRO_DIR);
CopyTree("C:/",TOS_DISTRO_DIR "/");
DelTree(TOS_DISTRO_DIR "/Home");
DirMk(TOS_DISTRO_DIR "/Home");
DelTree(TOS_DISTRO_DIR "/Apps");
DelTree(TOS_DISTRO_DIR "/Demo");
Copy(TOS_DISTRO_DIR "/Demo/Games/Talons.HC.Z",TOS_DISTRO_DIR "/Home");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACDefs.DATA.Z");
Del(TOS_DISTRO_DIR "/Adam/AutoComplete/ACWords.DATA.Z");
Del(TOS_DISTRO_DIR "/Misc/Bible.TXT.Z");
}
U0 MakeLiteDistro()
{
LiteDistroPrep;
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
U0 DbgDistroPrep()
{
Drv('C');
DistroPrep;
DbgDistroFilePrep;
In(TOS_DVD_DBG_CFG);
BootDVDIns('C');
Fmt('B',,FALSE,FSt_REDSEA);
DelTree(TOS_DISTRO_DIR);
CopyTree("C:/",TOS_DISTRO_DIR "/");
DelTree(TOS_DISTRO_DIR "/Home");
DirMk(TOS_DISTRO_DIR "/Home");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
}
U0 MakeDbgDistro()
{
DbgDistroPrep;
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_DBG_SIZE",
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
U0 StaffDistroPrep()
{
Drv('C');
DistroPrep;
In(TOS_DVD_CFG);
BootDVDIns('C');
Fmt('B',,FALSE,FSt_REDSEA);
DelTree(TOS_DISTRO_DIR);
CopyTree("C:/",TOS_DISTRO_DIR "/");
DelTree(TOS_DISTRO_DIR "/Home/Sup1");
DelTree(TOS_DISTRO_DIR "/Home/Sup2");
DelTree(TOS_DISTRO_DIR "/Home/Sup3");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
}
U0 MakeStaffDistro()
{
StaffDistroPrep;
RedSeaISO(TOS_ISO_NAME,TOS_DISTRO_DIR,TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
DefinePrint("DD_TEMPLEOS_STAFF_SIZE",
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
0.1*(10*Size(TOS_ISO_NAME,"+s")/1024/1024));
Drv('C');
}
I64 UpdateLineCnts()
{
I64 res;
DocClear;
Drv('C');
DistroPrep;
Cd("C:/");
DelTree("B:/TOS/TOS");
CopyTree("C:/Home","B:/TOS/TOS");
DelTree("C:/Home");
DocMax;
DocClear;
res=LineRep("C:/*","-r")+LineRep("C:/Adam/*")+
LineRep("C:/Compiler/*","-S+$$")+LineRep("C:/Kernel/*");
CopyTree("B:/TOS/TOS","C:/Home");
DelTree("B:/TOS/TOS");
DocTreeFWrite("C:/Adam/ADefine.HC.Z","LineRep",
"DefinePrint(\"DD_TEMPLEOS_LOC\",\"%,d\");\n",res);
DefinePrint("DD_TEMPLEOS_LOC","%,d",res);
"Total LOC:%12,d\n\n",res;
return res;
}
U0 UpdateISODocDefines()
{
try {
DefinePrint("DD_TEMPLEOSCD_SIZE",
"Download $TX,"TempleOS V5.03",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1*(10*Size("D:/Downloads/TOS_Distro.ISO","+s")/1024/1024));
DefinePrint("DD_TEMPLEOSCD_K_SIZE",
"%dKB",Size("D:/Downloads/TOS_Distro.ISO","+s")/1024);
} catch
Fs->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"$.
}

2
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\"");

4
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"$.

Loading…
Cancel
Save