TempleOSCD_140715.ISO
This commit is contained in:
1 parent
7ef616a20e
commit
64f679eeb9
1095 files changed
+24814
-221011
No files matched your search
@@ -89,4 +89,4 @@ BHD_HISTART:
|
||||
//Continues here $LK,"::/Kernel/KStart.CPP",A="FL:::/Kernel/KStart.CPP,1"$
|
||||
BHD_END::
|
||||
#assert BHD_END-BHD_START<MODULE_SIZE-2
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,6 @@ BMHD2_HISTART:
|
||||
MOV AH,0x42
|
||||
INT 0x13
|
||||
|
||||
|
||||
POP EBP
|
||||
POP EDX
|
||||
POP EBX
|
||||
|
||||
+10
-17
@@ -12,7 +12,6 @@ U0 FillU32Palindrome(CPalindromeU32 *dst,I64 d)
|
||||
dst->little=d;
|
||||
}
|
||||
|
||||
|
||||
class CCCDUserData //Create CD
|
||||
{
|
||||
I64 loc,path_entry_num,
|
||||
@@ -87,7 +86,7 @@ I64 CDFileCreate2(CFile *out_file,CDirEntry *tempde,
|
||||
if (!write) tempde1->user_data=CAlloc(sizeof(CCCDUserData));
|
||||
de1=de;
|
||||
de12=de2;
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
n=CDFileCreate2(out_file,tempde1,de,de2,_cur_blk,tempde,write,stage2_filename,_stage2_blk);
|
||||
de(U8 *)+=sizeof(CISO1DirEntry)-1+n;
|
||||
de2(U8 *)+=sizeof(CISO1DirEntry)-1+n<<1;
|
||||
@@ -234,12 +233,11 @@ I64 CDFileCreate2(CFile *out_file,CDirEntry *tempde,
|
||||
}
|
||||
|
||||
I64 CDTableLen(CDirEntry *tempde,I64 *size1,I64 *size2,I64 cur_depth)
|
||||
//returns depth
|
||||
{
|
||||
{//Returns depth
|
||||
CDirEntry *tempde1=tempde->sub;
|
||||
I64 max_depth=cur_depth,i;
|
||||
while (tempde1) {
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
*size1+=sizeof(CISO1PathEntry)-2+ (StrLen(tempde1->name)+1)&-0x2;
|
||||
*size2+=sizeof(CISO1PathEntry)-2+StrLen(tempde1->name)<<1;
|
||||
i=CDTableLen(tempde1,size1,size2,cur_depth+1);
|
||||
@@ -262,7 +260,7 @@ U0 CDFillPathTable(CDirEntry *tempde,
|
||||
|
||||
if (cur_level==output_level) {
|
||||
while (tempde1) {
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
tempc=tempde1->user_data;
|
||||
tempc->path_entry_num=*first_free;
|
||||
tabbuf->name_len=StrLen(tempde1->name);
|
||||
@@ -303,7 +301,7 @@ U0 CDFillPathTable(CDirEntry *tempde,
|
||||
tempde1=tempde->sub;
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->attr & RS_ATTR_DIR) {
|
||||
tempc=tempde1->user_data;
|
||||
CDFillPathTable(tempde1,_itabbuf,_itabbuf2,tempc->path_entry_num,
|
||||
big_endian,first_free,cur_level+1,output_level);
|
||||
@@ -327,12 +325,9 @@ class CElTorito
|
||||
|
||||
public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=NULL,
|
||||
U8 *_stage2_filename=NULL)
|
||||
//See $LK,"::/Misc/MakeDistro.CPP"$
|
||||
|
||||
{//See $LK,"::/Misc/MakeDistro.CPP"$
|
||||
//Use "C:/Distro/*" if you want all files in the C:/Distro directory.
|
||||
//Default flags are "+r" recurse.
|
||||
|
||||
{
|
||||
CISO1PriDesc *iso_pri=CAlloc(CD_BLK_SIZE),
|
||||
*iso_boot=CAlloc(CD_BLK_SIZE),
|
||||
*iso_sup=CAlloc(CD_BLK_SIZE),
|
||||
@@ -355,7 +350,7 @@ public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=
|
||||
ScanFlags(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
|
||||
if (!_filename)
|
||||
_filename=sys_dft_iso_name;
|
||||
_filename=dsk.dft_iso_filename;
|
||||
filename=DftExt(_filename,"ISO");
|
||||
|
||||
if (_stage2_filename)
|
||||
@@ -363,7 +358,7 @@ public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=
|
||||
else
|
||||
stage2_filename=NULL;
|
||||
|
||||
rootdir->attr=_ATTR_DIR;
|
||||
rootdir->attr=RS_ATTR_DIR;
|
||||
rootdir->sub=FilesFind(src_files_find_mask,fuf_flags);
|
||||
rootdir->datetime=Now;
|
||||
rootdir->user_data=CAlloc(sizeof(CCCDUserData));
|
||||
@@ -387,7 +382,7 @@ public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=
|
||||
tabsize2=(tabsize2+CD_BLK_SIZE-1)/CD_BLK_SIZE;
|
||||
cur_blk+=tabsize2<<1;
|
||||
|
||||
if (FileAttr(filename) & _ATTR_CONTIGUOUS)
|
||||
if (FileAttr(filename) & RS_ATTR_CONTIGUOUS)
|
||||
out_file=FOpen(filename,"wc",cur_blk<<2);
|
||||
else
|
||||
out_file=FOpen(filename,"w",cur_blk<<2);
|
||||
@@ -468,7 +463,6 @@ public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=
|
||||
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
cur_blk+=tabsize2;
|
||||
|
||||
|
||||
MemSet(tabbuf,0,tabsize*CD_BLK_SIZE);
|
||||
iso_pri->type_m_path_table=EndianU32(cur_blk);
|
||||
tabbuf->name_len=2; //Fill-in adam entry
|
||||
@@ -493,7 +487,7 @@ public I64 CDFileCreate(U8 *_filename=NULL,U8 *src_files_find_mask,U8 *fu_flags=
|
||||
FWBlks(out_file,tabbuf2,cur_blk<<2,tabsize2<<2);
|
||||
cur_blk+=tabsize2;
|
||||
|
||||
DirLstDel2(rootdir);
|
||||
DirTreeDel2(rootdir);
|
||||
FillU32Palindrome(&iso_pri->vol_space_size,cur_blk);
|
||||
FillU32Palindrome(&iso_sup->vol_space_size,cur_blk);
|
||||
FWBlks(out_file,iso_pri,16<<2,4);
|
||||
@@ -532,4 +526,3 @@ cf_done:
|
||||
Free(iso_term);
|
||||
return cur_blk;
|
||||
}
|
||||
#help_index ""
|
||||
+15
-23
@@ -34,7 +34,7 @@ _HI_CALL::
|
||||
CALL RAX
|
||||
@@05: POP RBP
|
||||
RET1 8
|
||||
// ************************************
|
||||
//************************************
|
||||
_HI_MEMCPY::
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
@@ -55,10 +55,8 @@ _extern _HI_CALL I64 HiCall(U8 *s);
|
||||
_extern _HI_MEMCPY U8 *HiMemCpy(U8 *dst,U8 *src,I64 cnt);
|
||||
|
||||
#help_index "Boot"
|
||||
public U0 SoftBoot(U8 *filename) //No hardware rst
|
||||
//Specify the Kernel binary file you
|
||||
//wish to boot.
|
||||
{
|
||||
public U0 SoftBoot(U8 *filename)
|
||||
{//Softboot Kernel Bin file. No hardware reset.
|
||||
I64 size;
|
||||
CKernel *hi_image,*lo_image=sys_boot_base-sizeof(CBinFile),
|
||||
reg *shutdown,*hi_image2;
|
||||
@@ -70,7 +68,7 @@ public U0 SoftBoot(U8 *filename) //No hardware rst
|
||||
Free(hi_image2);
|
||||
|
||||
hi_image->boot_base=lo_image(U8 *)+sizeof(CBinFile);
|
||||
hi_image->boot_patch_table_base=lo_image(U8 *)+hi_image->h.loader_patch_table_offset;
|
||||
hi_image->boot_patch_table_base=lo_image(U8 *)+hi_image->h.patch_table_offset;
|
||||
HiMemCpy(&hi_image->sys_mem_E801,&lo_image->sys_mem_E801,2*2);
|
||||
HiMemCpy(&hi_image->sys_mem_E820,&lo_image->sys_mem_E820,MEM_NUM_E820_ENTRIES*MEM_E820_ENTRY_SIZE);
|
||||
hi_image->sys_gr_mode=lo_image->sys_gr_mode;
|
||||
@@ -101,7 +99,7 @@ U8 ChkWritable(U8 drv_let=0)
|
||||
do {
|
||||
"Enter RAM drive (usually 'B') for temporary files:";
|
||||
writable_drv=ToUpper(GetChar);
|
||||
NewLine;
|
||||
'\n';
|
||||
p=Drv2Prt(writable_drv);
|
||||
bdev=p->bdev;
|
||||
if (bdev->type!=BDT_RAM ||
|
||||
@@ -112,24 +110,20 @@ U8 ChkWritable(U8 drv_let=0)
|
||||
} while (cont);
|
||||
if (drv_let!=writable_drv) {
|
||||
Fmt(writable_drv,FALSE,FALSE);
|
||||
SPrint(buf_s,"%c:/",drv_let);
|
||||
SPrint(buf_d,"%c:/",writable_drv);
|
||||
StrPrint(buf_s,"%c:/",drv_let);
|
||||
StrPrint(buf_d,"%c:/",writable_drv);
|
||||
CopyTree(buf_s,buf_d);
|
||||
}
|
||||
}
|
||||
return writable_drv;
|
||||
}
|
||||
|
||||
|
||||
#help_index "Install"
|
||||
public U0 MakeAll()
|
||||
//Call from $LK,"MakeOSPrtBootInstall",A="MN:MakeOSPrtBootInstall"$() because loader must be patched with block address.
|
||||
|
||||
{//Use $LK,"MakeOSPrtBootInstall",A="MN:MakeOSPrtBootInstall"$. Loader must be patched.
|
||||
//These 2 modules (and bootloaders at top) are the only AOT
|
||||
//compiled code in TempleOS. Everything else is JIT.
|
||||
//You are doing it wrong if you make AOT compiled code.
|
||||
|
||||
{
|
||||
Cd("/Compiler");
|
||||
if (Cmp("Compiler","Compiler",,':'))
|
||||
throw;
|
||||
@@ -139,17 +133,17 @@ public U0 MakeAll()
|
||||
}
|
||||
|
||||
public Bool MakeOSPrtBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
||||
{//Make All and install new boot-loader.
|
||||
{// Does $LK,"MakeAll",A="MN:MakeAll"$ and installs new boot-loader.
|
||||
|
||||
//Normally, you just supply a src_drv. It will compile
|
||||
//the code on that drive and update the boot sect.
|
||||
|
||||
//If you are making a bootable CD-ROM you supply a dst_drv.
|
||||
//If you are making a bootable CD-ROM, you supply a dst_drv.
|
||||
//See $LK,"::/Misc/MakeDistro.CPP"$
|
||||
|
||||
//See $LK,"Install Documentation",A="FI:::/Doc/Install.TXT"$
|
||||
|
||||
//Study my account examples my technique $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TSAdam.CPP,1"$ $LK,"Update Funs",A="FL:::/Demo/AcctExample/TSDistro.CPP,1"$
|
||||
//Study my account examples my technique: $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TSAdam.CPP,1"$ $LK,"Update Funs",A="FL:::/Demo/AcctExample/TSDistro.CPP,1"$
|
||||
|
||||
CBlkDev *bdev;
|
||||
CPrt *p;
|
||||
@@ -205,7 +199,6 @@ public Bool MakeOSPrtBootInstall(U8 src_drv=0,U8 dst_drv=0)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public U0 MasterBootOldRead(U8 src_drv,U8 dst_drv)
|
||||
{//Reads MBR from disk drive containing src partition.
|
||||
//Writes a single blk file to dst /0000Boot directory.
|
||||
@@ -229,7 +222,7 @@ public U0 MasterBootOldRead(U8 src_drv,U8 dst_drv)
|
||||
}
|
||||
|
||||
public U0 MasterBootOldWrite(U8 src_drv,U8 dst_drv)
|
||||
{ //Reads OldMBR from src drive /0000Boot directory
|
||||
{//Reads OldMBR from src drive /0000Boot directory
|
||||
//writes it to the MBR of the drive with dst partition.
|
||||
CBlkDev *bdev=Drv2BlkDev(dst_drv);
|
||||
CMasterBoot *mbr;
|
||||
@@ -244,7 +237,7 @@ public U0 MasterBootOldWrite(U8 src_drv,U8 dst_drv)
|
||||
}
|
||||
|
||||
public U0 MasterBootZero(U8 dst_drv)
|
||||
{ //Set MBR of disk with dst partition to zero.
|
||||
{//Set MBR of disk with dst partition to zero.
|
||||
|
||||
//This is dangerous!!
|
||||
//The TempleOS partitioner doesn't play well
|
||||
@@ -261,7 +254,7 @@ public U0 MasterBootZero(U8 dst_drv)
|
||||
}
|
||||
|
||||
public Bool MasterBootIntall(U8 drv_let,U8 *drv_lst=NULL)
|
||||
{ //Create new MBR on the disk that has drv_let as a partition.
|
||||
{//Create new MBR on the disk that has drv_let as a partition.
|
||||
//Puts stage 2 in /0000Boot dir of drv_let.
|
||||
CBlkDev *bdev,*bdev1;
|
||||
CPrt *p,*p1;
|
||||
@@ -293,7 +286,7 @@ public Bool MasterBootIntall(U8 drv_let,U8 *drv_lst=NULL)
|
||||
_q=BMHD2_BLK_ARRAY;
|
||||
MemSet(_q,0,sizeof(I64)*8);
|
||||
menu_ptr=BMHD2_BOOT_MSG;
|
||||
SPrint(menu_ptr,"\n\r\n\rTempleOS Boot Loader\n\r\n\r");
|
||||
StrPrint(menu_ptr,"\n\r\n\rTempleOS Boot Loader\n\r\n\r");
|
||||
j=0;
|
||||
if (FileFind(OLDMBR_BIN_C,&de,FUF_JUST_FILES)) {
|
||||
Free(de.full_name);
|
||||
@@ -351,4 +344,3 @@ public Bool MasterBootIntall(U8 drv_let,U8 *drv_lst=NULL)
|
||||
PutExcept;
|
||||
return result;
|
||||
}
|
||||
#help_index ""
|
||||
Reference in new issue
Block a user