TempleOSCDV4.01.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:47 +02:00
1 parent 0e0592d9a6
commit fedf66361e
85 files changed
+2463 -2376

No files matched your search

+1 -2
View File
@@ -1,5 +1,4 @@
#help_index "File/Cmd Line (Typically);Cmd Line (Typically)"
public U8 *DBlk(I64 blk,Bool write=FALSE)
{//Dump disk block. Optionally, write.
//If you set write to TRUE, the block will
@@ -261,7 +260,7 @@ U0 TouchFile(U8 *filename,U8 *attr,CDate cdt=MIN_I64)
} else
PrintErr("File not found.\n");
}
public U0 Touch(U8 *files_find_mask,U8 *attr="+?",
public U0 Touch(U8 *files_find_mask="*",U8 *attr="+?",
U8 *fu_flags=NULL,CDate cdt=MIN_I64)
{/*Touch file attributes and DateTime.
Default lists attributes.
-1
View File
@@ -1,5 +1,4 @@
#help_index "Info;File/Cmd Line (Typically);Cmd Line (Typically)"
Bool ChkDskConfirm(Bool *_fix,Bool *_confirm)
{
if (*_fix && *_confirm) {
+1
View File
@@ -1,5 +1,6 @@
Cd(__DIR__);;
#include "ADskA"
#include "Mount"
#include "ADskB"
#include "ChkDsk"
#include "FileMgr"
+102
View File
@@ -0,0 +1,102 @@
#help_index "Install;File/Cmd Line (Typically);Cmd Line (Typically);"
CDoc *BlkDevPmt(U8 boot_drv_let=0,Bool make_free=FALSE,Bool repartition=FALSE)
{
I64 num_hints,drv_let,type,unit;
U8 blks_buf[STR_LEN],addr_buf[STR_LEN],base0_buf[STR_LEN],base1_buf[STR_LEN];
CATARep *root=NULL,*tempha;
CDoc *doc;
"\n****** Mount Drives ******\n"
"$$GREEN$$A$$FG$$-$$GREEN$$B$$FG$$ are RAM drives.\n"
"$$GREEN$$C$$FG$$-$$GREEN$$S$$FG$$ are hard drives.\n"
"$$GREEN$$T$$FG$$-$$GREEN$$Z$$FG$$ are CD/DVD drives.\n"
"\nDrive Letter ($$PURPLE$$<ENTER>$$FG$$ to exit):";
drv_let=ToUpper(GetChar);
'\n';
if ('A'<=drv_let<='Z') {
doc=DocNew;
unit=0;
if ('A'<=drv_let<='B') {
type=BDT_RAM;
"Addr of RAM disk ($$PURPLE$$<ENTER>$$FG$$ to MAlloc):";
GetS(addr_buf,STR_LEN);
"Blks of 512 bytes:";
GetS(blks_buf,STR_LEN);
} else {
num_hints=ATARep(,,&root);
if ('C'<=drv_let<='S')
type=BDT_ATA;
else
type=BDT_ATAPI;
if (type==BDT_ATAPI && boot_drv_let)
"<ENTER> to use booted CD/DVD\n";
do {
if (num_hints)
"Enter dev number or\nport with $$PURPLE$$0x$$FG$$ prefix.\n"
"I/O Port Base0:\n";
else
"Include $$PURPLE$$0x$$FG$$ prefix.\nI/O Port Base0:\n";
GetS(base0_buf,STR_LEN);
} while (!Str2I64(base0_buf) && (type!=BDT_ATAPI || !boot_drv_let));
if (1<=Str2I64(base0_buf)<=num_hints) {
tempha=ATARepFind(root,Str2I64(base0_buf));
StrPrint(base0_buf,"0x%X",tempha->base0);
StrPrint(base1_buf,"0x%X",tempha->base1);
unit=tempha->unit;
} else if (type!=BDT_ATAPI || *base0_buf) {
if (type==BDT_ATAPI)
StrCpy(base1_buf,"0");
else
do {
"I/O Port Base1:\n";
GetS(base1_buf,STR_LEN);
} while (!Str2I64(base1_buf));
do {
"\t$$PURPLE$$0$$FG$$=Master\n\t$$PURPLE$$1$$FG$$=Slave\nUnit:";
unit=GetChar-'0';
} while (!(0<=unit<=1));
'\n';
}
LinkedLstDel(root);
}
DocPrint(doc,"bd=BlkDevNextFree(%d,%d);bd->unit=%d;\n",drv_let,type,unit);
if (type==BDT_RAM) {
if (!*addr_buf) StrCpy(addr_buf,"0");
DocPrint(doc,"bd->RAM_dsk=%s;bd->max_blk=(%s)-1;\n",addr_buf,blks_buf);
}
if (type==BDT_ATA || type==BDT_ATAPI) {
if (type==BDT_ATAPI && !*base0_buf) {
DocPrint(doc,"GetBaseUnit(bd);\n");
if (drv_let==boot_drv_let)
make_free=TRUE;
} else
DocPrint(doc,"bd->base0=%s;bd->base1=%s;\n",
base0_buf,base1_buf);
}
if (type==BDT_ATA && repartition) {
"\nReformat WHOLE drive!";
if (YorN) {
DocPrint(doc,"if (!BlkDevAdd(bd,TRUE,TRUE))"
"\"\n\n$$BK,1$$$$RED$$Operation Failed$$BK,0$$$$FG$$\n\n\";"
"else PrtDsk(bd->first_drv_let);\n");
return doc;
}
}
DocPrint(doc,"if (!BlkDevAdd(bd,FALSE,%d))"
"\"\n\n$$BK,1$$$$RED$$Operation Failed$$BK,0$$$$FG$$\n\n\";\n",make_free);
return doc;
} else
return NULL;
}
public U0 Mount(Bool repartition=FALSE)
{//Mount a drive.
CDoc *doc;
ExePrint("CBlkDev *bd;"); //Leaks
do {
DrvRep;
if (doc=BlkDevPmt(,TRUE,repartition)) {
ExeDoc(doc);
DocDel(doc);
}
} while (doc);
}