mirror of https://github.com/minexew/Shrine.git
531 changed files with 23314 additions and 22044 deletions
Binary file not shown.
@ -1,10 +0,0 @@
|
||||
//Change anything you want in this
|
||||
//acct file or others.
|
||||
|
||||
#include "HOME/Adam3aLocalize" |
||||
#include "HOME/Adam3bPkgs" |
||||
#include "HOME/Adam3cKeyPlugIns" |
||||
#include "HOME/Adam3dWrappers" |
||||
#include "HOME/Adam3eSys" |
||||
|
||||
#help_index "" |
@ -1,26 +0,0 @@
|
||||
//Change anything you want in this
|
||||
//acct file or others.
|
||||
|
||||
#help_index "Cmd Line (Typically)" |
||||
|
||||
//These are customized quick commands.
|
||||
//Feel free to add more or change.
|
||||
public I64 F(U8 *needle_str,U8 *fu_flags=NULL) |
||||
{//Find (Grep) all text files.
|
||||
return Grep(needle_str,"/*",fu_flags); |
||||
} |
||||
|
||||
public I64 R(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") |
||||
{//Find (Grep) and replace string with string in all files.
|
||||
return Grep(needle_str,"/*",fu_flags,replace_text); |
||||
} |
||||
|
||||
public I64 FD(U8 *needle_str,U8 *fu_flags=NULL) |
||||
{//Find (Grep) text files in cur dir.
|
||||
return Grep(needle_str,"*",fu_flags); |
||||
} |
||||
|
||||
public I64 RD(U8 *needle_str,U8 *replace_text=NULL,U8 *fu_flags="+l-i") |
||||
{//Find (Grep) and replace string with string in cur dir.
|
||||
return Grep(needle_str,"*",fu_flags,replace_text); |
||||
} |
@ -1,41 +0,0 @@
|
||||
//Change anything you want in this
|
||||
//acct file or others.
|
||||
|
||||
U0 UserStartUp() |
||||
{//Run each time a user a spawned
|
||||
DocTermNew; |
||||
Type("::/Doc/Start.TXT"); |
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW); |
||||
WinToTop; |
||||
WinZBufUpdate; |
||||
Preempt(ON); |
||||
Dir; |
||||
} |
||||
|
||||
U0 SrvStartUp() |
||||
{//Run each time a srv task is spawned.
|
||||
DocTermNew; |
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW); |
||||
WinToTop; |
||||
WinZBufUpdate; |
||||
Preempt(ON); |
||||
} |
||||
|
||||
U0 StartUpTasks() |
||||
{ |
||||
CTask *user1,*user2; |
||||
user1=SpawnUser; |
||||
user2=SpawnUser; |
||||
WinToTop(user1); |
||||
WinTileVert; |
||||
PopUp("#include \"::/Adam/Start\";"); |
||||
"Boot Time:%7.3fs\n",tS; |
||||
XTalk(user1,"Cd(\"HOME\");#include \"DoOnce\";\n"); |
||||
Silent(ON); //no output to screen
|
||||
WSInit("/*;~*Bible.TXT*"); |
||||
Silent(OFF); //no output to screen
|
||||
} |
||||
|
||||
StartUpTasks; |
||||
|
||||
"\nOS Compile Time:%D %T\n",sys_compile_time,sys_compile_time; |
@ -1,16 +0,0 @@
|
||||
//This file is executed by the
|
||||
//first terminal window upon start-up.
|
||||
//See $LK,"DoOnce",A="FF:HOME/Adam3eSys.CPP,DoOnce"$ and $LK,"Acct Files",A="FF:::/Doc/GuideLines.TXT,ACCT FILES"$.
|
||||
|
||||
//It goes in your HOME directory and
|
||||
//you can customize it.
|
||||
|
||||
//Delete this to get rid of
|
||||
//default start-up msg.
|
||||
Type("::/Doc/Customize.TXT"); |
||||
|
||||
"\nTake Tour"; |
||||
if (YorN) { |
||||
Cd("::/Misc/Tour"); |
||||
AutoFile("Tour"); |
||||
} |
Binary file not shown.
@ -0,0 +1,105 @@
|
||||
//This is executed by the Adam task at boot.
|
||||
//See $LK,"Adam Start-up",A="FF:::/Kernel/KEnd.CPP,\"Adam:2"$.
|
||||
|
||||
//You do not place this file in /Home. (It would be ignored.)
|
||||
//but look at the bottom of this file to see
|
||||
//files you do customize.
|
||||
|
||||
extern I8i OptEqu(I64i num,I8i val); |
||||
OptEqu(0,0); //(0,0)=EchoOff (0,1)=EchoOn
|
||||
#include "/Kernel/KernelA.HPP" |
||||
#include "/Compiler/CompilerA.HPP" |
||||
#include "/Kernel/KernelB.HPP" |
||||
#include "/Kernel/KernelC.HPP" |
||||
#include "/Compiler/CompilerB.HPP" |
||||
|
||||
Cd("/Adam");; |
||||
#exe {OptOn(OPTf_WARN_PAREN);}; |
||||
#exe {OptOn(OPTf_WARN_DUP_TYPES);}; |
||||
|
||||
HashTablePurge(adam_task->hash_table); |
||||
|
||||
#help_index "Misc" |
||||
|
||||
//Use Dbg("Type 'G;'"); to debug before window mgr is running.
|
||||
|
||||
public F64 os_version=3.03;//Operating system version.
|
||||
|
||||
#include "AExts.HPP" |
||||
#include "AMath" |
||||
#include "Training" |
||||
#include "AUtils" |
||||
#include "AMathODE" |
||||
Cd("::/Adam/Gr");; |
||||
#include "Gr" |
||||
|
||||
Cd("::/Adam/Snd");; |
||||
#include "Snd" |
||||
|
||||
Cd("::/Adam/Dsk");; |
||||
#include "ADsk" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "Menu" |
||||
#include "WinA" |
||||
#include "WinB" |
||||
#include "ADbg" |
||||
|
||||
#include "::/Adam/God/GodExt" |
||||
|
||||
Cd("::/Adam/DolDoc");; |
||||
#include "Doc" |
||||
LBts(&sys_run_level,RLf_DOC); |
||||
|
||||
Cd("::/Adam/Ctrls");; |
||||
#include "Ctrls" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "AutoFile" |
||||
#include "Acct" |
||||
|
||||
Cd("::/Adam/AutoComplete");; |
||||
#include "AutoComplete" |
||||
|
||||
Cd("::/Adam/God");; |
||||
#include "God" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "AHash" |
||||
#include "TaskSettings" |
||||
#include "DevInfo" |
||||
#include "ADefine" |
||||
|
||||
//Dbg("Type 'G;'");
|
||||
DocTermNew; |
||||
WinVert(2,10); |
||||
|
||||
sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr"); |
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS; |
||||
LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP); |
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW); |
||||
RegistryInit; |
||||
LBts(&sys_run_level,RLf_REGISTRY); |
||||
|
||||
Cd("::/Adam");; |
||||
#include "WallPaper" |
||||
|
||||
if (IsDrvWritable) |
||||
MkDir("/Temp"); //Good to have a Temp
|
||||
|
||||
#exe {OptOff(OPTf_WARN_PAREN);}; |
||||
#exe {OptOff(OPTf_WARN_DUP_TYPES);}; |
||||
LBts(&sys_run_level,RLf_HOME); |
||||
|
||||
#help_index "" |
||||
Cd("::/Home");; |
||||
|
||||
//If these are not present in /Home, it uses the version in the root dir.
|
||||
//You should make your own version of these files in you /Home directory.
|
||||
#include "::/Home/AdamLocalize" |
||||
#include "::/Home/AdamPkgs" |
||||
#include "::/Home/AdamKeyPlugIns" |
||||
#include "::/Home/AdamWrappers" |
||||
#include "::/Home/AdamSys" |
||||
|
||||
//After this file, the Adam task enters $LK,"server mode",A="HI:Task/Srv"$.
|
@ -0,0 +1,51 @@
|
||||
#help_index "Define;Char/Define" |
||||
|
||||
U0 LoadDocDefines() |
||||
{ |
||||
CBinFile *bfh=sys_boot_base-sizeof(CBinFile); |
||||
|
||||
DefinePrint( |
||||
"DD_OS_NAME_VERSION","TempleOS V%0.2f",os_version); |
||||
DefinePrint( |
||||
"DD_TEMPLEOS_AGE","%0.1f",(Now-Str2Date("8/1/2003"))/ToF64(1<<32)/CDATE_YEAR_DAYS); |
||||
|
||||
//This is cut and replaced when I generate a distro.
|
||||
//See $LK,"DD_TEMPLEOS_LOC",A="FF:::/Demo/AcctExample/TOSDistro.CPP,DD_TEMPLEOS_LOC"$.
|
||||
$TR-C,"LineRep"$ |
||||
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","120,789"); |
||||
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","79,959"); |
||||
$ID,-4$ |
||||
DefinePrint( |
||||
"DD_KERNEL","%08X",bfh); |
||||
bfh(I64)+=bfh->file_size-1; |
||||
DefinePrint( |
||||
"DD_KERNEL_END","%08X",bfh); |
||||
DefinePrint( |
||||
"DD_PROTECTED_LOW","%08X",MEM_PROTECTED_LOW_LIMIT); |
||||
|
||||
//$LK,"DD_BOOT_HIGH_LOC_CD",A="FF:::/Adam/Boot/BootCD.CPP,DD_BOOT_HIGH_LOC_CD"$
|
||||
|
||||
DefinePrint( |
||||
"DD_MP_VECT","%08X",MP_VECT_ADDR); |
||||
DefinePrint( |
||||
"DD_MP_VECT_END","%08X",MP_VECT_ADDR+AP_16BIT_INIT_END-AP_16BIT_INIT-1); |
||||
|
||||
DefinePrint( |
||||
"DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA); |
||||
DefinePrint( |
||||
"DD_SYS_FIXED_AREA_END","%08X",SYS_FIXED_AREA+sizeof(CSysFixedArea)-1); |
||||
DefinePrint( |
||||
"DD_SYS_HEAP_BASE","%08X",sys_heap_base); |
||||
DefinePrint( |
||||
"DD_SYS_HEAP_LIMIT","%08X",sys_heap_limit); |
||||
DefinePrint( |
||||
"DD_MEM_MIN_MEG","%d Meg",MEM_MIN_MEG); |
||||
DefinePrint( |
||||
"DD_MEM_MAPPED_SPACE_GIG","%d Gig",MEM_MAPPED_SPACE/0x40000000); |
||||
DefinePrint( |
||||
"DD_MEM_MAPPED_SPACE_END","%010X",MEM_MAPPED_SPACE-1); |
||||
DefinePrint( |
||||
"DD_JIFFY_HZ","%d Hz",JIFFY_FREQ); |
||||
} |
||||
|
||||
LoadDocDefines; |
@ -0,0 +1,211 @@
|
||||
#help_index "Memory/Task" |
||||
public I64 TaskMemAlloced(CTask *task=NULL,Bool override_validate=FALSE) |
||||
{//Count of bytes alloced to a task, used+unused.
|
||||
I64 result; |
||||
if (!task) task=Fs; |
||||
if (override_validate || TaskValidate(task)) { |
||||
result=task->code_heap->alloced_u8s; |
||||
if (task->code_heap!=task->data_heap) |
||||
result+=task->data_heap->alloced_u8s; |
||||
return result; |
||||
} else |
||||
return 0; |
||||
} |
||||
|
||||
public I64 TaskMemUsed(CTask *task=NULL,Bool override_validate=FALSE) |
||||
{//Count of bytes alloced to a task and in use.
|
||||
I64 result; |
||||
if (!task) task=Fs; |
||||
if (override_validate || TaskValidate(task)) { |
||||
result=task->code_heap->used_u8s; |
||||
if (task->data_heap!=task->code_heap) |
||||
result+=task->data_heap->used_u8s; |
||||
return result; |
||||
} else |
||||
return 0; |
||||
} |
||||
|
||||
public Bool HeapRep(CTask *task) |
||||
{//Report status of task's heap.
|
||||
I64 i,cnt; |
||||
CMemUnused *uum; |
||||
|
||||
if (!task || task==Fs) { |
||||
"Task can't HeapRep on self.\n"; |
||||
return FALSE; |
||||
} |
||||
if (!TaskValidate(task)) return FALSE; |
||||
|
||||
PUSHFD |
||||
CLI |
||||
while (LBts(&task->code_heap->locked_flags,HClf_LOCKED)) |
||||
PAUSE |
||||
if (task->data_heap!=task->code_heap) |
||||
while (LBts(&task->data_heap->locked_flags,HClf_LOCKED)) |
||||
PAUSE |
||||
|
||||
for (i=0;i<HEAP_HASH_SIZE>>3;i++) { |
||||
cnt=0; |
||||
uum=task->code_heap->heap_hash[i]; |
||||
while (uum) { |
||||
cnt+=uum->size; |
||||
uum=uum->next; |
||||
} |
||||
if (task->data_heap!=task->code_heap) { |
||||
uum=task->data_heap->heap_hash[i]; |
||||
while (uum) { |
||||
cnt+=uum->size; |
||||
uum=uum->next; |
||||
} |
||||
} |
||||
if (cnt) |
||||
"%03X:%08X\n",i<<3,cnt; |
||||
} |
||||
'\n'; |
||||
|
||||
uum=task->code_heap->malloc_free_lst; |
||||
while (uum) { |
||||
"%X, ",uum->size; |
||||
uum=uum->next; |
||||
} |
||||
if (task->data_heap!=task->code_heap) { |
||||
uum=task->data_heap->malloc_free_lst; |
||||
while (uum) { |
||||
"%X, ",uum->size; |
||||
uum=uum->next; |
||||
} |
||||
} |
||||
|
||||
if (task->data_heap!=task->code_heap) |
||||
LBtr(&task->data_heap->locked_flags,HClf_LOCKED); |
||||
LBtr(&task->code_heap->locked_flags,HClf_LOCKED); |
||||
POPFD |
||||
|
||||
'\n'; |
||||
} |
||||
|
||||
#help_index "Memory/HeapCtrl;Debugging/Heap" |
||||
public Bool IsInHeapCtrl(U8 *a,CHeapCtrl *hc,Bool lock=TRUE) |
||||
{//Check addr if on heap.
|
||||
CMemBlk *m; |
||||
PUSHFD |
||||
CLI |
||||
if (lock) |
||||
while (LBts(&hc->locked_flags,HClf_LOCKED)) |
||||
PAUSE |
||||
m=hc->next_mem_blk; |
||||
while (m!=&hc->next_mem_blk) { |
||||
if (a>=m && a<m(U8 *)+m->pages*PAGE_SIZE) { |
||||
if (lock) |
||||
LBtr(&hc->locked_flags,HClf_LOCKED); |
||||
POPFD |
||||
return TRUE; |
||||
} |
||||
m=m->next; |
||||
} |
||||
if (lock) |
||||
LBtr(&hc->locked_flags,HClf_LOCKED); |
||||
POPFD |
||||
return FALSE; |
||||
} |
||||
|
||||
public Bool HeapCtrlWalk(CHeapCtrl *hc) |
||||
{//Check integrity of HeapCtrl.
|
||||
I64 i; |
||||
CMemUnused *uum; |
||||
|
||||
PUSHFD |
||||
CLI |
||||
while (LBts(&hc->locked_flags,HClf_LOCKED)) |
||||
PAUSE |
||||
|
||||
for (i=0;i<HEAP_HASH_SIZE>>3;i++) { |
||||
uum=hc->heap_hash[i]; |
||||
while (uum) { |
||||
if (!IsInHeapCtrl(uum,hc,FALSE)) |
||||
goto hc_false; |
||||
uum=uum->next; |
||||
} |
||||
} |
||||
uum=hc->malloc_free_lst; |
||||
while (uum) { |
||||
if (!IsInHeapCtrl(uum,hc,FALSE)) |
||||
goto hc_false; |
||||
uum=uum->next; |
||||
} |
||||
|
||||
#if _CFG_HEAP_DBG |
||||
CMemUsed *um,*um1; |
||||
um1=(&hc->next_um)(U8 *)-offset(CMemUsed.next); |
||||
um=um1->next; |
||||
while (um!=um1) { |
||||
if (!IsInHeapCtrl(um,hc,FALSE)) |
||||
goto hc_false; |
||||
um=um->next; |
||||
} |
||||
#endif |
||||
|
||||
LBtr(&hc->locked_flags,HClf_LOCKED); |
||||
POPFD |
||||
return TRUE; |
||||
|
||||
hc_false: |
||||
LBtr(&hc->locked_flags,HClf_LOCKED); |
||||
POPFD |
||||
return FALSE; |
||||
} |
||||
|
||||
#help_index "Memory/Task;Debugging/Heap" |
||||
public Bool IsInHeap(U8 *a,CTask *task=NULL,Bool lock=TRUE) |
||||
{//Check addr if on heap.
|
||||
if (!task) task=Fs; |
||||
if (TaskValidate(task) && (IsInHeapCtrl(a,task->code_heap,lock)|| |
||||
task->data_heap!=task->code_heap && IsInHeapCtrl(a,task->data_heap,lock))) |
||||
return TRUE; |
||||
else |
||||
return FALSE; |
||||
} |
||||
|
||||
public Bool HeapWalk(CTask *task=NULL) |
||||
{//Check integrity of task's heaps.
|
||||
if (!task) task=Fs; |
||||
if (!TaskValidate(task) || !HeapCtrlWalk(task->code_heap) || |
||||
task->data_heap!=task->code_heap && !HeapCtrlWalk(task->data_heap)) |
||||
return FALSE; |
||||
else |
||||
return TRUE; |
||||
} |
||||
|
||||
#help_index "Info;Task" |
||||
U0 TaskRepTask(CTask *task,I64 indent) |
||||
{ |
||||
CTask *task1; |
||||
U8 *st,*desc=MStrUtil(task->task_title,SUF_SAFE_DOLLAR); |
||||
st=MStrPrint("$$MA,T=\"%08X\",LM=\"Kill(0x%X);\n\",$$",task,task,task); |
||||
"%h*c%s $$TX,\"%Q...\",SCX=16$$ Mem:%08X\n",indent,CH_SPACE, |
||||
st,desc,TaskMemAlloced(task); |
||||
"%h*cFlags:%04X:%04X Time:%0.2fm\n",indent+2,CH_SPACE, |
||||
task->task_flags,task->display_flags, |
||||
task->total_time/60.0/cnts.time_stamp_freq_initial; |
||||
Free(st); |
||||
Free(desc); |
||||
task1=task->next_child_task; |
||||
while (task1!=(&task->next_child_task)(U8 *)-offset(CTask.next_sibling_task)) { |
||||
TaskRepTask(task1,indent+2); |
||||
task1=task1->next_sibling_task; |
||||
} |
||||
} |
||||
|
||||
public U0 TaskRep() |
||||
{//Report current tasks on all cores.
|
||||
I64 i; |
||||
CCPU *c; |
||||
PUSHFD |
||||
CLI |
||||
for (i=0;i<mp_cnt;i++) { |
||||
c=&cpu_structs[i]; |
||||
"$$RED$$CPU:%d$$FG$$\n",i; |
||||
TaskRepTask(c->seth_task,2); |
||||
} |
||||
POPFD |
||||
} |
@ -1,80 +0,0 @@
|
||||
#exe {OptOn(OPTf_WARN_PAREN);}; |
||||
#exe {OptOn(OPTf_WARN_DUP_TYPES);}; |
||||
|
||||
HashTablePurge(adam_task->hash_table); |
||||
|
||||
#help_index "Misc" |
||||
|
||||
//Use Dbg("Type 'G;'"); to debug before window mgr is running.
|
||||
|
||||
public F64 os_version=2.11;//Operating system version.
|
||||
//Fix here, too: $LK,"::/Demo/AcctExample/DbgAdam2.CPP"$
|
||||
|
||||
#include "AdamExts.HPP" |
||||
#include "Math2a" |
||||
#include "Training" |
||||
#include "Utils2a" |
||||
#include "MathODE" |
||||
Cd("::/Adam/Gr");; |
||||
#include "Gr" |
||||
|
||||
Cd("::/Adam/Snd");; |
||||
#include "Snd" |
||||
|
||||
Cd("::/Adam/Dsk");; |
||||
#include "Dsk2" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "Menu" |
||||
#include "Win2a" |
||||
#include "Win2b" |
||||
#include "Dbg2a" |
||||
|
||||
#include "::/Adam/God/GodExt" |
||||
|
||||
Cd("::/Adam/DolDoc");; |
||||
#include "Doc" |
||||
LBts(&sys_run_level,RLf_DOC); |
||||
|
||||
Cd("::/Adam/Ctrls");; |
||||
#include "Ctrls" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "AutoFile2a" |
||||
#include "LogIn" |
||||
|
||||
Cd("::/Adam/WordStat");; |
||||
#include "WordStat" |
||||
|
||||
Cd("::/Adam/God");; |
||||
#include "God" |
||||
|
||||
Cd("::/Adam");; |
||||
#include "Hash2a" |
||||
#include "TaskSettings" |
||||
#include "DevInfo" |
||||
#include "DocDefines" |
||||
|
||||
//Dbg("Type 'G;'");
|
||||
|
||||
DocTermNew; |
||||
SetWinVert(2,10); |
||||
|
||||
sys_winmgr_task=Spawn(&WinMgrTask,NULL,"Window Mgr"); |
||||
Fs->win_inhibit=WIG_TASK_DFT-WIF_SELF_BORDER-WIF_SELF_GRAB_SCROLL-WIF_SELF_CTRLS; |
||||
LBts(&Fs->display_flags,DISPLAYf_CHILDREN_NOT_ON_TOP); |
||||
LBts(&Fs->display_flags,DISPLAYf_SHOW); |
||||
SysLogin; |
||||
LBts(&sys_run_level,RLf_LOGIN); |
||||
RegistryInit; |
||||
LBts(&sys_run_level,RLf_REGISTRY); |
||||
|
||||
Cd("::/Adam");; |
||||
#include "WallPaper" |
||||
#exe {OptOff(OPTf_WARN_PAREN);}; |
||||
#exe {OptOff(OPTf_WARN_DUP_TYPES);}; |
||||
LBts(&sys_run_level,RLf_ADAM2); |
||||
|
||||
#help_index "" |
||||
Cd("HOME");; |
||||
#include "Adam3" |