TempleOSCDV4.11.ISO
This commit is contained in:
1 parent
9206246147
commit
93ca216483
662 files changed
+6431
-7369
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -161,7 +161,7 @@ CDirEntry *DirFilesFlatten(CDirEntry *tempde,CDirEntry **_res,I64 fuf_flags)
|
||||
}
|
||||
|
||||
U0 PutFileLink(U8 *filename,U8 *full_name=NULL,I64 line=0,Bool plain_text=FALSE)
|
||||
{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ file,line link to StdOut, $LK,"DocPut",A="MN:DocPut"$.
|
||||
{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file,line link to StdOut, $LK,"DocPut",A="MN:DocPut"$.
|
||||
U8 *st;
|
||||
if (!filename) return;
|
||||
if (IsRaw) {
|
||||
@@ -198,7 +198,7 @@ U0 PutFileLink(U8 *filename,U8 *full_name=NULL,I64 line=0,Bool plain_text=FALSE)
|
||||
}
|
||||
|
||||
U0 PutDirLink(U8 *dirname,U8 *full_name=NULL)
|
||||
{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ dir macro to StdOut, $LK,"DocPut",A="MN:DocPut"$.
|
||||
{//Put $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ dir macro to StdOut, $LK,"DocPut",A="MN:DocPut"$.
|
||||
U8 *st;
|
||||
if (!dirname) return;
|
||||
if (IsRaw)
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -28,7 +28,7 @@ CDirEntry *FilesFind2(U8 *files_find_mask,I64 fuf_flags)
|
||||
}
|
||||
|
||||
CDirEntry *FilesFind(U8 *files_find_mask,I64 fuf_flags=0)
|
||||
{/* See $LK,"::/Doc/FileUtils.TXT"$.
|
||||
{/* See $LK,"::/Doc/FileUtils.DD"$.
|
||||
|
||||
Find files and make a directory tree in memory.
|
||||
|
||||
File renamed without changes.
@@ -22,7 +22,7 @@ U8 *FileExtRem(U8 *src,U8 *dst=NULL)
|
||||
Bool IsDotZ(U8 *filename)
|
||||
{//Does name end in .Z?
|
||||
I64 i=StrLen(filename);
|
||||
if (i>6 && filename[i-1]=='Z' && filename[i-2]=='.' && filename[i-6]=='.')
|
||||
if (StrOcc(filename,'.')>1 && filename[i-1]=='Z' && filename[i-2]=='.')
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
@@ -31,14 +31,14 @@ Bool IsDotZ(U8 *filename)
|
||||
Bool IsDotC(U8 *filename)
|
||||
{//Does name end in .C?
|
||||
I64 i=StrLen(filename);
|
||||
if (i>6 && filename[i-1]=='C' && filename[i-2]=='.' && filename[i-6]=='.')
|
||||
if (StrOcc(filename,'.')>1 && filename[i-1]=='C' && filename[i-2]=='.')
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Bool FilesFindMatch(U8 *_test_name,U8 *files_find_mask,I64 fuf_flags=0)
|
||||
{//Does filename meet $LK,"Files Find",A="FI:::/Doc/FileUtils.TXT"$ mask?
|
||||
{//Does filename meet $LK,"Files Find",A="FI:::/Doc/FileUtils.DD"$ mask?
|
||||
I64 tn_len=StrLen(_test_name),mask_len=StrLen(files_find_mask);
|
||||
U8 *mask1=MAlloc(mask_len+1),*mask2=MAlloc(mask_len+1),
|
||||
*ptr,*test_name1,*test_name2;
|
||||
@@ -271,7 +271,7 @@ U8 *ToggleZorNotZ(U8 *name)
|
||||
|
||||
U8 *FileNameTempTxt()
|
||||
{//Make pretty-safe temp filename in home dir.
|
||||
return MStrPrint("~/SysTemp%X.TXT.Z",GetTSC>>8&0xFFFFFFFF);
|
||||
return MStrPrint("~/SysTemp%X.DD.Z",GetTSC>>8&0xFFFFFFFF);
|
||||
}
|
||||
|
||||
U8 *CurDir(CTask *task=NULL,CTask *mem_task=NULL)
|
||||
@@ -291,10 +291,10 @@ U8 *DirFile(U8 *dirname,U8 *name=NULL,U8 *_extension=NULL)
|
||||
{/*Strips file from dirname, scans for file upward until found or
|
||||
returns default.
|
||||
|
||||
("/Kernel/KHashA.CPP.Z",NULL,NULL) returns "D:/Kernel"
|
||||
("/Kernel/KHashA.HC.Z",NULL,NULL) returns "D:/Kernel"
|
||||
("/Kernel",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z"
|
||||
("/Kernel/BlkDev",NULL,"PRJ.Z") returns "D:/Kernel/Kernel.PRJ.Z"
|
||||
("/Apps/Psalmody","Load","CPP.Z") returns "D:/Apps/Psalmody/Load.CPP.Z"
|
||||
("/Apps/Psalmody","Load","HC.Z") returns "D:/Apps/Psalmody/Load.HC.Z"
|
||||
*/
|
||||
U8 *st=DirNameAbs(dirname),*st2,*st3,*res,*dft=NULL,*ext;
|
||||
if (_extension && *_extension) {
|
||||
File renamed without changes.
@@ -575,7 +575,7 @@ I64 FAT32AllocContiguousClusters(CDrv *dv,I64 cnt)
|
||||
|
||||
Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain)
|
||||
{
|
||||
//See $LK,"::/Doc/CutCorners.TXT"$.
|
||||
//See $LK,"::/Doc/CutCorners.DD"$.
|
||||
CFAT32DirEntry *buf,*last_buf,*temp_buf,de[3];
|
||||
I64 i,attr,avail_cnt,de_cnt,c,
|
||||
cur_dir_entry,entries_per_cluster,
|
||||
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
// See $LK,"RedSea File System",A="FI:::/Doc/RedSea.TXT"$
|
||||
// See $LK,"RedSea File System",A="FI:::/Doc/RedSea.DD"$
|
||||
|
||||
U0 RedSeaFreeFreeLst(CDrv *dv)
|
||||
{
|
||||
@@ -349,7 +349,7 @@ I64 RedSeaAllocClusters(CDrv *dv,I64 cnt)
|
||||
return first;
|
||||
}
|
||||
|
||||
Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,Bool free_old_chain)
|
||||
{
|
||||
CDirEntry *buf,*buf2,*ptr,de2;
|
||||
CRedSeaBoot *br;
|
||||
@@ -358,7 +358,7 @@ Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
U8 *temp,*parent_dir;
|
||||
try {
|
||||
unlock_break=BreakLock;
|
||||
de->attr|=RS_ATTR_CONTIGUOUS;
|
||||
tempde->attr|=RS_ATTR_CONTIGUOUS;
|
||||
unlock=DrvLock(dv);
|
||||
cur_dir_cluster=Name2DirCluster(dv,cur_dir);
|
||||
buf2=MAlloc(BLK_SIZE);
|
||||
@@ -374,7 +374,7 @@ Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
while (TRUE) {
|
||||
if (!(ch=*ptr->name)) {
|
||||
if (!written)
|
||||
MemCpy(&ptr->start,&de->start,CDIR_SIZE);
|
||||
MemCpy(&ptr->start,&tempde->start,CDIR_SIZE);
|
||||
if ((i+1)*CDIR_SIZE+j<<BLK_SIZE_BITS<dir_size)
|
||||
WBlks(dv,buf(U8 *)+j<<BLK_SIZE_BITS,cur_dir_cluster+j,1);
|
||||
else {
|
||||
@@ -418,17 +418,17 @@ Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *de,Bool free_old_chain)
|
||||
break;
|
||||
} else if (ptr->attr & RS_ATTR_DELETED) {
|
||||
if (!written) {
|
||||
MemCpy(&ptr->start,&de->start,CDIR_SIZE);
|
||||
MemCpy(&ptr->start,&tempde->start,CDIR_SIZE);
|
||||
WBlks(dv,buf(U8 *)+j<<BLK_SIZE_BITS,cur_dir_cluster+j,1);
|
||||
written=TRUE;
|
||||
}
|
||||
} else {
|
||||
if (!StrCmp(de->name,ptr->name)) {
|
||||
if (!StrCmp(tempde->name,ptr->name)) {
|
||||
if (free_old_chain)
|
||||
RedSeaFreeClusters(dv,ptr->cluster,
|
||||
(ptr->size+BLK_SIZE-1)>>BLK_SIZE_BITS);
|
||||
if (!written)
|
||||
MemCpy(&ptr->start,&de->start,CDIR_SIZE);
|
||||
MemCpy(&ptr->start,&tempde->start,CDIR_SIZE);
|
||||
else
|
||||
ptr->attr|=RS_ATTR_DELETED;
|
||||
WBlks(dv,buf(U8 *)+j<<BLK_SIZE_BITS,cur_dir_cluster+j,1);
|
||||
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
//See $LK,"CArcCompress",A="MN:CArcCompress"$, $LK,"CArcEntry",A="MN:CArcEntry"$, and $LK,"CArcCtrl",A="MN:CArcCtrl"$
|
||||
|
||||
asm {
|
||||
@@ -248,7 +248,7 @@ U0 ArcCtrlDel(CArcCtrl *c)
|
||||
}
|
||||
|
||||
U8 *ExpandBuf(CArcCompress *arc,CTask *mem_task=NULL)
|
||||
{//See $LK,"::/Demo/Dsk/SerializeTree.CPP"$.
|
||||
{//See $LK,"::/Demo/Dsk/SerializeTree.HC"$.
|
||||
CArcCtrl *c;
|
||||
U8 *res;
|
||||
|
||||
@@ -279,7 +279,7 @@ U8 *ExpandBuf(CArcCompress *arc,CTask *mem_task=NULL)
|
||||
}
|
||||
|
||||
CArcCompress *CompressBuf(U8 *src,I64 size,CTask *mem_task=NULL)
|
||||
{//See $LK,"::/Demo/Dsk/SerializeTree.CPP"$.
|
||||
{//See $LK,"::/Demo/Dsk/SerializeTree.HC"$.
|
||||
CArcCompress *arc;
|
||||
I64 size_out,compression_type=ArcDetermineCompressionType(src,size);
|
||||
CArcCtrl *c=ArcCtrlNew(FALSE,compression_type);
|
||||
@@ -90,49 +90,31 @@ U0 VGAFlush()
|
||||
LBts(&sys_semas[SYS_SEMA_FLUSH_VGA_IMAGE],0);
|
||||
}
|
||||
|
||||
U0 WinDerivedValsUpdate(CTask *task=NULL)
|
||||
U0 WinDerivedValsUpdate(CTask *task)
|
||||
{//Those things calculated from other variables.
|
||||
if (!task) task=Fs;
|
||||
|
||||
//Assert: This is called with TASKf_TASK_LOCK set
|
||||
PUSHFD
|
||||
CLI
|
||||
task->win_width =task->win_right-task->win_left+1;
|
||||
task->win_height=task->win_bottom-task->win_top+1;
|
||||
|
||||
//Inside the Border
|
||||
task->pix_left =FONT_WIDTH*task->win_left;
|
||||
task->pix_right =FONT_WIDTH*(task->win_right+1)-1;
|
||||
task->pix_width =task->pix_right-task->pix_left+1;
|
||||
task->pix_top =FONT_HEIGHT*task->win_top;
|
||||
task->pix_bottom =FONT_HEIGHT*(task->win_bottom+1)-1;
|
||||
task->pix_height =task->pix_bottom-task->pix_top+1;
|
||||
|
||||
//Outside the border
|
||||
if (Bt(&task->display_flags,DISPLAYf_NO_BORDER)) {
|
||||
task->border_pix_left =task->pix_left;
|
||||
task->border_pix_right =task->pix_right;
|
||||
task->border_pix_top =task->pix_top;
|
||||
task->border_pix_bottom =task->pix_bottom;
|
||||
} else {
|
||||
task->border_pix_left =task->pix_left-FONT_WIDTH;
|
||||
task->border_pix_right =task->pix_right+FONT_WIDTH;
|
||||
task->border_pix_top =task->pix_top-FONT_HEIGHT;
|
||||
task->border_pix_bottom =task->pix_bottom+FONT_HEIGHT;
|
||||
}
|
||||
POPFD
|
||||
}
|
||||
|
||||
Bool WinInside(I64 x,I64 y,CTask *task=NULL,Bool border=FALSE)
|
||||
{//Is pixel (x,y) inside task's win?
|
||||
Bool WinInside(I64 x,I64 y,CTask *task=NULL,I64 border=0)
|
||||
{//Is pixel (x,y) inside task's win? Border to FONT_WIDTH.
|
||||
if (!task) task=Fs;
|
||||
if (TaskValidate(task) && Bt(&task->display_flags,DISPLAYf_SHOW)) {
|
||||
if (border) {
|
||||
if (task->border_pix_left<=x<=task->border_pix_right &&
|
||||
task->border_pix_top<=y<=task->border_pix_bottom)
|
||||
return TRUE;
|
||||
} else if (task->pix_left<=x<=task->pix_right &&
|
||||
task->pix_top<=y<=task->pix_bottom)
|
||||
if (Bt(&task->display_flags,DISPLAYf_NO_BORDER))
|
||||
border=0;
|
||||
if (task->pix_left-border<=x<=task->pix_right+border &&
|
||||
task->pix_top-border<=y<=task->pix_bottom+border)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -301,7 +301,7 @@ Bool EdLite(U8 *filename,I64 num=1,I64 edf_dof_flags=0)
|
||||
}
|
||||
|
||||
U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum)
|
||||
{//"FI:D:/Dir/File.CPP,123" to "D:/Dir/File.CPP" and 123.
|
||||
{//"FI:D:/Dir/File.HC,123" to "D:/Dir/File.HC" and 123.
|
||||
U8 *st,*fl_file_line=StrNew(_fl_file_line);
|
||||
I64 linenum;
|
||||
StrFirstRem(fl_file_line,":");
|
||||
@@ -1,4 +1,4 @@
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
|
||||
U64 sys_font_cyrillic[256]= {
|
||||
0x0000000000000000,0x0000000000000000,
|
||||
@@ -1,4 +1,4 @@
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
|
||||
U64 sys_font_std[256]= {
|
||||
0x0000000000000000,0x0000000000000000,
|
||||
@@ -293,7 +293,7 @@ U8 *SrcEdLink(U8 *addr,I64 cnt=1,CTask *mem_task=NULL)
|
||||
}
|
||||
|
||||
Bool PutSrcLink(U8 *addr,I64 cnt=1,U8 *buf=NULL)
|
||||
{//Put to StdOut a $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.TXT"$ file,line link to src of addr.
|
||||
{//Put to StdOut a $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file,line link to src of addr.
|
||||
U8 *src;
|
||||
if (src=SrcEdLink(addr,cnt)) {
|
||||
if (buf)
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
|
||||
//See $LK,"::/Doc/TimeDate.TXT"$
|
||||
//See $LK,"::/Doc/TimeDate.DD"$
|
||||
|
||||
U16 mon_start_days1[12]={
|
||||
0,31,59,90,120,151,181,212,243,273,304,334};
|
||||
@@ -214,7 +214,7 @@ U0 Da(U8 **addr,I64 cnt=0x10)
|
||||
}
|
||||
}
|
||||
|
||||
U0 RawPrint(I64 mS=100,U8 *fmt,...)
|
||||
U0 RawPrint(I64 ms=100,U8 *fmt,...)
|
||||
{//Print using $LK,"Raw",A="MN:Raw"$ screen output for a length of time.
|
||||
//$BK,1$Your heap must be good.$BK,0$
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
@@ -224,14 +224,14 @@ U0 RawPrint(I64 mS=100,U8 *fmt,...)
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
"%s",buf;
|
||||
BusyWait(mS<<10);
|
||||
BusyWait(ms<<10);
|
||||
POPFD
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
U0 RawD(I64 mS=100,U8 *addr,I64 cnt=0x80)
|
||||
U0 RawD(I64 ms=100,U8 *addr,I64 cnt=0x80)
|
||||
{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$
|
||||
//screen output for a fixed length
|
||||
//of time.
|
||||
@@ -241,13 +241,13 @@ U0 RawD(I64 mS=100,U8 *addr,I64 cnt=0x80)
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
D(addr,cnt);
|
||||
BusyWait(mS<<10);
|
||||
BusyWait(ms<<10);
|
||||
POPFD
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
}
|
||||
|
||||
U0 RawDm(I64 mS=100,U8 *addr,I64 cnt=0x80)
|
||||
U0 RawDm(I64 ms=100,U8 *addr,I64 cnt=0x80)
|
||||
{//Dumps a block of mem using $LK,"Raw",A="MN:Raw"$
|
||||
//screen output for a fixed length
|
||||
//of time.
|
||||
@@ -257,7 +257,7 @@ U0 RawDm(I64 mS=100,U8 *addr,I64 cnt=0x80)
|
||||
old_raw=Raw(ON);
|
||||
old_input_filter=LBtr(&Fs->task_flags,TASKf_INPUT_FILTER_TASK);
|
||||
Dm(addr,cnt);
|
||||
BusyWait(mS<<10);
|
||||
BusyWait(ms<<10);
|
||||
POPFD
|
||||
LBEqu(&Fs->task_flags,TASKf_INPUT_FILTER_TASK,old_input_filter);
|
||||
Raw(old_raw);
|
||||
@@ -590,7 +590,7 @@ U0 Fault3(I64 fault_num,I64 fault_err_code)
|
||||
}
|
||||
|
||||
U0 Fault2(I64 fault_num,I64 fault_err_code)
|
||||
{//Called from $LK,"Fault2",A="FF:::/Kernel/KInts.CPP,Fault2"$.
|
||||
{//Called from $LK,"Fault2",A="FF:::/Kernel/KInts.HC,Fault2"$.
|
||||
//$BK,1$Be careful not to swap-out and ruin the saved context$BK,0$
|
||||
Bool was_raw,was_single_user,was_silent,was_in_dbg;
|
||||
I64 i,old_raw_flags=text.raw_flags;
|
||||
@@ -88,7 +88,7 @@ I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0)
|
||||
}
|
||||
|
||||
U0 DefinePrint(U8 *dname,U8 *src,...)
|
||||
{//Create DEFINE entry with $LK,"Print",A="FI:::/Doc/Print.TXT"$()ed string.
|
||||
{//Create DEFINE entry with $LK,"Print",A="FI:::/Doc/Print.DD"$()ed string.
|
||||
U8 *buf=StrPrintJoin(NULL,src,argc,argv);
|
||||
DefineLoad(dname,buf);
|
||||
Free(buf);
|
||||
@@ -10,7 +10,7 @@ U0 SysGlblsInit()
|
||||
QueInit(&sys_macro_head);
|
||||
|
||||
blkdev.dft_iso_filename=AStrNew("::/Temp/CDDVD.ISO");
|
||||
blkdev.temp_filename=AStrNew("~/Temp.TXT.Z");
|
||||
blkdev.temp_filename=AStrNew("~/Temp.DD.Z");
|
||||
blkdev.dvd_boot_is_good=TRUE;
|
||||
#exe {
|
||||
if (!kernel_cfg->auto_mount_ide_hd_let)
|
||||
@@ -132,7 +132,7 @@ U0 Reboot()
|
||||
}
|
||||
|
||||
U0 KernelMain()
|
||||
{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart64.CPP,I32 &Kernel"$
|
||||
{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart64.HC,I32 &Kernel"$
|
||||
OutU8(0x61,InU8(0x61)&~3); //Snd(0);
|
||||
adam_task=Fs;
|
||||
BlkPoolsInit;
|
||||
@@ -200,7 +200,7 @@ U0 KernelMain()
|
||||
InDbg(OFF);
|
||||
cnts.time_stamp_freq_initial=TimeStampFreqCal;
|
||||
Cd("/");
|
||||
try ExeFile("StartOS"); //Continues $LK,"/StartOS.CPP",A="FL:/StartOS.CPP,1"$
|
||||
try ExeFile("StartOS"); //Continues $LK,"/StartOS.HC",A="FL:/StartOS.HC,1"$
|
||||
catch {
|
||||
Raw(ON);
|
||||
Silent(OFF);
|
||||
File renamed without changes.
@@ -17,8 +17,8 @@ extern CBlkDev *BlkDevNextFreeSlot(U8 first_drv_let,I64 type);
|
||||
extern Bool BlkDevUnlock(CBlkDev *bd,Bool rst=FALSE);
|
||||
extern U0 BlkDevsRelease();
|
||||
extern U8 *Caller(I64 num=1);
|
||||
extern U8 *CatPrint(U8 *dst,U8 *fmt,...);
|
||||
extern Bool Cd(U8 *name,Bool make_dirs=FALSE);
|
||||
extern U8 *CatPrint(U8 *_dst,U8 *fmt,...);
|
||||
extern Bool Cd(U8 *dirname=NULL,Bool make_dirs=FALSE);
|
||||
extern U0 Dbg(U8 *msg=NULL,I64 msg_num=0);
|
||||
extern U0 DbgHelp();
|
||||
extern U8 *Define(U8 *dname);
|
||||
@@ -26,7 +26,7 @@ extern I64 DefineMatch(U8 *needle,U8 *haystack_lst_dname,I64 flags=0);
|
||||
extern U8 *DefineSub(I64 sub,U8 *dname);
|
||||
extern I64 Del(U8 *files_find_mask,Bool make_mask=FALSE,
|
||||
Bool del_dir=FALSE,Bool print_msg=TRUE);
|
||||
extern U8 *DftExt(U8 *name,U8 *extension);
|
||||
extern U8 *DftExt(U8 *filename,U8 *extension);
|
||||
extern Bool Drv(U8 drv_let);
|
||||
extern U8 Drv2Let(CDrv *dv=NULL);
|
||||
extern U0 DrvBlkDevDel(CBlkDev *bd);
|
||||
@@ -38,7 +38,7 @@ extern U0 DskCacheInvalidate(CDrv *dv);
|
||||
extern U0 Exit();
|
||||
extern I64 FAT32AllocClusters(CDrv *dv,I64 c,I64 cnt);
|
||||
extern I64 FAT32AllocContiguousClusters(CDrv *dv,I64 cnt);
|
||||
extern Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempdee,
|
||||
extern Bool FAT32DirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,
|
||||
Bool free_old_chain);
|
||||
extern U0 FAT32DrvInit(CDrv *dv);
|
||||
extern Bool FAT32FileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name,
|
||||
@@ -49,11 +49,11 @@ extern Bool FRBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1);
|
||||
extern Bool FWBlks(CFile *f,U8 *buf,I64 blk=FFB_NEXT_BLK,I64 cnt=1);
|
||||
extern U8 *FileExtRem(U8 *src,U8 *dst=NULL);
|
||||
extern Bool FileFind(U8 *filename,CDirEntry *_de=NULL,I64 fuf_flags=0);
|
||||
extern U8 *FileNameAbs(U8 *name,I64 fuf_flags=0);
|
||||
extern U8 *FileNameAbs(U8 *_filename,I64 fuf_flags=0);
|
||||
extern U8 *FileRead(U8 *filename,I64 *_size=NULL,I64 *_attr=NULL);
|
||||
extern I64 FileWrite(U8 *filename,U8 *fbuf,I64 size,CDate cdt=0,I64 attr=0);
|
||||
extern I64 FlushMsgs(CTask *task=NULL);
|
||||
extern I64 GetChar(I64 *scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE);
|
||||
extern I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE);
|
||||
extern I64 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE);
|
||||
extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,
|
||||
CTask *task=NULL,CBlkPool *bp);
|
||||
@@ -64,20 +64,20 @@ extern Bool IsDbg();
|
||||
extern Bool IsDir(U8 *dir_name);
|
||||
extern Bool IsRaw();
|
||||
extern CBlkDev *Let2BlkDev(U8 drv_let=0,Bool except=TRUE);
|
||||
extern I64 Let2BlkDevType(U8 drv_let=0);
|
||||
extern I64 Let2BlkDevType(U8 drv_let);
|
||||
extern CDrv *Let2Drv(U8 drv_let=0,Bool except=TRUE);
|
||||
extern U0 MPInt(I64 num,I64 cpu_num=1);
|
||||
extern U0 MPInt(U8 num,I64 cpu_num=1);
|
||||
extern U8 *MStrPrint(U8 *fmt,...);
|
||||
extern Bool MkDir(U8 *filename,I64 entry_cnt=0);
|
||||
extern U0 MouseIPSet(I64 x,I64 y,I64 z,I64 l,I64 r);
|
||||
extern U0 Msg(I64 code,I64 a1,I64 a2,I64 flags=0);
|
||||
extern U0 Msg(I64 msg_code,I64 a1,I64 a2,I64 flags=0);
|
||||
extern I64 PopUp(U8 *buf,CTask *parent=NULL,CTask **_pu_task=NULL);
|
||||
extern U0 Print(U8 *fmt,...);
|
||||
extern U0 PutChars(U64 ch);
|
||||
extern U0 PutS(U8 *st); //Use $LK,"Print",A="MN:Print"$()
|
||||
extern Bool RBlks(CDrv *dv,U8 *buf, I64 blk, I64 cnt);
|
||||
extern I64 RedSeaAllocClusters(CDrv *dv,I64 cnt);
|
||||
extern Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempdee,
|
||||
extern Bool RedSeaDirNew(CDrv *dv,U8 *cur_dir,CDirEntry *tempde,
|
||||
Bool free_old_chain);
|
||||
extern U0 RedSeaDrvInit(CDrv *dv);
|
||||
extern Bool RedSeaDrvValidate(U8 drv_let);
|
||||
@@ -96,7 +96,7 @@ extern U8 *StrPrint(U8 *dst,U8 *fmt,...);
|
||||
extern U0 StrPrintFunSeg(U8 *buf,I64 addr,I64 field_len,I64 flags);
|
||||
extern Bool Suspend(CTask *task=NULL,Bool state=TRUE);
|
||||
extern CSrvCmd *TaskMsg(CTask *_srv,CTask *master,
|
||||
I64 code,I64 a1,I64 a2,I64 flags);
|
||||
I64 msg_code,I64 a1,I64 a2,I64 flags);
|
||||
extern U0 TaskRstAwaitingMsg(CTask *task=NULL);
|
||||
extern Bool TaskValidate(CTask *task);
|
||||
extern U0 TaskWait(CTask *task=NULL);
|
||||
@@ -1,5 +1,5 @@
|
||||
//Compiler initializes glbls in AOT bin modules to zero.
|
||||
//$LK,"Globals Set to Zero Here",A="FF:::/Compiler/PrsStmt.CPP,sys_var_init_flag"$.
|
||||
//$LK,"Globals Set to Zero Here",A="FF:::/Compiler/PrsStmt.HC,sys_var_init_flag"$.
|
||||
|
||||
CSrvCmd sys_macro_head;
|
||||
CTask *sys_macro_task;
|
||||
@@ -20,7 +20,7 @@ CBlkDevGlbls blkdev;
|
||||
CCntsGlbls cnts={1,0,2676302000,2676302,2676302000,0,0,0,FALSE};
|
||||
CDbgGlbls dbg;
|
||||
CDevGlbls dev;
|
||||
CGridGlbls ip_grid; //See $LK,"::/Demo/Graphics/Grid.CPP"$.
|
||||
CGridGlbls ip_grid; //See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
CIPStateGlbls ip,ip_last;
|
||||
CKbdStateGlbls kbd;
|
||||
CKeyDevGlbls keydev;
|
||||
File renamed without changes.
@@ -70,8 +70,8 @@ U0 HashDel(CHashSrcSym *temph)
|
||||
Free(temph->dbg_info);
|
||||
if (temph->type & (HTT_FUN | HTT_CLASS))
|
||||
//Assumes code not on heap, so doesn't Free.
|
||||
//$LK,"MemberLstDel",A="MN:MemberLstDel"$() is an import to the Kernel module
|
||||
MemberLstDel(temph);
|
||||
//$LK,"ClassMemberLstDel",A="MN:ClassMemberLstDel"$() is an import to the Kernel module
|
||||
ClassMemberLstDel(temph);
|
||||
else if (temph->type&HTT_DEFINE_STR)
|
||||
Free(temph(CHashDefineStr *)->data);
|
||||
else if (temph->type & HTT_GLBL_VAR) {
|
||||
@@ -204,7 +204,7 @@ I64 HashLstAdd(U8 *lst,I64 type,CHashTable *table)
|
||||
}
|
||||
|
||||
I64 HashDefineLstAdd(U8 *dname,I64 type,CHashTable *table)
|
||||
{//Add define list to a hash table. See $LK,"::/Adam/DolDoc/DocInit.CPP",A="FF:::/Adam/DolDoc/DocInit.CPP,HashDefineLstAdd"$.
|
||||
{//Add define list to a hash table. See $LK,"::/Adam/DolDoc/DocInit.HC",A="FF:::/Adam/DolDoc/DocInit.HC,HashDefineLstAdd"$.
|
||||
CHashDefineStr *temph;
|
||||
if (temph=HashFind(dname,Fs->hash_table,HTT_DEFINE_STR))
|
||||
return HashLstAdd(temph->data,type,table);
|
||||
@@ -87,7 +87,7 @@ INT_FAULT::
|
||||
PUSH U64 CTask.fault_err_code[RSI]
|
||||
PUSH U64 CTask.fault_num[RSI]
|
||||
MOV RSI,CTask.rsi[RSI]
|
||||
CALL &Fault2 //See $LK,"Fault2",A="FF:::/Kernel/KDbg.CPP,Fault2"$
|
||||
CALL &Fault2 //See $LK,"Fault2",A="FF:::/Kernel/KDbg.HC,Fault2"$
|
||||
JMP I32 RESTORE_FS_TASK
|
||||
|
||||
INT_FAULT_ERR_CODE_BITMAP::
|
||||
@@ -108,8 +108,8 @@ U8 *IntEntryGet(I64 irq)
|
||||
|
||||
U8 *IntEntrySet(I64 irq,U0 (*fp_new_handler)(),I64 type=IDTET_IRQ,I64 dpl=0)
|
||||
{//Set interrupt vector. See $LK,"IDTET_IRQ",A="MN:IDTET_IRQ"$.
|
||||
//See $LK,"::/Demo/Lectures/InterruptDemo.CPP"$.
|
||||
//See $LK,"::/Demo/MultiCore/Interrupts.CPP"$.
|
||||
//See $LK,"::/Demo/Lectures/InterruptDemo.HC"$.
|
||||
//See $LK,"::/Demo/MultiCore/Interrupts.HC"$.
|
||||
I64 fp=fp_new_handler;
|
||||
U8 *res,*dst;
|
||||
PUSHFD
|
||||
@@ -191,7 +191,7 @@ CBinFile *Load(U8 *filename,I64 ld_flags=0,CBinFile *bfh_addr=INVALID_PTR)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//See $LK,"Patch Table Generation",A="FF:::/Compiler/CMain.CPP,IET_ABS_ADDR"$
|
||||
//See $LK,"Patch Table Generation",A="FF:::/Compiler/CMain.HC,IET_ABS_ADDR"$
|
||||
module_align=1<<bfh->module_align_bits;
|
||||
if (!module_align || bfh->bin_signature!=BIN_SIGNATURE_VAL) {
|
||||
Free(bfh);
|
||||
@@ -242,7 +242,7 @@ U0 LoadKernel()
|
||||
HashGenericAdd(KERNEL_MODULE_NAME,HTT_MODULE|HTF_PUBLIC,
|
||||
sys_boot_base-sizeof(CBinFile));
|
||||
|
||||
//Abs patches done here $LK,"CPatchTableAbsAddr",A="FF:D:/Kernel/KStart32.CPP,CPatchTableAbsAddr"$.
|
||||
//Abs patches done here $LK,"CPatchTableAbsAddr",A="FF:D:/Kernel/KStart32.HC,CPatchTableAbsAddr"$.
|
||||
LoadPass1(sys_boot_patch_table_base,sys_boot_base,LDF_NO_ABSS|LDF_SILENT);
|
||||
|
||||
//No main routines
|
||||
File renamed without changes.
@@ -70,7 +70,7 @@ I64 CeilI64(I64 num,I64 to)
|
||||
}
|
||||
}
|
||||
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
I16 RandI16()
|
||||
{//Random I16.
|
||||
Fs->rand_seed=6364136223846793005*Fs->rand_seed+1442695040888963407;
|
||||
@@ -45,7 +45,7 @@ I64 BCnt(I64 d)
|
||||
}
|
||||
|
||||
U0 IntCore0TimerHandler(CTask *)
|
||||
{//Called from $LK,"IntCore0TimerHandler",A="FF:::/Kernel/KInts.CPP,IntCore0TimerHandler"$
|
||||
{//Called from $LK,"IntCore0TimerHandler",A="FF:::/Kernel/KInts.HC,IntCore0TimerHandler"$
|
||||
I64 i;
|
||||
if (mp_cnt>1)
|
||||
while (LBts(&sys_semas[SYS_SEMA_SYS_TIMER],0))
|
||||
@@ -152,12 +152,12 @@ U0 SleepUntil(I64 wake_jiffy)
|
||||
LBEqu(&Fs->task_flags,TASKf_IDLE,old_idle);
|
||||
}
|
||||
|
||||
U0 Sleep(I64 mS)
|
||||
U0 Sleep(I64 ms)
|
||||
{//Not for power-saving. It is to make a program pause without hogging the CPU.
|
||||
if (!mS)
|
||||
if (!ms)
|
||||
Yield;
|
||||
else
|
||||
SleepUntil(cnts.jiffies+mS*JIFFY_FREQ/1000);
|
||||
SleepUntil(cnts.jiffies+ms*JIFFY_FREQ/1000);
|
||||
}
|
||||
|
||||
U0 Snd(F64 freq)
|
||||
@@ -1,11 +1,11 @@
|
||||
asm {/* See $LK,"::/Doc/Boot.TXT"$.
|
||||
asm {/* See $LK,"::/Doc/Boot.DD"$.
|
||||
TempleOS starts in real, calls some BIOS
|
||||
routines, switches to 32 bit, and 64 bit mode
|
||||
and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.TXT"$ at $LK,"KernelMain",A="MN:KernelMain"$().
|
||||
and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ at $LK,"KernelMain",A="MN:KernelMain"$().
|
||||
|
||||
The boot loader jumps here in real-mode (16-bit).
|
||||
It actually jumps to the $LK,"CBinFile",A="MN:CBinFile"$ header which is
|
||||
placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.CPP,16 ALIGN"$.
|
||||
placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.HC,16 ALIGN"$.
|
||||
The header begins with a short jmp to
|
||||
the start of this file's code which begins
|
||||
with the following small jump past some data.
|
||||
@@ -41,8 +41,8 @@ GDT_NULL: DU64 0,0;
|
||||
GDT_BOOT_DS: DU64 0x00CF92000000FFFF,0; //Gets patched.
|
||||
GDT_BOOT_CS: DU64 0x00CF9A000000FFFF,0; //Gets patched.
|
||||
GDT_CS32: DU64 0x00CF9A000000FFFF,0;
|
||||
GDT_CS64: DU64 0x00209A0000000000,0; //The $LK,"Charter",A="FI:::/Doc/Charter.TXT"$ says just ring0.
|
||||
GDT_CS64_RING3: DU64 0x0020FA0000000000,0; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.CPP"$, so you can play with.
|
||||
GDT_CS64: DU64 0x00209A0000000000,0; //The $LK,"Charter",A="FI:::/Doc/Charter.DD"$ says just ring0.
|
||||
GDT_CS64_RING3: DU64 0x0020FA0000000000,0; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.HC"$, so you can play with.
|
||||
GDT_DS: DU64 0x00CF92000000FFFF,0;
|
||||
GDT_DS_RING3: DU64 0x00CFF2000000FFFF,0;
|
||||
GDT_TR: DU8 MP_MAX_PROCESSORS*16 DUP(0);
|
||||
@@ -53,12 +53,12 @@ GDT_TR_RING3: DU8 MP_MAX_PROCESSORS*16 DUP(0);
|
||||
|
||||
//************************************
|
||||
CORE0_16BIT_INIT::
|
||||
//EAX is $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.CPP,[SYS_BOOT_SRC]"$. (Val passed from boot blk, $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.CPP,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.CPP,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,BOOT_SRC_RAM"$.)
|
||||
//EAX is $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.HC,[SYS_BOOT_SRC]"$. (Val passed from boot blk, $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.HC,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.HC,BOOT_SRC_RAM"$.)
|
||||
MOV ECX,EAX
|
||||
MOV AX,(BOOT_RAM_LIMIT-BOOT_STK_SIZE)/16
|
||||
MOV SS,AX
|
||||
MOV SP,BOOT_STK_SIZE
|
||||
PUSH ECX //Will be $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.CPP,[SYS_BOOT_SRC]"$. See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.CPP,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.CPP,BOOT_SRC_DVD"$ & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,BOOT_SRC_RAM"$.
|
||||
PUSH ECX //Will be $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.HC,[SYS_BOOT_SRC]"$. See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.HC,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,BOOT_SRC_DVD"$ & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.HC,BOOT_SRC_RAM"$.
|
||||
PUSH EBX
|
||||
|
||||
CALL U16 GET_IP
|
||||
@@ -133,7 +133,7 @@ GET_IP: POP BX
|
||||
OUT 0x92,AL
|
||||
|
||||
POP U32 [SYS_BOOT_BLK]
|
||||
POP U32 [SYS_BOOT_SRC] //See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.CPP,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.CPP,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,BOOT_SRC_RAM"$.
|
||||
POP U32 [SYS_BOOT_SRC] //See $LK,"BootHD",A="FF:::/Adam/Opt/Boot/BootHD.HC,BOOT_SRC_HARDDRV"$, $LK,"BootDVD",A="FF:::/Adam/Opt/Boot/BootDVD.HC,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Adam/Opt/Boot/BootRAM.HC,BOOT_SRC_RAM"$.
|
||||
|
||||
CLD
|
||||
XOR EAX,EAX
|
||||
File renamed without changes.
@@ -71,7 +71,7 @@ USE64
|
||||
RET
|
||||
|
||||
//************************************
|
||||
SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/Adam/Opt/Boot/BootRAM.CPP,SYS_RAM_REBOOT:2"$
|
||||
SYS_RAM_REBOOT:: //This gets copied high. $LK,"SYS_RAM_REBOOT",A="FF:::/Adam/Opt/Boot/BootRAM.HC,SYS_RAM_REBOOT:2"$
|
||||
PUSH U32 CGDT.ds //stk seg
|
||||
PUSH U32 BOOT_RAM_LIMIT //stk
|
||||
PUSH U32 0 //flags
|
||||
@@ -25,6 +25,18 @@ Bool TaskValidate(CTask *task)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
U0 BirthWait(CTask **_task,I64 task_num=-1)
|
||||
{//Wait for task valid and not task_num.
|
||||
while (!TaskValidate(*_task)||(*_task)->task_num==task_num)
|
||||
Yield;
|
||||
}
|
||||
|
||||
U0 DeathWait(CTask **_task)
|
||||
{//Wait for task death.
|
||||
while (TaskValidate(*_task))
|
||||
Yield;
|
||||
}
|
||||
|
||||
Bool Kill(CTask *task,Bool wait=TRUE)
|
||||
{//Terminate other task.
|
||||
I64 i;
|
||||
@@ -78,7 +90,7 @@ CTaskStk *TaskStkNew(I64 stk_size,CTask *task)
|
||||
argpop I64 CallStkGrow(I64 stk_size_threshold,I64 stk_size,
|
||||
/*argpop*/I64 (*fp_addr)(...),...)
|
||||
{//Grow stk in call with any fixed num of args.
|
||||
//See $LK,"::/Demo/StkGrow.CPP"$.
|
||||
//See $LK,"::/Demo/StkGrow.HC"$.
|
||||
CTaskStk *temps,*temps2,**_stk;
|
||||
I64 res,*rsp,*rsp2,*old_stk;
|
||||
|
||||
@@ -196,7 +208,7 @@ I64 TaskInit(CTask *task,I64 stk_size)
|
||||
task->win_top =13;
|
||||
task->win_bottom =text.rows-2;
|
||||
|
||||
if (blkdev.home_dir) {//Beware Adam $LK,"TaskInit",A="FF:::/Kernel/KStart64.CPP,TaskInit"$. I guess ok until $LK,"ChgDsk",A="FF:::/Kernel/KEnd.CPP,ChgDsk"$().
|
||||
if (blkdev.home_dir) {//Beware Adam $LK,"TaskInit",A="FF:::/Kernel/KStart64.HC,TaskInit"$. I guess ok until $LK,"ChgDsk",A="FF:::/Kernel/KEnd.HC,ChgDsk"$().
|
||||
task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A'];
|
||||
task->cur_dir=StrNew(blkdev.home_dir+2,task);
|
||||
} else
|
||||
@@ -208,7 +220,7 @@ I64 TaskInit(CTask *task,I64 stk_size)
|
||||
}
|
||||
|
||||
CTask *Spawn(U0 (*fp_start_addr)(U8 *data),U8 *data=NULL,U8 *task_name=NULL,
|
||||
I64 target_cpu=-1, //-1 for current CPU. See $LK,"multi-core",A="FI:::/Demo/MultiCore/LoadTest.CPP"$.
|
||||
I64 target_cpu=-1, //-1 for current CPU. See $LK,"multi-core",A="FI:::/Demo/MultiCore/LoadTest.HC"$.
|
||||
CTask *parent=NULL, //NULL means adam
|
||||
I64 stk_size=0, //0=default
|
||||
I64 flags=1<<SVCf_ADD_TO_QUE)
|
||||
@@ -497,7 +509,7 @@ I64 TaskEnd()
|
||||
|
||||
U0 TaskKillDying()
|
||||
{//Delay freeing to prevent asking for trouble with quick reincarnations.
|
||||
//What if the user is doing this: $LK,"DoTreeCheckers",A="FF:::/Misc/OSTestSuite.CPP,DoTreeCheckers"$.
|
||||
//What if the user is doing this: $LK,"DoTreeCheckers",A="FF:::/Misc/OSTestSuite.HC,DoTreeCheckers"$.
|
||||
CTaskDying *task,*task1;
|
||||
if (Gs->kill_jiffy<cnts.jiffies) {//Avoid doing as many lock operations.
|
||||
while (LBts(&Gs->cpu_flags,CPUf_DYING_TASK_QUE))
|
||||
File renamed without changes.
+2891
-2883
File diff suppressed because it is too large.
Load diff
+5
-5
@@ -1,5 +1,5 @@
|
||||
//Compile this by calling $LK,"BootHDIns",A="MN:BootHDIns"$().
|
||||
//Don't do it directly. See $LK,"Cmp(\"/Kernel/Kernel\")",A="FF:::/Adam/Opt/Boot/BootHDIns.CPP,Cmp(\"/Kernel/Kernel\""$.
|
||||
//Don't do it directly. See $LK,"Cmp(\"/Kernel/Kernel\")",A="FF:::/Adam/Opt/Boot/BootHDIns.HC,Cmp(\"/Kernel/Kernel\""$.
|
||||
|
||||
#exe {
|
||||
Cd(__DIR__);;
|
||||
@@ -10,19 +10,19 @@
|
||||
kernel_cfg=KernelCfgNew;
|
||||
};
|
||||
|
||||
#include "KernelA.HPP"
|
||||
#include "KernelA.HH"
|
||||
#include "KStart16"
|
||||
#include "KStart32"
|
||||
#include "KStart64"
|
||||
#include "KMathA"
|
||||
#include "KUtils"
|
||||
#exe {Option(OPTf_KEEP_PRIVATE,ON);};
|
||||
#include "/Compiler/CompilerA.HPP"
|
||||
#include "/Compiler/CompilerA.HH"
|
||||
#exe {Option(OPTf_EXTERNS_TO_IMPORTS,ON);};
|
||||
#include "/Compiler/CompilerB.HPP"
|
||||
#include "/Compiler/CompilerB.HH"
|
||||
#exe {Option(OPTf_EXTERNS_TO_IMPORTS,OFF);};
|
||||
#exe {Option(OPTf_KEEP_PRIVATE,OFF);};
|
||||
#include "KernelB.HPP"
|
||||
#include "KernelB.HH"
|
||||
#include "KExts"
|
||||
#include "StrA"
|
||||
#include "KGlbls"
|
||||
|
||||
@@ -61,7 +61,7 @@ extern class CTask;
|
||||
whole if no member is specified,
|
||||
similar to bit fields.
|
||||
|
||||
See $LK,"EndianI64",A="MN:EndianI64"$() and $LK,"::/Demo/SubIntAccess.CPP"$.
|
||||
See $LK,"EndianI64",A="MN:EndianI64"$() and $LK,"::/Demo/SubIntAccess.HC"$.
|
||||
*/
|
||||
U16i union U16
|
||||
{
|
||||
@@ -338,8 +338,8 @@ class CGDT
|
||||
CGDTEntry boot_ds;
|
||||
CGDTEntry boot_cs;
|
||||
CGDTEntry cs32;
|
||||
CGDTEntry cs64; //The $LK,"Charter",A="FI:::/Doc/Charter.TXT"$ says just ring-0.
|
||||
CGDTEntry cs64_ring3; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.CPP"$, in case you want to play around.
|
||||
CGDTEntry cs64; //The $LK,"Charter",A="FI:::/Doc/Charter.DD"$ says just ring-0.
|
||||
CGDTEntry cs64_ring3; //$LK,"Ring3",A="FI:::/Demo/Lectures/Ring3.HC"$, in case you want to play around.
|
||||
CGDTEntry ds;
|
||||
CGDTEntry ds_ring3;
|
||||
CGDTEntry tr[MP_MAX_PROCESSORS];
|
||||
@@ -370,13 +370,13 @@ class CMemE820
|
||||
|
||||
#define BIN_SIGNATURE_VAL 'TOSB'
|
||||
class CBinFile
|
||||
{//$LK,"Bin File Header Generation",A="FF:::/Compiler/CMain.CPP,16 ALIGN"$ by compiler.
|
||||
{//$LK,"Bin File Header Generation",A="FF:::/Compiler/CMain.HC,16 ALIGN"$ by compiler.
|
||||
U16 jmp;
|
||||
U8 module_align_bits,
|
||||
reserved;
|
||||
U32 bin_signature;
|
||||
I64 module_org,
|
||||
patch_table_offset, //$LK,"Patch Table Generation",A="FF:::/Compiler/CMain.CPP,IET_ABS_ADDR"$
|
||||
patch_table_offset, //$LK,"Patch Table Generation",A="FF:::/Compiler/CMain.HC,IET_ABS_ADDR"$
|
||||
file_size;
|
||||
};
|
||||
|
||||
@@ -416,7 +416,7 @@ class CPatchTableAbsAddr
|
||||
|
||||
#help_index "Boot"
|
||||
class CKernel
|
||||
{//Must match $LK,"OSStartUp",A="FF:::/Kernel/KStart16.CPP,SYS_BOOT_BASE"$
|
||||
{//Must match $LK,"OSStartUp",A="FF:::/Kernel/KStart16.HC,SYS_BOOT_BASE"$
|
||||
CBinFile h;
|
||||
U32 jmp,
|
||||
boot_src,
|
||||
@@ -580,7 +580,7 @@ class CRAXRBCRCXRDX
|
||||
#define EXT_NUM_ENTRIES 5
|
||||
|
||||
#help_index "Processor"
|
||||
#define DFT_CACHE_LINE_WIDTH 64
|
||||
#define DFT_CACHE_LINE_WIDTH 128
|
||||
#define SEMA_STRUCT_SIZE DFT_CACHE_LINE_WIDTH
|
||||
|
||||
//Semaphores
|
||||
@@ -648,7 +648,7 @@ public class CHashTable
|
||||
|
||||
#help_index "Hash/System"
|
||||
//Hash table types
|
||||
//$LK,"ST_HTT_TYPES",A="FF:::/Kernel/KDefine.CPP,ST_HTT_TYPES"$
|
||||
//$LK,"ST_HTT_TYPES",A="FF:::/Kernel/KDefine.HC,ST_HTT_TYPES"$
|
||||
#define HTt_EXPORT_SYS_SYM 0
|
||||
#define HTt_IMPORT_SYS_SYM 1
|
||||
#define HTt_DEFINE_STR 2
|
||||
@@ -688,8 +688,8 @@ public class CHashTable
|
||||
#define HTT_FUN 0x00040 //CHashFun
|
||||
#define HTT_WORD 0x00080 //CHashAC only in AutoComplete table
|
||||
#define HTT_DICT_WORD 0x00100 //CHashGeneric only in AutoComplete tbl
|
||||
#define HTT_KEYWORD 0x00200 //CHashGeneric $LK,"KEYWORD",A="FF:::/Compiler/OpCodes.TXT,KEYWORD"$
|
||||
#define HTT_ASM_KEYWORD 0x00400 //CHashGeneric $LK,"ASM_KEYWORD",A="FF:::/Compiler/OpCodes.TXT,ASM_KEYWORD"$
|
||||
#define HTT_KEYWORD 0x00200 //CHashGeneric $LK,"KEYWORD",A="FF:::/Compiler/OpCodes.DD,KEYWORD"$
|
||||
#define HTT_ASM_KEYWORD 0x00400 //CHashGeneric $LK,"ASM_KEYWORD",A="FF:::/Compiler/OpCodes.DD,ASM_KEYWORD"$
|
||||
#define HTT_OPCODE 0x00800 //CHashOpcode
|
||||
#define HTT_REG 0x01000 //CHashReg
|
||||
#define HTT_FILE 0x02000 //CHashGeneric
|
||||
@@ -1229,7 +1229,7 @@ class CEdFindText
|
||||
"A=\"Replace :%s\"$$\n";
|
||||
Bool replace fmtstr "$$CB,\"Replace\"$$\n",
|
||||
scan_fwd fmtstr "$$CB,\"Fwd\"$$\n",
|
||||
scan_sel_text fmtstr "$$CB,\"Sellection\"$$\n",
|
||||
scan_sel_text fmtstr "$$CB,\"Selection\"$$\n",
|
||||
match_case fmtstr "$$CB,\"Match Case\"$$\n",
|
||||
whole_labels fmtstr "$$CB,\"Whole Labels\"$$\n",
|
||||
local_var fmtstr "$$CB,\"Rename Local Var\"$$\n",
|
||||
@@ -1374,7 +1374,7 @@ public class CDoc //Linked Text File header
|
||||
CEdFindText *find_replace;
|
||||
|
||||
U8 *cur_sprite;//Set cur_sprite use (ip.pos.x,ip.pos.y) as input.
|
||||
//Output is nearest. See $LK,"*_cur_elem_num=",A="FF:::/Adam/Gr/SpriteEd.CPP,*_cur_elem_num=doc->"$ and $LK,"::/Demo/Graphics/Pick.CPP"$.
|
||||
//Output is nearest. See $LK,"*_cur_elem_num=",A="FF:::/Adam/Gr/SpriteEd.HC,*_cur_elem_num=doc->"$ and $LK,"::/Demo/Graphics/Pick.HC"$.
|
||||
I64 nearest_sprite_elem_num;
|
||||
|
||||
CEdFileName filename;
|
||||
@@ -1382,7 +1382,7 @@ public class CDoc //Linked Text File header
|
||||
I64 (*left_click_link)(CDoc *doc,CDocEntry *doc_e);
|
||||
I64 (*right_click_link)(CDoc *doc,CDocEntry *doc_e);
|
||||
|
||||
//See $LK,"::/Apps/Psalmody/JukeBox.CPP"$
|
||||
//See $LK,"::/Apps/Psalmody/JukeBox.HC"$
|
||||
U8 *user_put_data; //Passed to user_put_key() and user_put_s()
|
||||
Bool (*user_put_key)(CDoc *doc,U8 *data,I64 ch,I64 sc);
|
||||
Bool (*user_put_s)(CDoc *doc,U8 *data,U8 *st);
|
||||
@@ -1473,7 +1473,6 @@ public class CWinMgrGlbls
|
||||
last_ode_time,
|
||||
fps, //You can read but not write this. You have no control.
|
||||
last_refresh_tS;
|
||||
CTask *old_focus_task;
|
||||
CWinMgrTimingGlbls *t;
|
||||
Bool show_menu,
|
||||
grab_scroll,
|
||||
@@ -1538,6 +1537,7 @@ public class CAutoCompleteDictGlbls
|
||||
#define OPTf_WARN_UNUSED_VAR 0x10 //Applied to funs, not stmts
|
||||
#define OPTf_WARN_PAREN 0x11 //Warn unnecessary parens
|
||||
#define OPTf_WARN_DUP_TYPES 0x12 //Warn dup local var type stmts
|
||||
#define OPTf_WARN_HEADER_MISMATCH 0x13
|
||||
#define OPTf_EXTERNS_TO_IMPORTS 0x20
|
||||
#define OPTf_KEEP_PRIVATE 0x21
|
||||
#define OPTf_NO_REG_VAR 0x22 //Applied to funs, not stmts
|
||||
@@ -1739,7 +1739,7 @@ class CCodeMisc
|
||||
//Slash value
|
||||
#define SV_R_REG 8
|
||||
#define SV_I_REG 9
|
||||
#define SV_STI_LIKE 10 //$LK,"uasm_slash_val",A="FF:::/Compiler/AsmInit.CPP,uasm_slash_val"$ only.
|
||||
#define SV_STI_LIKE 10 //$LK,"uasm_slash_val",A="FF:::/Compiler/AsmInit.HC,uasm_slash_val"$ only.
|
||||
#define SV_NONE 11
|
||||
class CInst
|
||||
{
|
||||
@@ -1811,7 +1811,7 @@ I64 class CAbsCntsI64
|
||||
};
|
||||
|
||||
class CAsmUndefHash
|
||||
{//Only place created is $LK,"Exp Parser",A="FF:::/Compiler/PrsExp.CPP,sizeof(CAsmUndefHash)"$ when an undef is found in an ASM exp.
|
||||
{//Only place created is $LK,"Exp Parser",A="FF:::/Compiler/PrsExp.HC,sizeof(CAsmUndefHash)"$ when an undef is found in an ASM exp.
|
||||
CAsmUndefHash *next;
|
||||
CHashExport *hash;
|
||||
};
|
||||
@@ -2106,7 +2106,7 @@ class CAOTCtrl
|
||||
#define TK_ELSE 0x121
|
||||
#define TK_MOD_EQU 0x122
|
||||
#define TK_DOT_DOT 0x123
|
||||
#define TK_DOT_DOT_DOT 0x124
|
||||
#define TK_ELLIPSIS 0x124
|
||||
#define TK_INS_BIN 0x125
|
||||
#define TK_INS_BIN_SIZE 0x126
|
||||
#define TK_NUM_TK 0x127
|
||||
@@ -2254,7 +2254,7 @@ public class CATARep
|
||||
I64 num,type,base0,base1,unit,irq;
|
||||
};
|
||||
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
#define ATA_NOP 0x00
|
||||
#define ATA_DEV_RST 0x08
|
||||
#define ATA_PACKET 0xA0
|
||||
@@ -2286,10 +2286,10 @@ public class CATARep
|
||||
#define ATAR1_CTRL 2
|
||||
|
||||
#help_index "File/FileNames"
|
||||
#define FILEMASK_JIT "*.CPP*;*.HPP*"
|
||||
#define FILEMASK_AOT "*.CPP*;*.HPP*;*.PRJ*"
|
||||
#define FILEMASK_SRC "*.CPP*;*.HPP*;*.AUT*;*.PRJ*"
|
||||
#define FILEMASK_TXT FILEMASK_SRC ";*.TXT*;*.LOG*"
|
||||
#define FILEMASK_JIT "*.HC*;*.HH*"
|
||||
#define FILEMASK_AOT "*.HC*;*.HH*;*.PRJ*"
|
||||
#define FILEMASK_SRC "*.HC*;*.HH*;*.AUT*;*.PRJ*"
|
||||
#define FILEMASK_TXT FILEMASK_SRC ";*.DD*;*.TXT*"
|
||||
#define FILEMASK_GRA "*.GRA*;*.BMP*"
|
||||
|
||||
#help_index "File/Low Level"
|
||||
@@ -2756,7 +2756,7 @@ class CCacheBlk
|
||||
public class CBlkDevGlbls
|
||||
{
|
||||
CBlkDev *blkdevs;
|
||||
U8 *dft_iso_filename; //See $LK,"blkdev.dft_iso_filename",A="FF:::/Kernel/KEnd.CPP,blkdev.dft_iso_filename"$
|
||||
U8 *dft_iso_filename; //See $LK,"blkdev.dft_iso_filename",A="FF:::/Kernel/KEnd.HC,blkdev.dft_iso_filename"$
|
||||
U8 *temp_filename;
|
||||
U8 *home_dir;
|
||||
CCacheBlk *cache_base,*cache_ctrl,**cache_hash_table;
|
||||
@@ -2784,7 +2784,7 @@ public class CDirContext
|
||||
#define FF_CONTIGUOUS 16
|
||||
#define FF_USE_OLD_DATETIME 32
|
||||
|
||||
public class CFile //See $LK,"::/Demo/Dsk/DataBase.CPP"$.
|
||||
public class CFile //See $LK,"::/Demo/Dsk/DataBase.HC"$.
|
||||
{
|
||||
I64 flags;
|
||||
CDirEntry de;
|
||||
@@ -2894,7 +2894,7 @@ public class CBlkPool
|
||||
{
|
||||
I64 locked_flags,alloced_u8s,used_u8s;
|
||||
CMemBlk *mem_free_lst,
|
||||
*mem_free_2meg_lst, //This is for $LK,"::/Demo/Lectures/Mem/Mem2Meg.CPP"$
|
||||
*mem_free_2meg_lst, //This is for $LK,"::/Demo/Lectures/Mem/Mem2Meg.HC"$
|
||||
*free_page_hash[MEM_FREE_PAGE_HASH_SIZE],
|
||||
*free_page_hash2[64-MEM_PAGE_BITS];
|
||||
};
|
||||
@@ -3001,7 +3001,7 @@ public I64 class CBGR48
|
||||
#define KBD_CTRL 0x64
|
||||
public class CKbdStateGlbls
|
||||
{
|
||||
I64 scan_code, //See $LK,"scan codes",A="FI:::/Doc/CharOverview.TXT"$
|
||||
I64 scan_code, //See $LK,"scan codes",A="FI:::/Doc/CharOverview.DD"$
|
||||
last_down_scan_code,
|
||||
cnt, //Count of keys pressed since boot.
|
||||
timestamp, //Output: GetTSC when event.
|
||||
@@ -3221,11 +3221,11 @@ class CSrvCtrl
|
||||
};
|
||||
|
||||
#help_index "Messages"
|
||||
//See $LK,"::/Demo/MsgLoop.CPP"$
|
||||
//See $LK,"::/Demo/MsgLoop.HC"$
|
||||
#define MSG_NULL 0
|
||||
#define MSG_CMD 1
|
||||
#define MSG_KEY_DOWN 2 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.TXT"$) Press <CTRL-SHIFT-L>
|
||||
#define MSG_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.TXT"$) Press <CTRL-SHIFT-L>
|
||||
#define MSG_KEY_DOWN 2 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
|
||||
#define MSG_KEY_UP 3 //($LK,"ASCII",A="MN:CH_CTRLA"$,$LK,"scan code",A="FI:::/Doc/CharOverview.DD"$) Press <CTRL-SHIFT-L>
|
||||
#define MSG_IP_MOVE 4 //(x,y)
|
||||
#define MSG_IP_L_DOWN 5 //(x,y)
|
||||
#define MSG_IP_L_UP 6 //(x,y)
|
||||
@@ -3235,9 +3235,6 @@ class CSrvCtrl
|
||||
#define MSG_IP_R_UP 10 //(x,y)
|
||||
#define MSG_IP_R_D_DOWN 11 //(x,y)
|
||||
#define MSG_IP_R_D_UP 12 //(x,y)
|
||||
#define MSG_FOCUS 13 //(flag,0) TRUE gaining focus, FALSE losing.
|
||||
#define MSG_RESIZE 14 //(new columns,new rows).
|
||||
#define MSG_MOVE 15 //(new left,new top).
|
||||
|
||||
#define MSG_KEY_DOWN_UP -2 //Down & UP
|
||||
#define MSG_IP_L_DOWN_UP -5 //Down & Up
|
||||
@@ -3345,13 +3342,10 @@ U0 pad;#assert $$==offset(CTaskDying.wake_jiffy)
|
||||
I64 win_width,win_height,
|
||||
pix_left,pix_right,pix_width, //These are in pixs, not characters
|
||||
pix_top,pix_bottom,pix_height,
|
||||
border_pix_left,border_pix_right,
|
||||
border_pix_top,border_pix_bottom,
|
||||
|
||||
scroll_x,scroll_y,scroll_z;
|
||||
|
||||
//These must be in this order
|
||||
//for $LK,"TASK_CONTEXT_SAVE",A="FF:::/Kernel/Sched.CPP,TASK_CONTEXT_SAVE"$ and $LK,"_TASK_CONTEXT_RESTORE",A="FF:::/Kernel/Sched.CPP,_TASK_CONTEXT_RESTORE"$
|
||||
//for $LK,"TASK_CONTEXT_SAVE",A="FF:::/Kernel/Sched.HC,TASK_CONTEXT_SAVE"$ and $LK,"_TASK_CONTEXT_RESTORE",A="FF:::/Kernel/Sched.HC,_TASK_CONTEXT_RESTORE"$
|
||||
I64 rip,rflags,rsp,rsi,rax,rcx,rdx,rbx,rbp,rdi,
|
||||
r8,r9,r10,r11,r12,r13,r14,r15;
|
||||
CCPU *gs;
|
||||
@@ -3392,8 +3386,6 @@ U0 pad;#assert $$==offset(CTaskDying.wake_jiffy)
|
||||
CCmpCtrl *next_cc,*last_cc;
|
||||
CHashFun *last_fun;
|
||||
|
||||
I64 win_old_left,win_old_right,win_old_top,win_old_bottom;
|
||||
|
||||
U0 (*task_end_cb)();
|
||||
CTask *song_task,*animate_task;
|
||||
I64 rand_seed,
|
||||
@@ -3555,7 +3547,7 @@ public class CSysFixedArea
|
||||
|
||||
//TempleOS places a 1 in bit 7 for
|
||||
//keys with an E0 prefix.
|
||||
//See $LK,"::/Doc/CharOverview.TXT"$ and $LK,"KbdHandler",A="MN:KbdHandler"$().
|
||||
//See $LK,"::/Doc/CharOverview.DD"$ and $LK,"KbdHandler",A="MN:KbdHandler"$().
|
||||
#define SC_ESC 0x01
|
||||
#define SC_BACKSPACE 0x0E
|
||||
#define SC_TAB 0x0F
|
||||
@@ -3634,7 +3626,7 @@ public class CTextGlbls
|
||||
#define DCF_SYMMETRY 0x200
|
||||
|
||||
//Must be used with DCF_SYMMETRY set also.
|
||||
//See $LK,"::/Demo/Games/BigGuns.CPP"$
|
||||
//See $LK,"::/Demo/Games/BigGuns.HC"$
|
||||
#define DCF_JUST_MIRROR 0x400
|
||||
|
||||
#define DCF_LOCATE_NEAREST 0x800
|
||||
@@ -3678,7 +3670,7 @@ public class CDC
|
||||
//0x0000 =100% color.c0
|
||||
//0x8000 =50% color.c0 50% color.c1
|
||||
//0x10000=100% color.c1
|
||||
//See $LK,"::/Demo/Graphics/SunMoon.CPP"$ and $LK,"::/Demo/Graphics/Shading.CPP"$.
|
||||
//See $LK,"::/Demo/Graphics/SunMoon.HC"$ and $LK,"::/Demo/Graphics/Shading.HC"$.
|
||||
U64 dither_probability_u16;
|
||||
|
||||
CDC *brush;
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Kernel ASM symbols.
|
||||
$LK,"KernelB",A="FF:::/Kernel/Kernel.PRJ,KernelB"$ Kernel.PRJ
|
||||
$LK,"KernelB",A="FF:::/Compiler/Compiler.PRJ,KernelB"$ Compiler.PRJ
|
||||
$LK,"KernelB",A="FF:::/StartOS.CPP,KernelB"$ StartOS.CPP
|
||||
$LK,"KernelB",A="FF:::/StartOS.HC,KernelB"$ StartOS.HC
|
||||
*/
|
||||
|
||||
#help_index "Bit"
|
||||
@@ -237,7 +237,7 @@ public _intern IC_GS CCPU *Gs(); //GS points to current $LK,"CCPU",A="MN:CCPU"$.
|
||||
public _extern SYS_PCI_BUSES U16 sys_pci_busses; //Number of PCI buses.
|
||||
|
||||
#help_index "Processor"
|
||||
public _intern IC_CARRY I64 Carry(); //See $LK,"::/Demo/Carry.CPP"$
|
||||
public _intern IC_CARRY I64 Carry(); //See $LK,"::/Demo/Carry.HC"$
|
||||
public _intern IC_GET_RAX I64 GetRAX(); //Get RAX register value.
|
||||
public _intern IC_GET_RBP U8 *GetRBP(); //Get RBP register value.
|
||||
public _intern IC_GET_RFLAGS I64 GetRFlags(); //Get RFlags register value.
|
||||
@@ -218,10 +218,10 @@ public extern CHash *FunSegFind(U8 *addr,I64 *_offset);
|
||||
#help_index "Debugging/Raw Output"
|
||||
public extern Bool IsRaw();
|
||||
public extern Bool Raw(Bool val);
|
||||
public extern U0 RawD(I64 mS=100,U8 *addr,I64 cnt=0x80);
|
||||
public extern U0 RawDm(I64 mS=100,U8 *addr,I64 cnt=0x80);
|
||||
public extern U0 RawD(I64 ms=100,U8 *addr,I64 cnt=0x80);
|
||||
public extern U0 RawDm(I64 ms=100,U8 *addr,I64 cnt=0x80);
|
||||
extern U0 RawDr(CTask *task=NULL);
|
||||
public extern U0 RawPrint(I64 mS=100,U8 *fmt,...);
|
||||
public extern U0 RawPrint(I64 ms=100,U8 *fmt,...);
|
||||
public extern U0 RawPutChar(I64 ch);
|
||||
public extern U0 VGAFlush();
|
||||
|
||||
@@ -310,7 +310,6 @@ public extern U0 PutFileLink(U8 *filename,U8 *full_name=NULL,
|
||||
I64 line=0,Bool plain_text=FALSE);
|
||||
public extern U0 ToFileLine(U8 *_fl_file_line,U8 **_filename,I64 *_linenum);
|
||||
public extern U8 *ToggleZorNotZ(U8 *name);
|
||||
|
||||
#help_index "File/FileNames;Misc"
|
||||
public extern U8 *FileNameTempTxt();
|
||||
|
||||
@@ -348,7 +347,7 @@ public extern Bool DrvUnlock(CDrv *dv,Bool rst=FALSE);
|
||||
public extern U0 DrvsRelease();
|
||||
extern U0 FAT32FreeClusters(CDrv *dv,I64 c);
|
||||
public extern CBlkDev *Let2BlkDev(U8 drv_let=0,Bool except=TRUE);
|
||||
public extern I64 Let2BlkDevType(U8 drv_let=0);
|
||||
public extern I64 Let2BlkDevType(U8 drv_let);
|
||||
public extern CDrv *Let2Drv(U8 drv_let=0,Bool except=TRUE);
|
||||
extern I64 Name2DirCluster(CDrv *dv,U8 *dirname);
|
||||
extern I64 Name2ParentDirCluster(CDrv *dv,U8 *dirname);
|
||||
@@ -633,6 +632,8 @@ public extern CSndGlbls snd;
|
||||
#help_file "::/Doc/Streams"
|
||||
|
||||
#help_index "Task"
|
||||
public extern U0 BirthWait(CTask **_task,I64 task_num=-1);
|
||||
public extern U0 DeathWait(CTask **_task);
|
||||
public extern U0 Exit();
|
||||
public extern Bool IsSuspended(CTask *task=NULL);
|
||||
public extern Bool Kill(CTask *task,Bool wait=TRUE);
|
||||
@@ -657,14 +658,14 @@ public extern U0 PortNop(); //On the order of 1uS
|
||||
extern I64 TimeStampFreqCal();
|
||||
|
||||
#help_index "Task/Delay;Time/Jiffies"
|
||||
public extern U0 Sleep(I64 mS);
|
||||
public extern U0 Sleep(I64 ms);
|
||||
public extern U0 SleepUntil(I64 wake_jiffy);
|
||||
|
||||
#help_index "Task/Misc"
|
||||
extern U0 (*fp_update_ctrls)(CTask *task);
|
||||
public extern U0 TSSBusy(I64 tr,Bool val=OFF);
|
||||
public extern U0 TaskDerivedValsUpdate(CTask *task=NULL,Bool update_z_buf=TRUE);
|
||||
public extern U0 WinDerivedValsUpdate(CTask *task=NULL);
|
||||
public extern U0 WinDerivedValsUpdate(CTask *task);
|
||||
|
||||
#help_index "Task/Srv"
|
||||
#help_file "::/Doc/TaskSrv"
|
||||
@@ -728,6 +729,7 @@ extern U8 *MPrintTime(CDate cdt);
|
||||
public extern CDate Now();
|
||||
public extern CDate Struct2Date(CDateStruct *_ds);
|
||||
public extern CDate local_time_offset;
|
||||
|
||||
#help_index "Time/Date;Date"
|
||||
#help_file "::/Doc/Date"
|
||||
public extern I64 DayOfWeek(I64 i);
|
||||
@@ -752,6 +754,6 @@ public extern Bool Blink(F64 Hz=2.5);
|
||||
public extern F64 tS(); //From SysTimerFreq.
|
||||
|
||||
#help_index "Windows"
|
||||
public extern Bool WinInside(I64 x,I64 y,CTask *task=NULL,Bool border=FALSE);
|
||||
public extern Bool WinInside(I64 x,I64 y,CTask *task=NULL,I64 border=0);
|
||||
|
||||
#help_index ""
|
||||
@@ -19,7 +19,7 @@ U0 PutKey(I64 ch=0,I64 sc=0)
|
||||
|
||||
U0 PutChars(U64 ch)
|
||||
{//Output chars. Up to 8 chars in a single U64.
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
while (ch) {
|
||||
PutKey(ch&255,0);
|
||||
ch>>=8;
|
||||
@@ -28,7 +28,7 @@ U0 PutChars(U64 ch)
|
||||
|
||||
U0 PutS(U8 *st)
|
||||
{//Use $LK,"Print",A="MN:Print"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
I64 ch;
|
||||
U8 *ptr;
|
||||
Bool cont=TRUE;
|
||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,CTask *task=NULL,CBlkPool *bp)
|
||||
{//See $LK,"HeapLog",A="MN:HeapLog"$() for an example.
|
||||
//Duplicated for $LK,"Adam Task",A="FF:::/Kernel/KStart64.CPP,CHeapCtrl.bp"$.
|
||||
//Duplicated for $LK,"Adam Task",A="FF:::/Kernel/KStart64.HC,CHeapCtrl.bp"$.
|
||||
if (!hc)
|
||||
hc=ACAlloc(sizeof(CHeapCtrl));
|
||||
hc->hc_signature=HEAP_CTRL_SIGNATURE_VAL;
|
||||
@@ -1,6 +1,6 @@
|
||||
asm {
|
||||
//************************************
|
||||
//See $LK,"::/Doc/Credits.TXT"$.
|
||||
//See $LK,"::/Doc/Credits.DD"$.
|
||||
_MALLOC::
|
||||
// Throws 'OutMem'
|
||||
PUSH RBP
|
||||
@@ -221,7 +221,7 @@ MALLOC_FINAL_EXIT:
|
||||
RET1 16
|
||||
//************************************
|
||||
_FREE::
|
||||
//Be aware of $LK,"heap_hash",A="FF:::/Kernel/Mem/MAllocFree.CPP,heap_hash"$ in $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$().
|
||||
//Be aware of $LK,"heap_hash",A="FF:::/Kernel/Mem/MAllocFree.HC,heap_hash"$ in $LK,"Mem512TaskAlloc",A="MN:Mem512TaskAlloc"$().
|
||||
PUSH RBP
|
||||
MOV RBP,RSP
|
||||
PUSH RSI
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
asm {
|
||||
// $LK,"::/Doc/MemOverview.TXT"$
|
||||
// $LK,"::/Doc/MemOverview.DD"$
|
||||
|
||||
USE32
|
||||
SYS_INIT_PAGE_TABLES::
|
||||
@@ -1,10 +1,10 @@
|
||||
asm {
|
||||
ALIGN 16,OC_NOP
|
||||
USE16
|
||||
//See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.TXT"$.
|
||||
//See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.DD"$.
|
||||
|
||||
//This code gets copied to $LK,"MP_VECT_ADDR",A="MN:MP_VECT_ADDR"$.
|
||||
//See $LK,"MemCpy(MP_VECT_ADDR",A="FF:::/Kernel/MultiProc.CPP,MemCpy(mp:2"$.
|
||||
//See $LK,"MemCpy(MP_VECT_ADDR",A="FF:::/Kernel/MultiProc.HC,MemCpy(mp:2"$.
|
||||
COREAP_16BIT_INIT::
|
||||
JMP @@05
|
||||
|
||||
@@ -16,7 +16,7 @@ AP_GDT_PTR: DU16 sizeof(CGDT)-1;
|
||||
WBINVD
|
||||
MOV AX,MP_VECT_ADDR/16
|
||||
MOV DS,AX
|
||||
LGDT U32 [CAP16BitInit.ap_gdt_ptr] //See $LK,"mp->ap_gdt_ptr",A="FF:::/Kernel/MultiProc.CPP,mp->ap_gdt_ptr:2"$
|
||||
LGDT U32 [CAP16BitInit.ap_gdt_ptr] //See $LK,"mp->ap_gdt_ptr",A="FF:::/Kernel/MultiProc.HC,mp->ap_gdt_ptr:2"$
|
||||
|
||||
MOV EAX,SYS_START_CR0
|
||||
MOV_CR0_EAX
|
||||
@@ -69,7 +69,7 @@ USE64
|
||||
}
|
||||
|
||||
U0 TSSBusy(I64 tr,Bool val=OFF)
|
||||
{//See $LK,"::/Demo/Lectures/Ring3.CPP"$.
|
||||
{//See $LK,"::/Demo/Lectures/Ring3.HC"$.
|
||||
LBEqu((&sys_gdt)(U8 *)+tr+4,9,val);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ CCPU *CPUStructInit(I64 num,CCPU *c,CTask *seth_task)
|
||||
LBts(&c->idle_task->task_flags,TASKf_IDLE);
|
||||
c->tss=TSSNew(num);
|
||||
}
|
||||
c->seth_task=seth_task;// It waits for this to be filled-in: $LK,"seth_task",A="FF:::/Kernel/MultiProc.CPP,seth_task"$
|
||||
c->seth_task=seth_task;// It waits for this to be filled-in: $LK,"seth_task",A="FF:::/Kernel/MultiProc.HC,seth_task"$
|
||||
return c;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ CSrvCmd *JobQue(I64 (*fp_addr)(U8 *data),U8 *data=NULL,
|
||||
I64 cmd_code=SVCT_CALL,U8 *aux_str=NULL,I64 aux1=0,I64 aux2=0)
|
||||
{//Queue multicore jobs, handled by Seth tasks.
|
||||
//Set flags to zero if you wish to get the res.
|
||||
//See $LK,"::/Demo/MultiCore/Lock.CPP"$
|
||||
//See $LK,"::/Demo/MultiCore/Lock.HC"$
|
||||
CSrvCtrl *ctrl;
|
||||
CSrvCmd *tempc;
|
||||
CTask *seth;
|
||||
@@ -282,7 +282,7 @@ U0 CoreAPSethInit()
|
||||
}
|
||||
|
||||
U0 Core0StartMP()
|
||||
{//Called by adam during $LK,"start-up",A="FF:::/Kernel/KEnd.CPP,Core0StartMP"$.
|
||||
{//Called by adam during $LK,"start-up",A="FF:::/Kernel/KEnd.HC,Core0StartMP"$.
|
||||
CTask *task;
|
||||
U8 buf[STR_LEN];
|
||||
CAP16BitInit *mp=MP_VECT_ADDR;
|
||||
File renamed without changes.
@@ -5,7 +5,7 @@ fp_compare() passes by value instead of ref.
|
||||
For ascending strings: return StrCmp(e1,e2);
|
||||
For ascending ints : return e1-e2;
|
||||
|
||||
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.CPP"$.
|
||||
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.HC"$.
|
||||
*/
|
||||
I64 i,*left,*right,pivot;
|
||||
if (num>1) {
|
||||
@@ -89,7 +89,7 @@ For ascending strings: return StrCmp(*e1,*e2);
|
||||
For ascending ints : return *e1-*e2;
|
||||
Don't return e1-e2 if numbers can overflow, return -1,0 or 1.
|
||||
|
||||
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.CPP"$.
|
||||
Maybe, look at $LK,"::/Demo/MultiCore/RadixSort.HC"$.
|
||||
*/
|
||||
U8 *temp;
|
||||
if (width && num>1) {
|
||||
File renamed without changes.
@@ -1,5 +1,5 @@
|
||||
U0 GridInit()
|
||||
{//Init input pointer grid struct. See $LK,"::/Demo/Graphics/Grid.CPP"$.
|
||||
{//Init input pointer grid struct. See $LK,"::/Demo/Graphics/Grid.HC"$.
|
||||
ip_grid.x=ip_grid.y=ip_grid.z=8;
|
||||
ip_grid.x_offset=ip_grid.y_offset=ip_grid.z_offset=0;
|
||||
ip_grid.x_speed =ip_grid.y_speed =ip_grid.z_speed =1;
|
||||
@@ -41,7 +41,7 @@ U0 IPVarsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
}
|
||||
|
||||
U0 IPSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64)
|
||||
{//Note: Generates a message. See $LK,"IPSet",A="FF:::/Demo/Games/Zing.CPP,IPSet"$().
|
||||
{//Note: Generates a message. See $LK,"IPSet",A="FF:::/Demo/Games/Zing.HC,IPSet"$().
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
x=ip.pos.x;
|
||||
if (!(0<=y<GR_HEIGHT))
|
||||
File renamed without changes.
File renamed without changes.
@@ -95,7 +95,7 @@ I64 FlushMsgs(CTask *task=NULL)
|
||||
I64 GetMsg(I64 *_a1=NULL,I64 *_a2=NULL,I64 mask=~1,CTask *task=NULL)
|
||||
{//Wait for a message of type specified by a one in the mask.
|
||||
//Throw-out all messages not in mask.
|
||||
//Returns $LK,"msg_code",A="MN:MSG_CMD"$. See $LK,"::/Demo/MsgLoop.CPP"$.
|
||||
//Returns $LK,"msg_code",A="MN:MSG_CMD"$. See $LK,"::/Demo/MsgLoop.HC"$.
|
||||
I64 res;
|
||||
if (!task) task=Fs;
|
||||
LBtr(&task->task_flags,TASKf_IDLE);
|
||||
@@ -122,7 +122,7 @@ I64 ScanChar()
|
||||
|
||||
Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE)
|
||||
{//Checks for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ and returns FALSE immediately if no key.
|
||||
//Sets $LK,"ASCII",A="MN:CH_CTRLA"$ and $LK,"scan_code",A="FI:::/Doc/CharOverview.TXT"$.
|
||||
//Sets $LK,"ASCII",A="MN:CH_CTRLA"$ and $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
|
||||
//Removes key message and returns TRUE.
|
||||
//$LK,"ScanMsg",A="MN:ScanMsg"$() throws away other message types.
|
||||
I64 ch=0,sc=0;
|
||||
@@ -141,7 +141,7 @@ Bool ScanKey(I64 *_ch=NULL,I64 *_scan_code=NULL,Bool echo=FALSE)
|
||||
|
||||
I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
|
||||
{//Waits for $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$ message and returns $LK,"ASCII",A="MN:CH_CTRLA"$.
|
||||
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.TXT"$.
|
||||
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
|
||||
//$LK,"ScanKey",A="MN:ScanKey"$() throws away other message types.
|
||||
I64 ch,sc;
|
||||
Bool cursor_on=FALSE;
|
||||
@@ -181,7 +181,7 @@ I64 GetKey(I64 *_scan_code=NULL,Bool echo=FALSE,Bool raw_cursor=FALSE)
|
||||
|
||||
I64 GetChar(I64 *_scan_code=NULL,Bool echo=TRUE,Bool raw_cursor=FALSE)
|
||||
{//Waits for non-zero $LK,"ASCII",A="MN:CH_CTRLA"$ key.
|
||||
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.TXT"$.
|
||||
//Sets $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$.
|
||||
I64 ch1;
|
||||
do ch1=GetKey(_scan_code,FALSE,raw_cursor);
|
||||
while (!ch1);
|
||||
File renamed without changes.
@@ -196,7 +196,7 @@ Bool JobResScan(CSrvCmd *rqst=NULL,I64 *_res=NULL)
|
||||
}
|
||||
|
||||
I64 JobResGet(CSrvCmd *rqst=NULL)
|
||||
{//See $LK,"::/Demo/MultiCore/Lock.CPP"$
|
||||
{//See $LK,"::/Demo/MultiCore/Lock.HC"$
|
||||
I64 res;
|
||||
CSrvCmd *tempc1;
|
||||
if (!rqst) {
|
||||
@@ -444,7 +444,7 @@ U0 AdamErr(U8 *fmt,...)
|
||||
}
|
||||
|
||||
U0 XTalk(CTask *task,U8 *fmt,...)
|
||||
{//Sends text to other task. See $LK,"::/Misc/OSTestSuite.CPP"$.
|
||||
{//Sends text to other task. See $LK,"::/Misc/OSTestSuite.HC"$.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=AStrNew(buf),
|
||||
*st2=MStrPrint("\"%%s\",%d;Free(%d);",st,st);
|
||||
TaskText(task,NULL,st2,0);
|
||||
@@ -481,7 +481,7 @@ U0 AutoFile(U8 *filename)
|
||||
}
|
||||
|
||||
U0 Auto(U8 *fmt,...)
|
||||
{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOSDistro.CPP"$.
|
||||
{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOSDistro.HC"$.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=AStrNew(buf);
|
||||
AutoStr("\"%%s\",%d;Free(%d);",st,st);
|
||||
Free(buf);
|
||||
File renamed without changes.
@@ -117,14 +117,14 @@ U0 Help()
|
||||
if (IsDbg)
|
||||
DbgHelp;
|
||||
else
|
||||
PopUp("Type(\"::/Doc/HelpIndex.TXT\");DocTop;View;");
|
||||
PopUp("Type(\"::/Doc/HelpIndex.DD\");DocTop;View;");
|
||||
}
|
||||
|
||||
U0 ScanFlags(U8 *_dst_flags,U8 *lst,U8 *src)
|
||||
{/*More than 64 flags. Flags passed by ref.
|
||||
|
||||
Examples:
|
||||
$LK,"ScanFlags",A="FF:::/Adam/Opt/Utils/Diff.CPP,ScanFlags:2"$(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
$LK,"ScanFlags",A="FF:::/Adam/Opt/Utils/Diff.HC,ScanFlags:2"$(&fuf_flags,Define("ST_FILE_UTIL_FLAGS"),fu_flags);
|
||||
|
||||
I64 flags=0;
|
||||
ScanFlags(&flags,"R\0L\0Dump\0Scan\0","+Dump-R"); //Sets Bit#2, Clears Bit#0.
|
||||
@@ -206,7 +206,7 @@ U8 *sys_pos_pows_lets=" KMGTPEZY",
|
||||
#define SLOP 8
|
||||
|
||||
U8 *StrPrintJoin(U8 *dst,U8 *fmt,I64 argc,I64 *argv)
|
||||
{/*$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$
|
||||
{/*$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$
|
||||
In float formatting, do not exceed 18-digits
|
||||
before or after the decimal point
|
||||
because the numbers before and after
|
||||
@@ -888,10 +888,10 @@ U8 *CatPrint(U8 *_dst,U8 *fmt,...)
|
||||
}
|
||||
|
||||
U0 Print(U8 *fmt,...)
|
||||
{//$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.TXT"$. See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$
|
||||
{//$LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$. See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
|
||||
//Don't use this. $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv);
|
||||
PutS(buf);//Don't use PutS(). $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.TXT,DemoHolyC"$
|
||||
PutS(buf);//Don't use PutS(). $LK,"See Print() shortcut.",A="FF:::/Doc/HolyC.DD,DemoHolyC"$
|
||||
Free(buf);
|
||||
}
|
||||
|
||||
File renamed without changes.
Reference in new issue
Block a user