TempleOSCDV5.02.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:48:21 +02:00
1 parent 320c7ee98a
commit 4b32f058d5
137 files changed
+3474 -3293

No files matched your search

+3 -3
View File
@@ -35,19 +35,19 @@ public U0 BootHDIns(U8 drv_let=0)
else {
Free(de.full_name);
"Modifying partition boot record.\n";
RBlks(dv,&br,dv->drv_offset,1);
BlkRead(dv,&br,dv->drv_offset,1);
br.jump_and_nop[0]=OC_JMP_REL8;
br.jump_and_nop[1]=offset(CFAT32Boot.code)-2;
#assert offset(CFAT32Boot.code)>=offset(CRedSeaBoot.code)
br.jump_and_nop[2]=OC_NOP;
*BHD_BLK_CNT(U16 *)=(de.size+BLK_SIZE-1)>>BLK_SIZE_BITS;
*BHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster);
*BHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
for (i=0;i<BHD_END-BHD_CODE;i++)
br.code[i]=BHD_CODE(U8 *)[i];
#assert sizeof(CFAT32Boot.code)>=BHD_END-BHD_CODE
for (;i<sizeof(CFAT32Boot.code);i++)
br.code[i]=0;
WBlks(dv,&br,dv->drv_offset,1);
BlkWrite(dv,&br,dv->drv_offset,1);
}
break;
default:
+3 -3
View File
@@ -29,7 +29,7 @@ public U0 BootMHDOldRead(U8 src_drv,U8 dst_drv)
BlkDevUnlock(bd);
Drv(dst_drv);
MkDir(BOOT_DIR);
DirMk(BOOT_DIR);
FileWrite(BOOT_DIR_OLDMBR_BIN_C,&mbr,BLK_SIZE);
}
}
@@ -103,7 +103,7 @@ public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL)
j=0;
if (FileFind(BOOT_DIR_OLDMBR_BIN_C,&de,FUF_JUST_FILES)) {
Free(de.full_name);
*_q++=Cluster2Blk(dv,de.cluster);
*_q++=Clus2Blk(dv,de.clus);
CatPrint(menu_ptr,"0. Old Boot Record\n\r");
j++;
}
@@ -127,7 +127,7 @@ public Bool BootMHDIns(U8 drv_let,U8 *drv_lst=NULL)
else {
Free(de.full_name);
*BMHD_BLK_CNT(U16 *)=(size+BLK_SIZE-1)>>BLK_SIZE_BITS;
*BMHD_DAP_BLK(I64 *)=Cluster2Blk(dv,de.cluster);
*BMHD_DAP_BLK(I64 *)=Clus2Blk(dv,de.clus);
//Bypass partition bounds-checking
BlkDevLock(bd);
ATAReadBlks(bd,&mbr,0,1);
+18 -18
View File
@@ -124,8 +124,8 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
MemSet(buf,0,DVD_BLK_SIZE);
}
if (write) {
FRBlks(in_file,buf,i<<2,n);
FWBlks(out_file,buf,*_cur_blk<<2,n);
FBlkRead(in_file,buf,i<<2,n);
FBlkWrite(out_file,buf,*_cur_blk<<2,n);
}
*_cur_blk+=1;
}
@@ -181,7 +181,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
if (write)
"%X:%s\n",*_cur_blk,tmpde->full_name;
if (write)
FWBlks(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
FBlkWrite(out_file,dir_blk_buf,*_cur_blk<<2,n<<2);
*_cur_blk+=n;
tmpi2->len=sizeof(CISO1DirEntry)-1;
@@ -212,7 +212,7 @@ I64 DVDFileCreate2(CFile *out_file,CDirEntry *tmpde,CISO1DirEntry *tmpi,
if (write)
"%X:%s\n",*_cur_blk,tmpde->full_name;
if (write)
FWBlks(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
FBlkWrite(out_file,dir_blk_buf2,*_cur_blk<<2,n<<2);
*_cur_blk+=n;
Free(dir_blk_buf);
@@ -328,7 +328,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
if (!_filename)
_filename=blkdev.dft_iso_filename;
filename=DftExt(_filename,"ISO");
filename=ExtDft(_filename,"ISO");
if (_stage2_filename)
stage2_filename=FileNameAbs(_stage2_filename);
@@ -367,7 +367,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
goto cf_done;
while (cur_blk<20<<2>>2)
FWBlks(out_file,zero_buf,cur_blk++<<2,4);
FBlkWrite(out_file,zero_buf,cur_blk++<<2,4);
iso_pri->type=ISO1T_PRI_VOL_DESC;
StrCpy(iso_pri->id,"CD001");
@@ -407,7 +407,7 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
et->sect_cnt=4; //5 seems like the limit, 4 is safer
et->load_rba=cur_blk+1;
"%X: Pre Boot Blk\n",cur_blk;
FWBlks(out_file,et,cur_blk++<<2,4);
FBlkWrite(out_file,et,cur_blk++<<2,4);
"%X: Boot Stage 1\n",cur_blk;
cur_blk+=DVD_BOOT_LOADER_SIZE/DVD_BLK_SIZE;
}
@@ -434,10 +434,10 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
for (i=1;i<=max_depth;i++)
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,FALSE,&first_free,1,i);
"%X: Path Table 0\n",cur_blk;
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
FBlkWrite(out_file,tabbuf,cur_blk<<2,tabsize<<2);
cur_blk+=tabsize;
"%X: Path Table 1\n",cur_blk;
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
FBlkWrite(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
cur_blk+=tabsize2;
MemSet(tabbuf,0,tabsize*DVD_BLK_SIZE);
@@ -458,35 +458,35 @@ public I64 ISO9660ISO(U8 *_filename=NULL,U8 *src_files_find_mask,
for (i=1;i<=max_depth;i++)
DVDFillPathTable(headdir,&itabbuf,&itabbuf2,1,TRUE,&first_free,1,i);
"%X: Path Table 2\n",cur_blk;
FWBlks(out_file,tabbuf,cur_blk<<2,tabsize<<2);
FBlkWrite(out_file,tabbuf,cur_blk<<2,tabsize<<2);
cur_blk+=tabsize;
"%X: Path Table 3\n",cur_blk;
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
FBlkWrite(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
cur_blk+=tabsize2;
DirTreeDel2(headdir);
FillU32Palindrome(&iso_pri->vol_space_size,cur_blk);
FillU32Palindrome(&iso_sup->vol_space_size,cur_blk);
FWBlks(out_file,iso_pri,16<<2,4);
FBlkWrite(out_file,iso_pri,16<<2,4);
iso_term->type=ISO1T_TERMINATOR;
StrCpy(iso_term->id,"CD001");
iso_term->version=1;
if (stage2_filename) {
FWBlks(out_file,iso_boot,17<<2,4);
FWBlks(out_file,iso_sup,18<<2,4);
FWBlks(out_file,iso_term,19<<2,4);
FBlkWrite(out_file,iso_boot,17<<2,4);
FBlkWrite(out_file,iso_sup,18<<2,4);
FBlkWrite(out_file,iso_term,19<<2,4);
stage2_size=(Size(stage2_filename,"+s")+DVD_BLK_SIZE-1)/DVD_BLK_SIZE;
MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
*(BDVD_BLK_CNT-BDVD_START+stage1_buf)(U16 *)=stage2_size;
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=stage2_blk;
"$$RED$$!!! Boot Stage 2 !!! %X-%X$$FG$$\n",
stage2_blk,stage2_blk+stage2_size-1;
FWBlks(out_file,stage1_buf,
FBlkWrite(out_file,stage1_buf,
20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
} else {
FWBlks(out_file,iso_sup,17<<2,4);
FWBlks(out_file,iso_term,18<<2,4);
FBlkWrite(out_file,iso_sup,17<<2,4);
FBlkWrite(out_file,iso_term,18<<2,4);
}
cf_done:
+12 -12
View File
@@ -32,13 +32,13 @@ U0 RedSeaISO9660Stage1(U8 *iso_filename,U8 *stage2_filename)
U8 *stage1_buf=CAlloc(DVD_BOOT_LOADER_SIZE);
if (FileFind(stage2_filename,&de) && (out_file=FOpen(iso_filename,"wc+"))) {
MemCpy(stage1_buf,BDVD_START,BDVD_END-BDVD_START);
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=de.cluster>>2;
*(BDVD_BLK_LO -BDVD_START+stage1_buf)(U32 *)=de.clus>>2;
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)=
(de.size+DVD_BLK_SIZE-1)>>(BLK_SIZE_BITS+2);
*(BDVD_SHIFT_BLKS -BDVD_START+stage1_buf)(U16 *)=de.cluster&3;
if (de.cluster&3)
*(BDVD_SHIFT_BLKS -BDVD_START+stage1_buf)(U16 *)=de.clus&3;
if (de.clus&3)
*(BDVD_BLK_CNT -BDVD_START+stage1_buf)(U16 *)+=1;
FWBlks(out_file,stage1_buf,
FBlkWrite(out_file,stage1_buf,
20<<2+1<<2,DVD_BOOT_LOADER_SIZE/BLK_SIZE);
FClose(out_file);
}
@@ -61,7 +61,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
if (out_file=FOpen(iso_filename,"wc+")) {
iso_size=FSize(out_file)/DVD_BLK_SIZE;
for (i=0;i<dv->bd->drv_offset;i+=4)
FWBlks(out_file,zero_buf,i,4);
FBlkWrite(out_file,zero_buf,i,4);
iso_pri->type=ISO1T_PRI_VOL_DESC;
StrCpy(iso_pri->id,"CD001");
@@ -70,7 +70,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
FillU16Palindrome(&iso_pri->vol_seq_num,1);
FillU16Palindrome(&iso_pri->log_block_size,DVD_BLK_SIZE);
FillU32Palindrome(&iso_pri->vol_space_size,iso_size);
FillU32Palindrome(&iso_pri->root_dir_record,dv->root_cluster);
FillU32Palindrome(&iso_pri->root_dir_record,dv->root_clus);
iso_pri->file_structure_version=1;
StrCpy(iso_pri->publisher_id,"TempleOS RedSea");
@@ -82,17 +82,17 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
iso_boot->version=1;
StrCpy(iso_boot(U8 *)+7,"EL TORITO SPECIFICATION");
FWBlks(out_file,iso_pri,16<<2,4);
FBlkWrite(out_file,iso_pri,16<<2,4);
iso_term->type=ISO1T_TERMINATOR;
StrCpy(iso_term->id,"CD001");
iso_term->version=1;
d=iso_boot(U8 *)+0x47;
*d=20<<2>>2;
FWBlks(out_file,iso_boot,17<<2,4);
FBlkWrite(out_file,iso_boot,17<<2,4);
FWBlks(out_file,iso_sup,18<<2,4);
FWBlks(out_file,iso_term,19<<2,4);
FBlkWrite(out_file,iso_sup,18<<2,4);
FBlkWrite(out_file,iso_term,19<<2,4);
et->w[0]=1;
StrCpy(&et->w[2],"TempleOS");
@@ -105,7 +105,7 @@ U0 RedSeaISO9660(U8 *iso_filename,U8 drv_let)
et->media_type=0;//0=no emu 2=1.44meg 4=hard drive
et->sect_cnt=4; //5 seems like the limit, 4 is safer
et->load_rba=20<<2>>2+1;
FWBlks(out_file,et,20<<2,4);
FBlkWrite(out_file,et,20<<2,4);
FClose(out_file);
}
Free(zero_buf);
@@ -147,7 +147,7 @@ public I64 RedSeaISO(U8 *_iso_filename=NULL,U8 *_src_dir,
else {
if (!_iso_filename)
_iso_filename=blkdev.dft_iso_c_filename;
iso_filename=ChgExt(_iso_filename,"ISO.C");
iso_filename=ExtChg(_iso_filename,"ISO.C");
src_dir=DirNameAbs(_src_dir);
if (_stage2_filename) {
stage2_filename=FileNameAbs(_stage2_filename);
+1 -1
View File
@@ -63,7 +63,7 @@ I64 SizeRep1(CDirEntry *tmpde,I64 *_fuf_flags)
else if ((i=tmpde->size) && Bt(_fuf_flags,FUf_EXPAND) &&
FileAttr(tmpde->name)&RS_ATTR_COMPRESSED) {
dv=Let2Drv(*tmpde->full_name);
RBlks(dv,buf,Cluster2Blk(dv,tmpde->cluster),1);
BlkRead(dv,buf,Clus2Blk(dv,tmpde->clus),1);
i=(&buf)(CArcCompress *)->expanded_size;
}
tmpde->user_data=i;
+3 -3
View File
@@ -71,7 +71,7 @@ I64 BlkDevsSize()
j=(bd->max_blk+1)<<BLK_SIZE_BITS;
if (bd->type==BDT_RAM)
"RAMDsk %C\t:%010X/%010X\n",
bd->first_drv_let,j-UnusedDrvSpace(bd->first_drv_let),j;
bd->first_drv_let,j-DrvUnused(bd->first_drv_let),j;
res+=MSize2(bd->dev_id_record);
}
}
@@ -115,7 +115,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
"HashTable\t:%010X\n",HashTableSize2(task->hash_table);
"FPU\t\t:%010X\n",MSize2(task->fpu_mmx);
"CurDir\t:%010X\n",MSize2(task->cur_dir);
"DirCur\t:%010X\n",MSize2(task->cur_dir);
if (pdoc=DocPut(task))
"PutDoc\t:%010X\n",DocSize(pdoc);
@@ -172,7 +172,7 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
"DskCache\t:%010X\n",
MSize2(blkdev.cache_base)+MSize2(blkdev.cache_hash_table)+
MSize2(blkdev.cache_ctrl);
"Clipboard\t:%010X\n",DocSize(sys_clipboard_doc);
"Clip\t:%010X\n",DocSize(sys_clip_doc);
"AutoComplete:%010X\n",CallExtStr("AutoCompleteSize");
"gr.to_8_bits\t:%010X\n",MSize2(gr.to_8_bits);
"gr.to_8_colors\t:%010X\n",MSize2(gr.to_8_colors);
+2 -2
View File
@@ -14,9 +14,9 @@ public I64 Sort(U8 *_in_name,U8 *_out_name=NULL,
I64 i,j,cnt=0,res;
if (!_in_name) return 0;
in_name=DftExt(_in_name,"DD.Z");
in_name=ExtDft(_in_name,"DD.Z");
if (_out_name)
out_name=DftExt(_out_name,"DD.Z");
out_name=ExtDft(_out_name,"DD.Z");
else
out_name=StrNew(in_name);
+3 -3
View File
@@ -112,11 +112,11 @@ public U0 ToTXT(U8 *_in_name,U8 *_out_name=NULL,I64 width=70)
SettingsPush; //See $LK,"SettingsPush",A="MN:SettingsPush"$
WinHorz(0,width-1); //Sets doc width for word wrap.
in_name=DftExt(_in_name,"DD.Z");
in_name=ExtDft(_in_name,"DD.Z");
if (_out_name)
out_name=DftExt(_out_name,"TXT");
out_name=ExtDft(_out_name,"TXT");
else
out_name=ChgExt(_in_name,"TXT");
out_name=ExtChg(_in_name,"TXT");
doc_in=DocRead(in_name);
doc_out=Doc2TXT(doc_in);