TempleOSCDV5.01.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:48:15 +02:00
1 parent f6eacf7744
commit 320c7ee98a
219 files changed
+5211 -4853

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
//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"$
#include "BootDVD"
#include "DskISORedSea"
+1 -1
View File
@@ -1,5 +1,5 @@
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
//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"$
#include "BootHD"
+1 -1
View File
@@ -1,5 +1,5 @@
//See $LK,"Install Documentation",A="FI:::/Doc/Install.DD"$ or $LK,"Upgrading Documentation",A="FI:::/Doc/Upgrade.DD"$.
//Study my account examples: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOSDistro.HC,1"$
//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"$
#include "BootMHD"
#include "BootMHD2"
+1 -1
View File
@@ -36,7 +36,7 @@ public U0 BootRAM(U8 *filename=NULL)
CKernel *hi_image,*lo_image=mem_boot_base-sizeof(CBinFile),
reg *sys_ram_reboot;
if (!filename)
filename="::/Kernel/" KERNEL_BIN_C;
filename="::/" KERNEL_BIN_C;
do if (!(hi_image=FileRead(filename,&size))) return;
while (hi_image<0x100000); //If alloc from low 640K, just get another copy.
+40 -36
View File
@@ -142,43 +142,47 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
CDrv *dv=DrvMakeFreeSlot(DrvNextFreeLet('Q')); //First $LK,"BDT_ISO_FILE_WRITE",A="MN:BDT_ISO_FILE_WRITE"$
CBlkDev *bd=BlkDevNextFreeSlot(dv->drv_let,BDT_ISO_FILE_WRITE);
if (!_iso_filename)
_iso_filename=blkdev.dft_iso_filename;
iso_filename=ChgExt(_iso_filename,"ISO.C");
src_dir=DirNameAbs(_src_dir);
if (_stage2_filename) {
stage2_filename=FileNameAbs(_stage2_filename);
*stage2_filename=dv->drv_let;
i=StrLen(src_dir);
if (i!=3) //If not head
i++; //Skip slash
StrCpy(stage2_filename+3,stage2_filename+i);
} else
stage2_filename=NULL;
tmpde=FilesFind(src_dir,FUF_RECURSE);
root_cnt=LinkedLstCnt(tmpde)+3;
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
bitmap_blks=1;
do {
bitmap_blks1=bitmap_blks;
bitmap_blks=(res+bitmap_blks+BLK_SIZE<<3-1)/BLK_SIZE<<3;
} while (bitmap_blks!=bitmap_blks1);
if (!IsDir(_src_dir))
PrintErr("'%s' is not a dir.\n",_src_dir);
else {
if (!_iso_filename)
_iso_filename=blkdev.dft_iso_c_filename;
iso_filename=ChgExt(_iso_filename,"ISO.C");
src_dir=DirNameAbs(_src_dir);
if (_stage2_filename) {
stage2_filename=FileNameAbs(_stage2_filename);
*stage2_filename=dv->drv_let;
i=StrLen(src_dir);
if (i!=3) //If not root
i++; //Skip slash
StrCpy(stage2_filename+3,stage2_filename+i);
} else
stage2_filename=NULL;
tmpde=FilesFind(src_dir,FUF_RECURSE);
root_cnt=LinkedLstCnt(tmpde)+3;
root_dir_blks=CeilU64(root_cnt<<6,BLK_SIZE)>>BLK_SIZE_BITS;
if (res=RedSeaISOPass1(tmpde)>>BLK_SIZE_BITS) {
bd->drv_offset=19<<2+(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;
bitmap_blks=1;
do {
bitmap_blks1=bitmap_blks;
bitmap_blks=(res+bitmap_blks+BLK_SIZE<<3-1)/BLK_SIZE<<3;
} while (bitmap_blks!=bitmap_blks1);
bd->max_blk=CeilI64(bd->drv_offset+1+bitmap_blks+res,4);
bd->max_blk--; //Inclusive.
bd->file_dsk_name=AStrNew(iso_filename);
bd->init_root_dir_blks=root_dir_blks;
BlkDevAdd(bd,,TRUE,TRUE);
StrPrint(buf,"%C:/",dv->drv_let);
CopyTree(src_dir,buf,TRUE);
RedSeaISO9660Stage1(iso_filename,stage2_filename);
DrvDel(dv);
BlkDevDel(bd);
bd->max_blk=CeilI64(bd->drv_offset+1+bitmap_blks+res,4);
bd->max_blk--; //Inclusive.
bd->file_dsk_name=AStrNew(iso_filename);
bd->init_root_dir_blks=root_dir_blks;
BlkDevAdd(bd,,TRUE,TRUE);
StrPrint(buf,"%C:/",dv->drv_let);
CopyTree(src_dir,buf,TRUE);
RedSeaISO9660Stage1(iso_filename,stage2_filename);
DrvDel(dv);
BlkDevDel(bd);
}
Free(stage2_filename);
Free(src_dir);
Free(iso_filename);
}
Free(stage2_filename);
Free(src_dir);
Free(iso_filename);
return res;
}
+17 -17
View File
@@ -1,6 +1,6 @@
#help_index "Graphics/Windows BMP Files"
#define NUM_BMP_COLORS 16
#define BMP_COLORS_NUM 16
class CFileBMP
{
@@ -23,13 +23,13 @@ class CFileBMP
U0 end;
CBGR24 palette[NUM_BMP_COLORS];
CBGR24 palette[BMP_COLORS_NUM];
};
public CFileBMP *BMP4To(CDC *dc)
{//To Windows 4-bit BMP.
U8 *src,*ptr;
CBGR48 palette[NUM_COLORS];
CBGR48 palette[COLORS_NUM];
I64 i,x,y,w=dc->width>>1,
size=sizeof(CFileBMP)+dc->width*dc->height>>1;
CFileBMP *bmp =CAlloc(size);
@@ -43,8 +43,8 @@ public CFileBMP *BMP4To(CDC *dc)
bmp->bit_cnt =4;
bmp->image_size =dc->width*dc->height>>1;
GrPaletteGet(palette);
#assert NUM_COLORS==NUM_BMP_COLORS
for (i=0;i<NUM_BMP_COLORS;i++) {
#assert COLORS_NUM==BMP_COLORS_NUM
for (i=0;i<BMP_COLORS_NUM;i++) {
bmp->palette[i].b=palette[i].b>>8;
bmp->palette[i].g=palette[i].g>>8;
bmp->palette[i].r=palette[i].r>>8;
@@ -66,7 +66,7 @@ public CFileBMP *BMPRLE4To(CDC *dc)
{//To Windows RLE4 bit BMP.
U8 *src,*ptr,*start;
I64 i,x,y,w=dc->width,cnt,pattern;
CBGR48 palette[NUM_COLORS];
CBGR48 palette[COLORS_NUM];
CFileBMP *bmp =CAlloc(sizeof(CFileBMP)+2*(dc->width+1)*dc->height);
bmp->type ='BM';
bmp->planes =1;
@@ -77,8 +77,8 @@ public CFileBMP *BMPRLE4To(CDC *dc)
bmp->bit_cnt =4;
bmp->compression=2; //RLE4
GrPaletteGet(palette);
#assert NUM_COLORS==NUM_BMP_COLORS
for (i=0;i<NUM_BMP_COLORS;i++) {
#assert COLORS_NUM==BMP_COLORS_NUM
for (i=0;i<BMP_COLORS_NUM;i++) {
bmp->palette[i].b=palette[i].b>>8;
bmp->palette[i].g=palette[i].g>>8;
bmp->palette[i].r=palette[i].r>>8;
@@ -94,7 +94,7 @@ public CFileBMP *BMPRLE4To(CDC *dc)
src+=2;
cnt=2;
x+=2;
while (x<w && cnt<MAX_U8) {
while (x<w && cnt<U8_MAX) {
if (*src&15==pattern&15) {
src++;
cnt++;
@@ -184,14 +184,14 @@ public I64 BMPWrite(U8 *filename,CDC *dc,I64 bits=4)
U8 *BMPPaletteNew(CFileBMP *bmp)
{
I64 i,j,best,score,best_score;
CBGR48 palette[NUM_COLORS];
U8 *res=CAlloc(NUM_BMP_COLORS*sizeof(U8));
CBGR48 palette[COLORS_NUM];
U8 *res=CAlloc(BMP_COLORS_NUM*sizeof(U8));
GrPaletteGet(palette);
#assert NUM_COLORS==NUM_BMP_COLORS
for (i=0;i<NUM_BMP_COLORS;i++) {
#assert COLORS_NUM==BMP_COLORS_NUM
for (i=0;i<BMP_COLORS_NUM;i++) {
best=i;
best_score=MAX_I64;
for (j=0;j<NUM_BMP_COLORS;j++) {
best_score=I64_MAX;
for (j=0;j<BMP_COLORS_NUM;j++) {
score=SqrI64(bmp->palette[i].r-palette[j].r>>8)+
SqrI64(bmp->palette[i].g-palette[j].g>>8)+
SqrI64(bmp->palette[i].b-palette[j].b>>8);
@@ -205,7 +205,7 @@ U8 *BMPPaletteNew(CFileBMP *bmp)
return res;
}
U8 ms_paint_palette[NUM_BMP_COLORS]={0,4,2,6,1,5,3,8,7,12,10,14,9,13,11,15};
U8 ms_paint_palette[BMP_COLORS_NUM]={0,4,2,6,1,5,3,8,7,12,10,14,9,13,11,15};
I64 BMP24Color(CBGR24 *ptr,Bool dither_probability)
{
@@ -245,7 +245,7 @@ public CDC *BMPRead(U8 *filename,Bool dither_probability=FALSE,
CDC *res=NULL;
if (ptr=FileRead(filename)) {
bmp=ptr;
if (0<bmp->width<MAX_I32 && 0<bmp->height<MAX_I32) {
if (0<bmp->width<I32_MAX && 0<bmp->height<I32_MAX) {
res=DCNew(bmp->width,bmp->height);
ptr+=bmp->data_offset;
if (bmp->compression==2)
+19
View File
@@ -48,13 +48,32 @@ public I64 LinkChk(U8 *files_find_mask="/*",U8 *fu_flags=NULL)
{//Check documents for broken file links.
I64 fuf_flags=0,res=0;
CDirEntry *tmpde,*tmpde1;
U8 *st;
progress2_max=1;
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),"+r+$$+f+F+O");
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
tmpde=tmpde1=FilesFind(files_find_mask,fuf_flags);
while (tmpde && !Bt(&fuf_flags,FUf_CANCEL)) {
st=MStrPrint("Before %s Broke:%d",tmpde->full_name,res);
if (StrLen(st)>PROGRESS_DESC_LEN-1)
st[PROGRESS_DESC_LEN-1]=0;
StrCpy(progress2_desc,st);
Free(st);
Yield;
res+=LinkChkFile(tmpde->full_name,&fuf_flags);
st=MStrPrint("After %s Broke:%d",tmpde->full_name,res);
if (StrLen(st)>PROGRESS_DESC_LEN-1)
st[PROGRESS_DESC_LEN-1]=0;
StrCpy(progress2_desc,st);
Free(st);
Yield;
tmpde=tmpde->next;
}
DirTreeDel(tmpde1);
progress2_max=0;
return res;
}
+4 -4
View File
@@ -8,7 +8,7 @@ I64 TSSSize(CTSS *tss)
I64 PenBrushesSize()
{
I64 res=0,i;
for (i=0;i<GR_NUM_PEN_BRUSHES;i++)
for (i=0;i<GR_PEN_BRUSHES_NUM;i++)
res+=DCSize(gr.pen_brushes[i])+DCSize(gr.collision_pen_brushes[i])+
DCSize(gr.even_pen_brushes[i])+DCSize(gr.odd_pen_brushes[i]);
return res;
@@ -17,7 +17,7 @@ I64 PenBrushesSize()
I64 ScrnZoomTablesSize()
{
I64 res=0,i;
for (i=1;i<=GR_MAX_SCRN_ZOOM;i++)
for (i=1;i<=GR_SCRN_ZOOM_MAX;i++)
res+=MSize2(gr.scrn_zoom_tables[i]);
return res;
}
@@ -65,7 +65,7 @@ I64 BlkDevsSize()
{
I64 i,j,res=MSize2(blkdev.blkdevs);
CBlkDev *bd;
for (i=0;i<NUM_BLKDEVS;i++) {
for (i=0;i<BLKDEVS_NUM;i++) {
bd=&blkdev.blkdevs[i];
if (bd->bd_signature==BD_SIGNATURE_VAL) {
j=(bd->max_blk+1)<<BLK_SIZE_BITS;
@@ -81,7 +81,7 @@ I64 BlkDevsSize()
I64 DrvsSize()
{
I64 i,res=MSize2(blkdev.drvs);
for (i=0;i<NUM_DRVS;i++)
for (i=0;i<DRVS_NUM;i++)
res+=MSize2(blkdev.drvs[i].cur_fat_blk)+MSize2(blkdev.drvs[i].fis);
return res;
}
+56 -23
View File
@@ -1,6 +1,6 @@
#help_index "Misc/TOS"
public U0 TOSStaffIns()
U0 TOSStaffIns()
{//Completes TOS install from TempleOSStaff.ISO
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
AutoComplete;
@@ -9,16 +9,32 @@ public U0 TOSStaffIns()
DocClear;
"$$PURPLE$$$$TX+CX,\"Complete TOS install from TempleOSStaff.ISO\"$$$$FG$$\n\n\n\n";
InsRereg;
if (HostChgDsk("/home/tad/TAD/Site1/Wb/TempleOSSup1.ISO.C"))
CopyTree("T:/","~/Sup1");
if (HostChgDsk("/home/tad/TAD/Site1Stale/files/TempleOSBooks1.ISO.C"))
CopyTree("T:/","~/Books1");
if (HostChgDsk("/home/tad/TAD/Site1Stale/files/TempleOSBooks2.ISO.C"))
CopyTree("T:/","~/Books2");
"\nDownload TempleOSSup1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
"Download TempleOSBooks1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
"Download TempleOSBooks2.ISO.C\tfrom http://www.templeos.org AppStore.\n\n";
if (PressAKey!=CH_SHIFT_ESC) {
if (HostChgDsk("/home/tad/TempleOSSup1.ISO.C"))
CopyTree("T:/","~/Sup1");
if (HostChgDsk("/home/tad/TempleOSBooks1.ISO.C"))
CopyTree("T:/","~/Books1");
if (HostChgDsk("/home/tad/TempleOSBooks2.ISO.C"))
CopyTree("T:/","~/Books2");
Once("TOSBootHDIns;");
"\nDo you wish to run >$FG,2$TOSRegen;$FG$ to generate\n the "
"distro ISO's and the website image, $FG,2$D:/Wb$FG$ ";
if (YorN) {
Once("TOSRegen;");
BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
} else {
"\nReboot ";
if (YorN)
Reboot;
}
}
SettingsPop;
Once("TOSBootHDIns;\"\n\nRun TOSRegen;\n\n\n\";");
if (PressAKey!=CH_SHIFT_ESC)
Reboot;
}
public U0 TOSStdIns()
@@ -30,18 +46,35 @@ public U0 TOSStdIns()
DocClear;
"$$PURPLE$$$$TX+CX,\"Complete TOS install from TempleOSCD.ISO\"$$$$FG$$\n\n\n\n";
InsRereg;
if (FileFind("/Demo/AcctExample"))
Copy("::/Demo/AcctExample/*","~");
if (HostChgDsk("/home/tad/Downloads/TempleOSSup1.ISO.C"))
CopyTree("T:/","~/Sup1");
if (HostChgDsk("/home/tad/Downloads/TempleOSWeb.ISO.C"))
CopyTree("T:/","~/Web");
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks1.ISO.C"))
CopyTree("T:/","~/Books1");
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks2.ISO.C"))
CopyTree("T:/","~/Books2");
"\nDownload TempleOSSup1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
"Download TempleOSWeb.ISO.C\tfrom http://www.templeos.org AppStore.\n"
"Download TempleOSBooks1.ISO.C\tfrom http://www.templeos.org AppStore.\n"
"Download TempleOSBooks2.ISO.C\tfrom http://www.templeos.org AppStore.\n\n";
if (PressAKey!=CH_SHIFT_ESC) {
if (FileFind("/Demo/AcctExample"))
CopyTree("::/Demo/AcctExample","~");
if (HostChgDsk("/home/tad/Downloads/TempleOSSup1.ISO.C"))
CopyTree("T:/","~/Sup1");
if (HostChgDsk("/home/tad/Downloads/TempleOSWeb.ISO.C"))
CopyTree("T:/","~/Web");
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks1.ISO.C"))
CopyTree("T:/","~/Books1");
if (HostChgDsk("/home/tad/Downloads/TempleOSBooks2.ISO.C"))
CopyTree("T:/","~/Books2");
Once("TOSBootHDIns;");
"\nDo you wish to run >$FG,2$TOSRegen;$FG$ to generate\n the "
"distro ISO's and the website image, $FG,2$D:/Wb$FG$ ";
if (YorN) {
Once("TOSRegen;");
BootRAM("C:/" KERNEL_BIN_C); //Boot so TOSRegen cmd is available.
} else {
"\nReboot ";
if (YorN)
Reboot;
}
}
SettingsPop;
Once("TOSBootHDIns;\"\n\nRun TOSRegen;\n\n\n\";");
if (PressAKey!=CH_SHIFT_ESC)
Reboot;
}