Browse Source

TempleOSCDV3.12.ISO

v6
Terry A. Davis 7 years ago committed by minexew
parent
commit
046e83368d
  1. BIN
      0000Boot/0000Kernel.BIN.C
  2. 6
      Adam/ADefine.CPP
  3. 8
      Adam/Ctrls/CtrlsA.CPP
  4. 69
      Adam/God/GodBible.CPP
  5. 4
      Adam/God/HSNotes.TXT
  6. 2
      Adam/Gr/GrTextBase.CPP
  7. BIN
      Adam/WallPaper.CPP
  8. 82
      Apps/TimeOut/TimeOut.CPP
  9. BIN
      Compiler/Compiler.BIN
  10. 219
      Compiler/Compiler.MAP
  11. 10
      Compiler/Lex.CPP
  12. 2
      Demo/AcctExample/HomeLocalize.CPP
  13. BIN
      Demo/AcctExample/PersonalMenu.TXT
  14. 19
      Demo/AcctExample/PersonalNotes.TXT
  15. 34
      Demo/AcctExample/Registry.CPP
  16. 2
      Demo/AcctExample/TOSHolySpirit.CPP
  17. 8
      Demo/Games/EagleDive.CPP
  18. 9
      Demo/Graphics/FontEd.CPP
  19. 2
      Demo/Lectures/GraphicsCPULoad.CPP
  20. 2
      Demo/Lectures/MiniGrLib.CPP
  21. 6
      Demo/Lectures/PageTableEntries1.CPP
  22. 2
      Demo/Lectures/ScreenMemory.CPP
  23. 2
      Demo/SortFileExample/SortedF64.DAT
  24. 20
      Demo/SortFileExample/SortedF64.TXT
  25. 2
      Demo/SortFileExample/UnsortedF64.DAT
  26. 20
      Demo/SortFileExample/UnsortedF64.TXT
  27. 4
      Demo/WebLogExample/access_150211.LOG
  28. 2
      Demo/WebLogExample/access_150213.LOG
  29. 16
      Doc/ChangeLog.TXT
  30. 6
      Doc/Confuse.TXT
  31. 2
      Doc/Credits.TXT
  32. 2
      Doc/Demands.TXT
  33. 8
      Doc/Glossary.TXT
  34. 2
      Doc/MemOverview.TXT
  35. BIN
      Doc/TaskSrv.TXT
  36. 2
      Kernel/Display.CPP
  37. 17
      Kernel/KDbg.CPP
  38. 8
      Kernel/KEnd.CPP
  39. 3
      Kernel/KExts.CPP
  40. 4
      Kernel/KInts.CPP
  41. 4
      Kernel/KMisc.CPP
  42. 12
      Kernel/KStart.CPP
  43. 8
      Kernel/KTask.CPP
  44. 2467
      Kernel/Kernel.MAP
  45. 4
      Kernel/Kernel.PRJ
  46. 42
      Kernel/KernelA.HPP
  47. 2
      Kernel/KernelB.HPP
  48. 5
      Kernel/KernelC.HPP
  49. 10
      Kernel/KeyDev.CPP
  50. 72
      Kernel/Mem/BlkPool.CPP
  51. 45
      Kernel/Mem/HeapCtrl.CPP
  52. 3
      Kernel/Mem/MAllocFree.CPP
  53. 9
      Kernel/Mem/MakeMem.CPP
  54. 180
      Kernel/Mem/Mem2Meg.CPP
  55. 169
      Kernel/Mem/Mem512.CPP
  56. 119
      Kernel/Mem/MemPhysical.CPP
  57. 180
      Kernel/Mem/PageTables.CPP
  58. 532
      Kernel/MemA.CPP
  59. 26
      Kernel/MultiProc.CPP
  60. 112
      Kernel/Sched.CPP
  61. 6
      Linux/GodWords100
  62. 2
      StartOS.CPP

BIN
0000Boot/0000Kernel.BIN.C

Binary file not shown.

6
Adam/ADefine.CPP

@ -11,8 +11,8 @@ U0 LoadDocDefines()
//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","118,728");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,899");
$ID,4$DefinePrint("DD_TEMPLEOS_LOC","118,749");
DefinePrint("DD_TEMPLEOS_LOC_OFFICIAL","80,937");
$ID,-4$
DefinePrint("DD_KERNEL","%08X",bfh);
bfh(I64)+=bfh->file_size-1;
@ -23,7 +23,7 @@ $ID,-4$
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);
MP_VECT_ADDR+COREAP_16BIT_INIT_END-COREAP_16BIT_INIT-1);
DefinePrint("DD_SYS_FIXED_AREA_BASE","%08X",SYS_FIXED_AREA);
DefinePrint("DD_SYS_FIXED_AREA_END","%08X",

8
Adam/Ctrls/CtrlsA.CPP

@ -65,7 +65,7 @@ U0 DrawCtrls(CTask *task)
if (!Bt(&task->display_flags,DISPLAYf_NO_BORDER)) {
PUSHFD
CLI
while (LBts(&task->locked_flags,TASKLf_TASK_LOCK))
while (LBts(&task->task_flags,TASKf_TASK_LOCK))
PAUSE
task->win_left--; //Allow drawing on border
@ -74,7 +74,7 @@ U0 DrawCtrls(CTask *task)
task->win_bottom++;
WinDerivedValsUpdate(task);
LBtr(&task->locked_flags,TASKLf_TASK_LOCK);
LBtr(&task->task_flags,TASKf_TASK_LOCK);
POPFD
if (c->draw_it)
@ -82,7 +82,7 @@ U0 DrawCtrls(CTask *task)
PUSHFD
CLI
while (LBts(&task->locked_flags,TASKLf_TASK_LOCK))
while (LBts(&task->task_flags,TASKf_TASK_LOCK))
PAUSE
task->win_left++;
@ -91,7 +91,7 @@ U0 DrawCtrls(CTask *task)
task->win_bottom--;
WinDerivedValsUpdate(task);
LBtr(&task->locked_flags,TASKLf_TASK_LOCK);
LBtr(&task->task_flags,TASKf_TASK_LOCK);
POPFD
}
} else

69
Adam/God/GodBible.CPP

@ -270,14 +270,69 @@ public U0 BibleVerse(CDoc *doc_out=NULL,U8 *verse,I64 lines)
}
}
U0 BibleView()
{
U8 buf[STR_LEN];
I64 book=PopUpPickDefineSub("ST_BIBLE_BOOKS");
if (book>=0) {
StrPrint(buf,"BF:%Z,1:1",book,"ST_BIBLE_BOOKS");
Ed(buf);
public CDoc *BibleDoc()
{//Return Bible as DolDoc with trees.
CDoc *result=DocRead(BIBLE_FILENAME);
CDocEntry *doc_e=result->root.next,*doc_e1;
Bool open_chapter=FALSE;
U8 *ptr=Define("ST_BIBLE_BOOK_LINES");
I64 book,book_cnt=DefineCnt("ST_BIBLE_BOOK_LINES")-1,
chapter,
line=Str2I64(ptr,,&ptr);
ptr++;
for (book=0;book<book_cnt;book++) {
while (doc_e->y+1<line) {
doc_e1=doc_e->next;
DocEntryDel(result,doc_e);
doc_e=doc_e1;
}
result->cur_entry=doc_e;
result->cur_col=0;
DocPrint(result,"$$TR,\"%Z\"$$\n$$ID,2$$",book,"ST_BIBLE_BOOKS");
line=Str2I64(ptr,,&ptr);
ptr++;
chapter=1;
while (doc_e->y+1<line) {
doc_e1=doc_e->next;
if (doc_e->type_u8==DOCT_TEXT && StrMatch(":1 ",doc_e->tag)) {
result->cur_entry=doc_e;
result->cur_col=0;
if (open_chapter) {
DocPrint(result,"$$ID,-2$$");
open_chapter=FALSE;
}
DocPrint(result,"$$TR,\"%d\"$$\n$$ID,2$$",chapter++);
open_chapter=TRUE;
} else if (chapter==1) {
doc_e1=doc_e->next;
DocEntryDel(result,doc_e);
doc_e=doc_e1;
}
doc_e=doc_e1;
}
result->cur_entry=doc_e;
result->cur_col=0;
if (open_chapter) {
DocPrint(result,"$$ID,-2$$");
open_chapter=FALSE;
}
DocPrint(result,"$$ID,-2$$");
}
while (doc_e!=result) {
doc_e1=doc_e->next;
DocEntryDel(result,doc_e);
doc_e=doc_e1;
}
return result;
}
public U0 BibleView()
{//View Bible as DolDoc with trees.
U8 buf[STR_LEN];
CDoc *doc=BibleDoc;
StrPrint(buf,"AL:%d,1",doc);
Ed(buf);
DocDel(doc);
}
U0 CtrlAltB(I64)
{

4
Adam/God/HSNotes.TXT

@ -154,6 +154,10 @@ Best way for Bill Gates to save lives? $FG,4$Earthquake prediction$FG$
Stem cells? $FG,4$Lower hanging fruit exists (2007)$FG$
Eleventh commandment? $FG,4$Thou shall not litter.(Maybe, glory of Creation)$FG$
Twelfth commandment? $FG,4$Don't slaughter unarmed men in war.$FG$
Thirteenth commandment $FG,4$No gore unless it looks fake.$FG$
Fourteenth commandment $FG,4$No pedophilia or child porn.$FG$
Fifteenth commandment $FG,4$Don't eat rare meat with blood.$FG$
Sixteenth commandment $FG,4$No wife beating.$FG$
Before Katrina $FG,4$Floods do justice. Black bead elder (tree book)$FG$
After Katrina $FG,4$Suffering Simplifies Life$FG$
What field are You most better? $FG,4$Economics$FG$

2
Adam/Gr/GrTextBase.CPP

@ -344,7 +344,7 @@ public U0 TextBorder(CTask *task=NULL,
TextChar(task,,i,b+1,'Í'+attr);
}
for (i=t;i<=b;i++) {
TextChar(task,,l-1,i,'º'+attr);
TextChar(task,,l-1,i,'º'+attr); //Note: $LK,"RawDr",A="MN:RawDr"$() uses this char.
TextChar(task,,r+1,i,'º'+attr);
}
} else {

BIN
Adam/WallPaper.CPP

Binary file not shown.

82
Apps/TimeOut/TimeOut.CPP

File diff suppressed because one or more lines are too long

BIN
Compiler/Compiler.BIN

Binary file not shown.

219
Compiler/Compiler.MAP

File diff suppressed because one or more lines are too long

10
Compiler/Lex.CPP

@ -440,7 +440,7 @@ I64 Lex(CCmpCtrl *cc)
I64 i,j,k,ch;
CHash *temph;
Bool str_done,neg_e;
U8 *fbuf,*buf2,*buf3,buf[LEX_MAX_IDENT];
U8 *fbuf,*buf2,*buf3,buf[STR_LEN];
cc->last_line_num=cc->lex_include_stk->line_num;
while (TRUE) {
lex_cont:
@ -469,8 +469,8 @@ lex_ident:
i=0;
buf[i++]=ch;
while (TRUE) {
if (i>=LEX_MAX_IDENT-1) //1 for terminator
break;
if (i>=STR_LEN)
LexExcept(cc,"Ident limited to STR_LEN chars at ");
else if (!(ch=LexGetChar(cc)))
break;
else if (Bt(cc->chars_bmp_alpha_numeric,ch))
@ -607,7 +607,7 @@ lex_float_start:
buf2=NULL;
i=0;
do {
j=LexInStr(cc,buf,LEX_MAX_IDENT,&str_done);
j=LexInStr(cc,buf,STR_LEN,&str_done);
buf3=MAlloc(i+j);
if (buf2) {
MemCpy(buf3,buf2,i);
@ -748,7 +748,7 @@ lex_float_start:
buf[j++]=ch;
else
break;
if (j>=LEX_MAX_IDENT-4) {//spare spot for '\\' next loop
if (j>=STR_LEN-4) {//Spot for ['\'][ch],[ch],[0]
buf[j++]=0;
buf3=MAlloc(i+j);
if (buf2) {

2
Demo/AcctExample/HomeLocalize.CPP

@ -7,7 +7,7 @@ Option(OPTf_WARN_DUP_TYPES,ON);
KbdTypeMatic(0);
// Las Vegas is -7 during summer, -8 during winter
local_time_offset=-7*60*60*CDATE_FREQ; //Pacific
local_time_offset=-8*60*60*CDATE_FREQ; //Pacific
// Remember you can set the time in the BIOS.
//$AN,"",A="mouse_move_scale"$adjust these to set mouse move scale

BIN
Demo/AcctExample/PersonalMenu.TXT

Binary file not shown.

19
Demo/AcctExample/PersonalNotes.TXT

@ -10,8 +10,6 @@ $WW,1$* I'm going to redo all my videos and make them more professional.
* Get rid of having two terms and pick one, "Disk" and "BlkDev"? I don't think so. (Probably not.)
* Make Bible into Tree Branches Collapsed.
* God said this is bad. $LK,"FL:::/Adam/DolDoc/DocFind.CPP,41"$
* $LK,"ChkDsk",A="MN:ChkDsk"$ alloc unalloced.
@ -22,6 +20,9 @@ $WW,1$* I'm going to redo all my videos and make them more professional.
CArrayDim dim;
CHashFun *fun_ptr;
* Add Russian, Hebrew and all Greek. $LK,"TextBorder",A="MN:TextBorder"$() $LK,"RawDr",A="MN:RawDr"$().
Add aux_font $LK,"chars_bmp_alpha",A="MN:chars_bmp_alpha"$.
* Clean-up ASCII-127 delete char.
* $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(st); With st="\n\\";
@ -53,6 +54,8 @@ $WW,1$* I'm going to redo all my videos and make them more professional.
* I think subswitch_start with a break in the preface fails.
* Do $LK,"CTask",A="MN:CTask"$->task_flags need to be in separate cache lines?
* Add editor select just visible text for with filter.
* Add change-triangle-color to mesh editor.
@ -208,7 +211,7 @@ so that applications can plan a big alloc.
* This $LK,"Fs->catch_except=TRUE",A="FF:::/Kernel/SrvCmd.CPP,Fs->catch_except=TRUE"$ causes problems because it
catches divide and out-of-mem. Not sure what to do, yet.
* Make $LK,"BSPStartMP",A="MN:BSPStartMP"$() start work after boot to reset multicores. Bonus for
* Make $LK,"Core0StartMP",A="MN:Core0StartMP"$() start work after boot to reset multicores. Bonus for
freeing old task memory. (Prolly never gonna do anything about this.)
* $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$ local vars.
@ -342,7 +345,7 @@ Offer only in approved place: $TX,"Deuteronomy 12:13-18",HTML="http://www.bibleg
Jesus' zeal for the Temple: $TX,"John 2:14-19",HTML="http://www.biblegateway.com/passage/?search=John%202:14-19&version=NIV"$
>lspci -v
Size:$TX,"17294 KB",D="DD_TEMPLEOSCD_K_SIZE"$
Size:$TX,"17318 KB",D="DD_TEMPLEOSCD_K_SIZE"$
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/E6K9zK9ZWSg\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/E6K9zK9ZWSg\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
8:11 Behold, the days come, saith the Lord GOD, that I will send a
@ -394,6 +397,14 @@ Zombie Game
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/F27r_9oyqBI\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/F27r_9oyqBI\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
Sports Game
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/ORXqOEGFQfE\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/ORXqOEGFQfE\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
MachineGun
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/wv_Q0E5PSC0\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/wv_Q0E5PSC0\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
Van Gogh
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/YBMGVu6GTDw\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/YBMGVu6GTDw\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
DumbGuards
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/OdKa9bXVinE\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/OdKa9bXVinE\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
$TX,"WWW.OSDEV.ORG",HTML="http://www.osdev.org"$

34
Demo/AcctExample/Registry.CPP

@ -2,44 +2,44 @@ $TR-UL,"Adam"$
$ID,2$$TR,"SysMsgFlags"$
$ID,2$sys_msg_flags[0]=0xFF;
$ID,-2$$TR,"SysRegVer"$
$ID,2$registry_version=3.110;
$ID,2$registry_version=3.120;
$ID,-2$$ID,-2$$TR-UL,"TempleOS"$
$ID,2$$TR,"TOS"$
$ID,2$I64 tos_code_walk_thru=105,tos_after_egypt_in_action=46;
$ID,-2$$TR,"DiningStars"$
$ID,2$F64 best_score=9999.0000;
$ID,-2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=9;
$ID,-2$$TR,"EagleDive"$
$ID,2$I64 best_score=4;
$ID,-2$$TR,"CircleTrace"$
$ID,2$F64 best_score=4.9425;
$ID,-2$$TR,"DunGen"$
$ID,2$F64 best_score=20.5295;
$ID,-2$$TR,"CastleFrankenstein"$
$ID,2$F64 best_score=33.8405;
$ID,-2$$TR,"ZoneOut"$
$ID,2$F64 best_score=50.3318;
$ID,-2$$TR,"Varoom"$
$ID,2$F64 best_score=46.2643;
$ID,-2$$TR,"FlapBat"$
$ID,2$F64 best_score=16.4090;
$ID,-2$$TR,"TimeOut"$
$ID,2$I64 best_score=22202;
$ID,-2$$TR,"RawHide"$
$ID,2$F64 best_score=96.1279;
$ID,-2$$TR,"KeepAway"$
$ID,2$I64 best_score0=0,best_score1=9999;
$ID,-2$$TR,"BlackDiamond"$
$ID,2$I64 best_score=9;
$ID,-2$$TR,"Varoom"$
$ID,2$F64 best_score=46.2643;
$ID,-2$$TR,"CastleFrankenstein"$
$ID,2$F64 best_score=33.8405;
$ID,-2$$TR,"TimeOut"$
$ID,2$I64 best_score=22202;
$ID,-2$$TR,"Wenceslas"$
$ID,2$F64 best_score=49.8074;
$ID,-2$$TR,"BomberGolf"$
$ID,2$I64 best_score=175;
$ID,-2$$TR,"XCaliber"$
$ID,2$I64 best_score=248;
I64 msg_flags=1;
$ID,-2$$TR,"CircleTrace"$
$ID,2$F64 best_score=4.9425;
$ID,-2$$TR,"EagleDive"$
$ID,2$I64 best_score=4;
$ID,-2$$TR,"BomberGolf"$
$ID,2$I64 best_score=175;
$ID,-2$$ID,-2$$TR,"DemoCompany"$
$ID,2$$TR,"Game1"$
$ID,2$F64 best_score=166.20441;
$ID,2$F64 best_score=258.59407;
$TR,"SimpleVal"$
$ID,2$1267;
$ID,2$1269;
$ID,-2$$ID,-2$$ID,-2$

2
Demo/AcctExample/TOSHolySpirit.CPP

@ -369,7 +369,7 @@ public U0 GodBooksPassage(U8 *files_find_mask,I64 len=512,
DirTreeDel(tempde1);
}
#define NIST_TIME_OFFSET (-7788-21-local_time_offset/CDATE_FREQ)
#define NIST_TIME_OFFSET (-11455-local_time_offset/CDATE_FREQ)
#define NIST_TIME_TO_SWITCH 3
public U0 NISTSync()

8
Demo/Games/EagleDive.CPP

@ -497,7 +497,7 @@ U0 MPDrawIt(CTask *task,CDC *dc)
LBtr(&mp.update_not_done_flags,Gs->num);
}
U0 APEagleDiveTask(CTask *master_task)
U0 CoreAPEagleDiveTask(CTask *master_task)
{
CDC *dc=DCAlias(main_dc,master_task);
while (!mp.app_done) {
@ -605,7 +605,7 @@ U0 DrawHorizon(CDC *dc)
dc->depth_buf=old_db;
}
U0 BSPEagleDive()
U0 Core0EagleDive()
{
CDC *dc=DCAlias(main_dc,Fs);
I64 i,xx,yy,height,bkcolor,cx=Fs->pix_width>>1,cy=Fs->pix_height>>1;
@ -808,7 +808,7 @@ U0 Init(I64 _mp_cnt)
z=64 *COORDINATE_SCALE*MAP_SCALE;
for (i=1;i<mp.mp_cnt;i++)
Spawn(&APEagleDiveTask,Fs,"AP EagleDive",i);
Spawn(&CoreAPEagleDiveTask,Fs,"AP EagleDive",i);
Fs->task_end_cb=&TaskEndCB;
game_t0=tS;
}
@ -900,7 +900,7 @@ U0 EagleDive(I64 _mp_cnt=MP_MAX_PROCESSORS)
è =Wrap(è);
é2=Wrap(é2);
} else
BSPEagleDive;
Core0EagleDive;
} while (ch!=CH_SHIFT_ESC && ch!=CH_ESC);
catch
PutExcept;

9
Demo/Graphics/FontEd.CPP

@ -5,7 +5,9 @@ You can save it as a binary file with:
You can load it with:
U64 *my_font=FileRead("filename.BIN.Z");
text.font=my_font; //preserve text.font if you want to go back.
text.aux_font=my_font;
<CTRL-ALT-f> will toggle main font and aux_font.
If you want to change the system font permanently,
save to a file with this font editor program
@ -16,13 +18,14 @@ See $LK,"::/Demo/ExtendedChars.CPP"$ and $LK,"::/Demo/ScreenCodes.CPP"$.
*/
#define BLOW_UP_CHAR_X (18*FONT_WIDTH)
#define BLOW_UP_CHAR_Y (2*FONT_HEIGHT)
#define BLOW_UP_CHAR_Y (4*FONT_HEIGHT)
U8 cur_ch;
U0 DrawIt(CTask *task,CDC *dc)
{
I64 i,j,k,c;
TextPrint(task,0,0,BLUE<<4+YELLOW,"Press <CTRL-ALT-f> to Toggle Aux Font.");
k=0;
for (i=0;i<16;i++)
for (j=0;j<16;j++) {
@ -33,7 +36,7 @@ U0 DrawIt(CTask *task,CDC *dc)
c=(YELLOW<<4+BLUE)<<8 + k++;
} else
c=(BLUE<<4+WHITE)<<8 + k++;
TextChar(task,,j,i,c);
TextChar(task,,j,i+2,c);
}
k=0;

2
Demo/Lectures/GraphicsCPULoad.CPP

@ -27,7 +27,7 @@ U0 GrDemo()
"$$GREEN$$Rate:$$RED$$%5.1f FPS$$FG$$"
" $$GREEN$$Load@30Hz:$$RED$$%5.1f%%$$FG$$\n",1/t,100*t*30.0;
}
//<CTRL-ALT-f> will flush screen VGA cache.
//<CTRL-ALT-v> will flush screen VGA cache.
VGAFlush;
}

2
Demo/Lectures/MiniGrLib.CPP

@ -121,7 +121,7 @@ It is not normal to by-pass the TempleOS graphcis routines.
The TempleOS graphics don't know VGA has changed.
This bit tells TempleOS to update whole screen.
*/
//<CTRL-ALT-f> will flush screen VGA cache.
//<CTRL-ALT-v> will flush screen VGA cache.
VGAFlush;
}

6
Demo/Lectures/PageTableEntries1.CPP

@ -5,7 +5,7 @@ TempleOS keeps a cached copy of VGA memory in
$LK,"gr.screen_image",A="MN:CGrGlbls"$. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$.
TempleOS used 4096 size pages for memory below addr 2 Meg
and 2 Meg pages above two Meg. See $LK,"MemPageSize",A="MN:MemPageSize"$() and $LK,"INIT_MEMORY",A="FF:::/Kernel/MemA.CPP,SYS_INIT_MEM"$.
and 2 Meg pages above two Meg. See $LK,"MemPageSize",A="MN:MemPageSize"$() and $LK,"INIT_MEMORY",A="FF:::/Kernel/Mem/PageTables.CPP,SYS_INIT_MEM"$.
*/
U0 PageTableDemo1()
@ -28,7 +28,7 @@ U0 PageTableDemo1()
// SetRAX(0x100000+0x1000*(MEM_NUM_PML1+MEM_NUM_PML2+MEM_NUM_PML3));
// MOV_CR3_EAX
//<CTRL-ALT-f> will flush screen VGA cache.
//<CTRL-ALT-v> will flush screen VGA cache.
VGAFlush;
PressAKey;
@ -37,7 +37,7 @@ U0 PageTableDemo1()
InvlPg(VGAM_GRAPHICS);
InvlPg(VGAM_GRAPHICS+0x1000);
//<CTRL-ALT-f> will flush screen VGA cache.
//<CTRL-ALT-v> will flush screen VGA cache.
VGAFlush;
}

2
Demo/Lectures/ScreenMemory.CPP

@ -39,7 +39,7 @@ That means no read-modify-writes, too.
//TempleOS has a 4 plane memory duplicate of the screen, $LK,"gr.screen_image",A="MN:CGrGlbls"$,
//and only writes actual changes. See $LK,"GrUpdateVGAGraphics",A="MN:GrUpdateVGAGraphics"$().
//<CTRL-ALT-f> will flush screen VGA cache.
//<CTRL-ALT-v> will flush screen VGA cache.
VGAFlush;
}

2
Demo/SortFileExample/SortedF64.DAT

@ -1 +1 @@
Z¶ϊ5Ρ§?πWΜτ™£Ο?§¦O<EFBFBD><EFBFBD>?/΅ξV<EFBFBD>OΫ?@ο<EFBFBD><EFBFBD>ξ*ά? $Υώϊγ?ΰ"ϋ©/η?J3™®ΐ*λ?`έ¶¦c<EFBFBD>λ?Υ*«b3ύν?
ξ½{<EFBFBD><EFBFBD><EFBFBD>¥?g±»Σσ Ψ?[βη Ω‡Ϊ?\ςta6‘ή?1bO΅‹•ί?ήa&KΩΕί?φ—Έ0Με?[»-a<EFBFBD>-λ?ωΉ«ϋ«ν?8’χ<EFBFBD>ο?

20
Demo/SortFileExample/SortedF64.TXT

@ -1,11 +1,11 @@
//This is sorted.
0.209918
0.227671
0.252834
0.282144
0.283027
0.388650
0.663171
0.694189
0.888085
0.998097
0.081829
0.111027
0.133980
0.156361
0.219912
0.340922
0.718021
0.871259
0.932122
0.942353

2
Demo/SortFileExample/UnsortedF64.DAT

@ -1 +1 @@
@ο<EFBFBD><EFBFBD>ξ*ά?J3™®ΐ*λ?Z¶ϊ5Ρ§? $Υώϊγ?§¦O<EFBFBD><EFBFBD>?`έ¶¦c<EFBFBD>λ?Υ*«b3ύν?πWΜτ™£Ο?ΰ"ϋ©/η?/΅ξV<EFBFBD>?
[βη Ω‡Ϊ?φ—Έ0Με?[»-a<EFBFBD>-λ?ήa&KΩΕί?1bO΅‹•ί?\ςta6‘ή?8’χ<EFBFBD>ο?g±»Σσ Ψ?ωΉ«ϋ«ν?ξ½{<EFBFBD><EFBFBD><EFBFBD>¥?

20
Demo/SortFileExample/UnsortedF64.TXT

@ -1,11 +1,11 @@
//This is unsorted.
0.283027
0.998097
0.663171
0.694189
0.252834
0.388650
0.227671
0.282144
0.209918
0.888085
0.871259
0.718021
0.111027
0.156361
0.219912
0.081829
0.133980
0.932122
0.340922
0.942353

4
Demo/WebLogExample/access_150211.LOG

@ -674,7 +674,7 @@
161.0.62.51 - - [10/Feb/2015:16:15:27 -0800] "GET /Wb/Home/Wb2/Downloads.html HTTP/1.1" 200 7086 "http://www.templeos.org/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
88.41.247.103 - - [10/Feb/2015:16:16:59 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
69.206.243.192 - - [10/Feb/2015:16:21:17 -0800] "GET /Wb/Doc/AboutTempleOS.html HTTP/1.1" 200 4925 "http://www.templeos.org/" "Mozilla/5.0 (Linux; U; Android 4.4.4; pl-pl; GT-I9505 Build/KTU84Q) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 XiaoMi/MiuiBrowser/2.0.1" "www.templeos.org"
52.53.176.53 - - [10/Feb/2015:16:26:28 -0800] "GET /Wb/Kernel/MemC.html HTTP/1.1" 200 173397 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
52.53.176.53 - - [10/Feb/2015:16:26:28 -0800] "GET /Wb/Kernel/Mem/HeapCtrl.html HTTP/1.1" 200 173397 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
202.176.251.67 - - [10/Feb/2015:16:33:00 -0800] "GET /Wb/Adam/Opt/Utils/S2T.html HTTP/1.1" 200 38162 "-" "Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html)" "www.templeos.org"
52.53.176.179 - - [10/Feb/2015:16:39:02 -0800] "GET /Wb/Adam/DolDoc/DocInit.CPP.Z HTTP/1.1" 200 1786 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
141.23.85.107 - - [10/Feb/2015:16:43:09 -0800] "GET /favicon.ico HTTP/1.1" 200 1078 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
@ -783,7 +783,7 @@
58.71.218.57 - - [10/Feb/2015:20:07:23 -0800] "GET /files/History HTTP/1.1" 301 101 "http://www.templeos.org/Wb/Home/Wb2/History.html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
58.71.218.57 - - [10/Feb/2015:20:07:23 -0800] "GET /files/History/ HTTP/1.1" 200 3176 "http://www.templeos.org/Wb/Home/Wb2/History.html" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
77.26.170.124 - - [10/Feb/2015:20:08:46 -0800] "GET / HTTP/1.1" 200 6329 "http://disqus.com/embed/comments/?base=default&version=d1b39333cdab5cb490d069fe62825a04&f=hausdorff&t_u=http%3A%2F%2Fblog.nullspace.io%2Fkernel-latency.html&t_d=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&t_t=84%25%20of%20a%20single-threaded%201KB%20write%20in%20Redis%20is%20spent%20in%20the%20kernel&s_o=default" "Mozilla/5.0 (Windows NT 6.3; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
194.182.202.170 - - [10/Feb/2015:20:15:33 -0800] "GET /Wb/Kernel/KernelA.html HTTP/1.1" 200 2050776 "http://www.templeos.org/Wb/Kernel/MemB.html" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
194.182.202.170 - - [10/Feb/2015:20:15:33 -0800] "GET /Wb/Kernel/KernelA.html HTTP/1.1" 200 2050776 "http://www.templeos.org/Wb/Kernel/Mem/MAllocFree.html" "Mozilla/5.0 (X11; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
126.106.40.164 - - [10/Feb/2015:20:16:35 -0800] "GET / HTTP/1.1" 200 6329 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"
52.53.176.129 - - [10/Feb/2015:20:19:30 -0800] "GET /Wb/Kernel/?D=A HTTP/1.1" 200 12449 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
126.106.40.164 - - [10/Feb/2015:20:21:18 -0800] "GET /files/ASU_Transcripts.pdf HTTP/1.1" 200 13602 "http://www.templeos.org/Wb/Home/Wb2/TempleOS.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.111 Safari/537.36" "www.templeos.org"

2
Demo/WebLogExample/access_150213.LOG

@ -209,7 +209,7 @@
15.88.159.153 - - [12/Feb/2015:03:17:28 -0800] "GET /Wb/Home/Wb2/ScreenShots.html HTTP/1.1" 200 3353 "http://www.templeos.org/Wb/Home/Wb2/TempleOS.html" "Mozilla/5.0 (Linux; Android 4.4.2; LG-D850 Build/KVT49L.D85010f) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36" "www.templeos.org"
15.88.159.153 - - [12/Feb/2015:03:17:28 -0800] "GET /Wb/Home/Wb2/Imgs/MenuV0104.BMP HTTP/1.1" 200 153718 "http://www.templeos.org/Wb/Home/Wb2/ScreenShots.html" "Mozilla/5.0 (Linux; Android 4.4.2; LG-D850 Build/KVT49L.D85010f) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36" "www.templeos.org"
15.88.159.150 - - [12/Feb/2015:03:17:28 -0800] "GET /Wb/Home/Wb2/Imgs/ToTheFront.BMP HTTP/1.1" 200 90050 "http://www.templeos.org/Wb/Home/Wb2/ScreenShots.html" "Mozilla/5.0 (Linux; Android 4.4.2; LG-D850 Build/KVT49L.D85010f) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.109 Mobile Safari/537.36" "www.templeos.org"
18.199.184.33 - - [12/Feb/2015:03:17:50 -0800] "GET /Wb/Kernel/MemB.html HTTP/1.1" 200 233249 "http://www.templeos.org/Wb/Doc/HolyC.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
18.199.184.33 - - [12/Feb/2015:03:17:50 -0800] "GET /Wb/Kernel/Mem/MAllocFree.html HTTP/1.1" 200 233249 "http://www.templeos.org/Wb/Doc/HolyC.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"
96.11.7.110 - - [12/Feb/2015:03:18:13 -0800] "GET /Wb/Home/Wb2/Files/VanGogh/?S=D HTTP/1.1" 200 1007 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)" "www.templeos.org"
15.79.75.90 - - [12/Feb/2015:03:18:16 -0800] "GET /files/ASU_Transcripts.pdf HTTP/1.1" 200 13602 "-" "Dalvik/1.6.0 (Linux; U; Android 4.4.2; LG-D850 Build/KVT49L.D85010f)" "www.templeos.org"
18.199.184.33 - - [12/Feb/2015:03:18:20 -0800] "GET /Wb/Doc/DolDocOverview.html HTTP/1.1" 200 48077 "http://www.templeos.org/Wb/Doc/HolyC.html" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0" "www.templeos.org"

16
Doc/ChangeLog.TXT

@ -2,7 +2,21 @@
Use $LK,"R",A="MN:R"$() to rename if I change a label.
$IV,1$----09/27/15 21:18:10----$IV,0$
$IV,1$----11/03/15 22:40:18----$IV,0$
* Added $FG,2$CTRL-ALT-f$FG$ to toggle an aux font.
* $FG,2$CTRL-ALT-v$FG$ is now flush VGA cache.
* Added $LK,"BibleDoc",A="MN:BibleDoc"$ to present Bible with tree widgets.
* Fixed $FG,2$CTRL-ALT-C$FG$ bug.
$IV,1$----11/01/15 21:44:46----$IV,0$
* $BK,1$TempleOS version 3.12 Released$BK,0$
* Created $FG,2$/Kernel/Mem$FG$ directory.
$IV,1$----10/08/15 10:17:55----$IV,0$
* $LK,"R",A="MN:R"$("$FG,4$BSP$FG$","$FG,4$Core0$FG$");
$IV,1$----10/06/15 06:30:49----$IV,0$
* Added $LK,"TaskFocusNext",A="MN:TaskFocusNext"$().
$IV,1$----09/27/15 11:46:44----$IV,0$
* Got rid of preemption.

6
Doc/Confuse.TXT

@ -1,6 +1,6 @@
$WW,1$$FG,5$$TX+CX,"Clearing-up Confusions"$$FG$
* I, $FG,2$Terry A. Davis$FG$, wrote every one of the $TX,"119,216",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.2",D="DD_TEMPLEOS_AGE"$ years (full-time). It runs on bare hardware with no layering, libraries, tools, modules or anything from other sources. It's 100% independent and stands alone. It has no networking and certainly doesn't call home. Every line of TempleOS src code is including in all distro's, from the kernel to the compiler to the boot loaders. See $LK,"::/Doc/Credits.TXT"$.
* I, $FG,2$Terry A. Davis$FG$, wrote every one of the $TX,"118,706",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.2",D="DD_TEMPLEOS_AGE"$ years (full-time). It runs on bare hardware with no layering, libraries, tools, modules or anything from other sources. It's 100% independent and stands alone. It has no networking and certainly doesn't call home. Every line of TempleOS src code is including in all distro's, from the kernel to the compiler to the boot loaders. See $LK,"::/Doc/Credits.TXT"$.
* TempleOS does not execute code not written by me and any time except for a few $FG,2$BIOS$FG$ calls for configuration. See $LK,"::/Doc/Credits.TXT"$.
@ -26,14 +26,12 @@ $WW,1$$FG,5$$TX+CX,"Clearing-up Confusions"$$FG$
* I use the term $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.TXT,JIT Compile Mode"$. This means it is compiled and executable code placed into mem, ready to be called.
* Files with names ending in $FG,2$.Z$FG$ are compressed, not encrypted. $LK,"Copy",A="MN:Copy"$() or rename them with $LK,"Move",A="MN:Move"$() to store them uncompressed.
* Files with names ending in $FG,2$.Z$FG$ are individually compressed, not encrypted. $LK,"Copy",A="MN:Copy"$() or rename them with $LK,"Move",A="MN:Move"$() to store them uncompressed.
* TempleOS is open src and every bit of the src code is included in the distro. Use $LK,"MakeOSDrvBootInstall",A="MN:MakeOSDrvBootInstall"$() to compile the kernel and compiler.
* TempleOS does not use object files or a linker.
* The swap rate is high because tasks stay in the queue and poll conditions and swap-out voluntarily. Swaps also occur at $FG,2$$TX,"1000 Hz",D="DD_JIFFY_HZ"$$FG$ due to the timer interrupt. See $LK,"JIFFY_FREQ",A="MN:JIFFY_FREQ"$.
* Refresh rate is how often TempleOS updates screen mem. It is not syncronized to the hardware rate. It has nothing to do with it.
* No application has a lock on the speaker so apps can interfere with each other and TempleOS makes speaker noise during disk access on purpose.

2
Doc/Credits.TXT

@ -4,7 +4,7 @@ $WW,1$$FG,5$$TX+CX,"Credits"$$FG$
2) $LK,"ATA Reg and Cmd Definitions",A="MN:ATA_NOP"$ are originally from Linux. Later, I got the spec.
3) The heap algorithm, $LK,"::/Kernel/MemB.CPP"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system.
3) The heap algorithm, $LK,"::/Kernel/Mem/MAllocFree.CPP"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system.
4) The LZW compression algorithm, $LK,"::/Kernel/Compress.CPP"$, came from a magazine and I implemented it when I worked for Ticketmaster.

2
Doc/Demands.TXT

@ -28,7 +28,7 @@ $LK,"/Kernel/PCIBIOS.CPP",A="FI:::/Kernel/PCIBIOS.CPP"$ :290 could be eliminate
* Perhaps, Intel can make a fast software interrupt, the same as a CALL REL32? Perhaps, we have a new x86 mode for TempleOS?
* Since I don't use paging (for anything), Intel should have an option for no-paging long mode, and optimize it.
$LK,"::/Kernel/MemA.CPP"$ :153 lines to identity-map gets eliminated.
$LK,"::/Kernel/Mem/PageTables.CPP"$ :153 lines to identity-map gets eliminated.
* Desktop computers must have a reset switch and a fast reboot option, skipping diagnostics. I recommend booting TempleOS when the reset button is pressed and booting UEFI when the power button is pressed. Or, we could build UEFI on a TempleOS layer. Intel must burn TempleOS into a ROM in the factory for all desktop x86 CPUs to ensure tamper-proof trust in the oracle and because God deserves the glory. There will be just an English version. A new ROM version is released every seven years.

8
Doc/Glossary.TXT

@ -8,7 +8,7 @@ $FG,2$ACD$FG$ AutoComplete Dictionary
$FG,2$Addr$FG$ Address
$FG,2$Alloc$FG$ Allocate
$FG,2$AOT$FG$ Ahead-of-Time
$FG,2$AP$FG$ Application Processor(CPU#>0)
$FG,2$AP$FG$ ApplicationProcessor (Core1 - Core7)
$FG,2$Arg$FG$ Argument
$FG,2$Asm$FG$ Assemble, Assembler or Assembly
$FG,2$Attr$FG$ Attribute
@ -17,7 +17,6 @@ $FG,2$BG$FG$ Backround
$FG,2$Bin$FG$ Binary
$FG,2$Blk$FG$ Block
$FG,2$Bmp$FG$ BitMap
$FG,2$BSP$FG$ Boot-strap Processor(CPU#0)
$FG,2$Buf$FG$ Buffer
$FG,2$Bwd$FG$ Backward
$FG,2$CB$FG$ Call-Back, Code Block
@ -119,6 +118,7 @@ $FG,2$Sec$FG$ Second, Secondary
$FG,2$$FG,2$Sect$FG$ Sector
$FG,2$Seq$FG$ Sequence
$FG,2$Snd$FG$ Sound
$FG,2$SP$FG$ SingleProcessor
$FG,2$Src$FG$ Source
$FG,2$Srv$FG$ Servant
$FG,2$Stat$FG$ Status, Statistic
@ -252,6 +252,6 @@ $ID,-2$$TR,"Join"$
$ID,2$When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin.
$ID,-2$$TR,"user_data"$
$ID,2$Many operating system structures have space set aside for you to store values. You are on your own managing these with multiple applications and libraries.
$ID,-2$$TR,"Multicore BSP/AP Processors"$
$ID,2$The $FG,2$boot-strap processor$FG$ is core#0, has the $FG,2$Adam task$FG$, and it is the master. The $FG,2$application processors$FG$ have Seth tasks and are the slave processors. Only the $FG,2$BSP$FG$ core#0 processor's tasks can have windows. More or less, applications are launched exclusively from the $FG,2$BSP$FG$ processor. It is the master. The only way slave cores get used is if the application explicitly $LK,"Spawn",A="MN:Spawn"$s() a task on them or $LK,"JobQue",A="MN:JobQue"$() a job on them.
$ID,-2$$TR,"Multicore Core0/CoreAP"$
$ID,2$Core#0, has the $FG,2$Adam task$FG$, and it is the master. The $FG,2$application processors$FG$ have Seth tasks and are the slave processors. Only core#0 tasks can have windows and can launch applications. Slave cores are used if the application explicitly $LK,"Spawn",A="MN:Spawn"$s() a task or $LK,"JobQue",A="MN:JobQue"$() a job on them.
$ID,-2$

2
Doc/MemOverview.TXT

@ -55,6 +55,6 @@ $ID,-2$
$WW,1$* Note: There is a break in the data-heap block pool. This has no effect except the obvious effect that fragmentation has on contiguous requests. I can $LK,"MAlloc",A="MN:MAlloc"$() an 8 Gig chunk on my 12 Gig machine.
* Note: For systems with less than 2 Gig RAM, the code and data heap block pools are the same. For systems with 2-4 Gig of RAM, the code heap is 1/4 of the total. See $LK,"HeapsInit",A="MN:HeapsInit"$().
* Note: For systems with less than 2 Gig RAM, the code and data heap block pools are the same. For systems with 2-4 Gig of RAM, the code heap is 1/4 of the total. See $LK,"BlkPoolsInit",A="MN:BlkPoolsInit"$().
* See $LK,"Independent HeapCtrl Example",A="FA:::/Kernel/KEnd.CPP,Independent HeapCtrl Example"$.

BIN
Doc/TaskSrv.TXT

Binary file not shown.

2
Kernel/Display.CPP

@ -94,7 +94,7 @@ U0 WinDerivedValsUpdate(CTask *task=NULL)
{//Those things calculated from other variables.
if (!task) task=Fs;
//Assert: This is called with TASKLf_TASK_LOCK set
//Assert: This is called with TASKf_TASK_LOCK set
PUSHFD
CLI
task->win_width =task->win_right-task->win_left+1;

17
Kernel/KDbg.CPP

@ -334,13 +334,6 @@ U0 Dr(CTask *task=NULL)
"RIP:%016X\n",task->rip;
}
U0 OverRideSingleUserSwap()
{//You never need this, probably.
Bool old_single=SingleUser(OFF);
Yield;
SingleUser(old_single);
}
U8 *SysGetStr2(I64)
{
U8 buf[512];
@ -458,7 +451,7 @@ U0 G(U8 *ip=INVALID_PTR,CTask *task=NULL)
">B2;\t\t\t//Clear all break points\n"
">G2;\t\t\t//Clear all break points and Go\n\n"
"After resuming, <CTRL-ALT-t> changes focus task\n"
"After resuming, <CTRL-ALT-f> flushes screen VGA cache\n";
"After resuming, <CTRL-ALT-v> flushes screen VGA cache\n";
else {
LBtr(&task->task_flags,TASKf_DISABLE_BPTS);
LBtr(&task->rflags,RFLAGf_TRAP);//No single step
@ -534,12 +527,12 @@ U0 DbgHelp()
">G2;\t\t\t\t//B2;VGAFlush;WinFocus;G;\n"
">Exit;\t\t\t\t//Exit (kill) task.\n\n"
"After resuming, <CTRL-ALT-t> changes focus task.\n"
"After resuming, <CTRL-ALT-f> flushes screen VGA cache.\n\n";
"After resuming, <CTRL-ALT-v> flushes screen VGA cache.\n\n";
}
U0 Dbg2()
{
Bool old_win_inhibit,old_waiting_msg;
Bool old_win_inhibit,old_waiting_msg,old_single;
I64 i,old_getstr2;
U8 buf[200];
if (IsRaw) {
@ -555,8 +548,10 @@ U0 Dbg2()
kbd.scan_code=0;
old_getstr2=fp_getstr2;
fp_getstr2=&SysGetStr2;
old_single=SingleUser(OFF);
while (!mouse.install_attempts)
OverRideSingleUserSwap;
Yield;
SingleUser(old_single);
UserTaskCont;
fp_getstr2=old_getstr2;
Fs->win_inhibit=old_win_inhibit;

8
Kernel/KEnd.CPP

@ -67,6 +67,8 @@ U0 SysGlblsInit()
U0 SysGrInit()
{
text.font=sys_font_8x8;
text.aux_font=MAlloc(256*FONT_HEIGHT);
MemCpy(text.aux_font,text.font,256*FONT_HEIGHT);
if (!Bt(&sys_run_level,RLf_VGA)) { //if text mode
text.cols=80;
text.rows=25;
@ -133,7 +135,7 @@ U0 KernelMain()
{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart.CPP,I32 &Kernel"$
OutU8(0x61,InU8(0x61)&~3); //Snd(0);
adam_task=Fs;
HeapsInit;
BlkPoolsInit;
LBts(&sys_run_level,RLf_FULL_HEAP);
SysGlblsInit;
Mem32DevInit;
@ -148,7 +150,7 @@ U0 KernelMain()
TaskDerivedValsUpdate;
SysDefinesLoad;
BSPInit;
Core0Init;
IntInit1;
//Before this point use $LK,"Snd",A="MN:Snd"$() and $LK,"BusyWait",A="MN:BusyWait"$()
@ -184,7 +186,7 @@ U0 KernelMain()
#exe {
if (!kernel_cfg->opts[CFG_NO_MP])
StreamPrint("\"MultiCore Start\\n\\n\";"
"BSPStartMP;"
"Core0StartMP;"
"LBts(&sys_run_level,RLf_MP);");
};

3
Kernel/KExts.CPP

@ -8,6 +8,7 @@ import Bool DocUnlock(CDoc *doc);
import Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
extern U0 AdamErr(U8 *fmt,...);
extern U0 AdamLog(U8 *fmt,...);
extern I64 BIOSTotalMem();
extern I64 BlkDevAdd(CBlkDev *bd,Bool one_drv,Bool make_free);
extern U0 BlkDevChk(CBlkDev *bd);
extern Bool BlkDevLock(CBlkDev *bd);
@ -47,6 +48,8 @@ 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 GetS(U8 *buf,I64 size,Bool allow_ext=TRUE);
extern CHeapCtrl *HeapCtrlInit(CHeapCtrl *hc=NULL,
CTask *task=NULL,CBlkPool *bp);
extern Bool ISO1FileFind(CDrv *dv,I64 cur_dir_cluster,U8 *name,
CDirEntry *_result,I64 fuf_flags=0);
extern Bool ISODrvInit(CDrv *dv,I64 blk);

4
Kernel/KInts.CPP

@ -45,9 +45,7 @@ IRQ_TIMER:: //I_TIMER
MOV EAX,U32 LAPIC_EOI
MOV U32 [RAX],0
JMP @@25
@@20: CALL &IntCore0TimerHandler //Only Core 0 calls this.
@@25: JMP I32 RESTORE_RSI_TASK
//************************************
INT_FAULT::
@ -80,7 +78,7 @@ INT_FAULT::
PUSH U64 CTask.fault_num[RSI]
MOV RSI,CTask.rsi[RSI]
CALL &Fault2 //See $LK,"Fault2",A="FF:::/Kernel/KDbg.CPP,Fault2"$
JMP I32 RESTORE_FS_TASK_WITH_KEY_CHECK
JMP I32 RESTORE_FS_TASK
INT_FAULT_ERR_CODE_BITMAP::
DU32 0x00027D00,0,0,0,0,0,0,0;

4
Kernel/KMisc.CPP

@ -244,12 +244,12 @@ Bool Raw(Bool val)
{//Switches to direct screen, non-windowed output.
if (!val)
VGAFlush;
return !LBEqu(&Fs->task_flags,TASKf_NOT_RAW,!val);
return !LBEqu(&Fs->display_flags,DISPLAYf_NOT_RAW,!val);
}
Bool IsRaw()
{//Are we in BLACK & WHITE raw screen mode?
return !Bt(&Fs->task_flags,TASKf_NOT_RAW);
return !Bt(&Fs->display_flags,DISPLAYf_NOT_RAW);
}
Bool SingleUser(Bool val)

12
Kernel/KStart.CPP

@ -16,7 +16,7 @@ because it is #included first. $LK,"Kernel.PRJ",A="FF:::/Kernel/Kernel.PRJ,KSta
*/
USE16
SYS_KERNEL:: //This must match $LK,"CKernel",A="MN:CKernel"$.
JMP U16 BSP_16BIT_INIT
JMP U16 CORE0_16BIT_INIT
//************************************
// ASM Global vars required for 16-bit start-up
@ -52,7 +52,7 @@ SYS_PCI_BUSSES:: DU16 0;
#assert $$-SYS_KERNEL==sizeof(CKernel)-sizeof(CBinFile)
//************************************
BSP_16BIT_INIT::
CORE0_16BIT_INIT::
//EBX is $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart.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/Reboot.CPP,BOOT_SRC_RAM"$.)
MOV AX,(BOOT_RAM_LIMIT-BOOT_STK_SIZE)/16
MOV SS,AX
@ -172,8 +172,8 @@ The assembler doesn't support far jumps so we hand code it.
To complete the switch to 32-bit mode, we have to load
the code segment with a far jump.
*/
DU8 0x66,0xEA; //JMP CGDT.boot_cs:BSP_32BIT_INIT
DU32 BSP_32BIT_INIT;
DU8 0x66,0xEA; //JMP CGDT.boot_cs:CORE0_32BIT_INIT
DU32 CORE0_32BIT_INIT;
DU16 CGDT.boot_cs;
#assert $$+16<=0xFFFF
@ -231,7 +231,7 @@ SYS_CACHE_LINE_WIDTH:: DU64 DFT_CACHE_LINE_WIDTH;
SYS_SEMAS:: DU8 NUM_SYS_SEMAS*SEMA_STRUCT_SIZE DUP(0);
//************************************
ALIGN 16,OC_NOP
BSP_32BIT_INIT:: //Entry point for $LK,"RAMReboot",A="MN:RAMReboot"$.
CORE0_32BIT_INIT:: //Entry point for $LK,"RAMReboot",A="MN:RAMReboot"$.
PUSH U32 RFLAGG_START
POPFD
MOV EAX,SYS_START_CR0
@ -367,7 +367,7 @@ USE32
WRMSR
MOV EBX,BOOT_SRC_RAM
MOV EAX,I32 BSP_32BIT_INIT
MOV EAX,I32 CORE0_32BIT_INIT
JMP EAX
SYS_RAM_REBOOT_END::
USE64

8
Kernel/KTask.CPP

@ -251,14 +251,14 @@ U0 TaskDerivedValsUpdate(CTask *task=NULL,Bool update_z_buf=TRUE)
if (!task) task=Fs;
PUSHFD
CLI
while (LBts(&task->locked_flags,TASKLf_TASK_LOCK))
while (LBts(&task->task_flags,TASKf_TASK_LOCK))
PAUSE
WinDerivedValsUpdate(task);
if (fp_update_ctrls)
(*fp_update_ctrls)(task);
if (update_z_buf && Bt(&task->display_flags,DISPLAYf_SHOW))
LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0);
LBtr(&task->locked_flags,TASKLf_TASK_LOCK);
LBtr(&task->task_flags,TASKf_TASK_LOCK);
POPFD
}
@ -442,7 +442,7 @@ I64 TaskEnd()
if (LBtr(&task->display_flags,DISPLAYf_SHOW))
LBts(&sys_semas[SYS_SEMA_UPDATE_WIN_Z_BUF],0);
while (LBts(&task->locked_flags,TASKLf_TASK_LOCK))
while (LBts(&task->task_flags,TASKf_TASK_LOCK))
PAUSE
while (LBts(&task->srv_ctrl.flags,SVCRf_LOCKED))
PAUSE
@ -478,7 +478,7 @@ I64 TaskEnd()
TaskQueRem(task);
LBtr(&task->srv_ctrl.flags,SVCRf_LOCKED);
LBtr(&task->locked_flags,TASKLf_TASK_LOCK);
LBtr(&task->task_flags,TASKf_TASK_LOCK);
if (sys_winmgr_task) {
task->next_task=Gs->dying_task_lst;

2467
Kernel/Kernel.MAP

File diff suppressed because one or more lines are too long

4
Kernel/Kernel.PRJ

@ -23,12 +23,10 @@
#include "KernelB.HPP"
#include "KExts"
#include "StrA"
#include "MemA"
#include "KGlbls"
#include "MemB"
#include "KMathB"
#include "Sched"
#include "MemC"
#include "Mem/MakeMem"
#include "Font8x8"
#include "StrB"
#include "KHashA"

42
Kernel/KernelA.HPP

@ -2071,8 +2071,6 @@ class CAOTCtrl
#define TK_INS_BINARY_SIZE 0x126
#define TK_NUM_TK 0x127
#define LEX_MAX_IDENT 134 //Max is 132
class CLexHashTableContext
{
CLexHashTableContext *next;
@ -3219,26 +3217,26 @@ public class CTaskSettings
};
#help_index "Task"
//Border ATTR src
//CTask.border_src
#define BDS_CONST 0
#define BDS_CUR_DRV 1
#define BDS_ED_FILENAME_DRV 2
//Task title src
//CTask.title_src
#define TTS_CONST 0
#define TTS_LOCKED_CONST 1 //This is not strictly enforced
#define TTS_TASK_NAME 2
#define TTS_ED_FILENAME 3
#define TTS_CUR_LEX 4
// TASK task flags
#define TASKf_KILL_TASK 0
#define TASKf_SUSPENDED 1
#define TASKf_IDLE 2
#define TASKf_INPUT_FILTER_TASK 3
#define TASKf_FILTER_INPUT 4
#define TASKf_HAS_SONG 5
#define TASKf_NOT_RAW 6
//CTask.task_flags
#define TASKf_TASK_LOCK 0
#define TASKf_KILL_TASK 1
#define TASKf_SUSPENDED 2
#define TASKf_IDLE 3
#define TASKf_INPUT_FILTER_TASK 4
#define TASKf_FILTER_INPUT 5
#define TASKf_HAS_SONG 6
#define TASKf_DISABLE_BPTS 7
#define TASKf_AWAITING_MSG 8
#define TASKf_BREAK_LOCKED 9
@ -3247,14 +3245,13 @@ public class CTaskSettings
#define TASKf_KILL_AFTER_DBG 12
#define TASKf_NONTIMER_RAND 13
//locked flags
#define TASKLf_TASK_LOCK 0
//CTask.display_flags
#define DISPLAYf_SHOW 0
#define DISPLAYf_SILENT 1
#define DISPLAYf_NO_BORDER 2
#define DISPLAYf_WIN_ON_TOP 3
#define DISPLAYf_CHILDREN_NOT_ON_TOP 4
#define DISPLAYf_NOT_RAW 1
#define DISPLAYf_SILENT 2
#define DISPLAYf_NO_BORDER 3
#define DISPLAYf_WIN_ON_TOP 4
#define DISPLAYf_CHILDREN_NOT_ON_TOP 5
#define TASK_SIGNATURE_VAL 'TskS'
#define TASK_NAME_LEN 31
@ -3268,9 +3265,8 @@ class CTaskStk
public class CTask //The Fs segment reg points to current CTask.
{
CTask *addr; //Self-addressed ptr
U32 task_signature,pad;
I64 task_flags,locked_flags;
U32 display_flags,win_inhibit;
U32 task_signature;
U32 task_flags,display_flags,win_inhibit;
I64 wake_jiffy;
CHeapCtrl *code_heap,*data_heap;
@ -3554,7 +3550,7 @@ public class CTextGlbls
I64 raw_col,raw_flags;
U8 *raw_screen_image;
I64 rows,cols; //Use TEXT_ROWS,TEXT_COLS
U64 *font;
U64 *font,*aux_font;
};
#define FONT_WIDTH 8

2
Kernel/KernelB.HPP

@ -232,7 +232,7 @@ public _extern SYS_PROGRESSES
#help_file "::/Doc/MultiCore"
public _extern SYS_CPU_STRUCTS CCPU *cpu_structs; //$LK,"Gs",A="MN:Gs"$ points to cur $LK,"CCPU",A="MN:CCPU"$.
public _extern SYS_MP_CNT I64 mp_cnt; //Count of cores
_extern SYS_MP_CNT_INITIAL I64 mp_cnt_initial; //only used during $LK,"BSPStartMP",A="MN:BSPStartMP"$
_extern SYS_MP_CNT_INITIAL I64 mp_cnt_initial; //only used during $LK,"Core0StartMP",A="MN:Core0StartMP"$
_extern SYS_MP_CNT_LOCK I64 mp_cnt_lock;
_extern SYS_SEMAS CSema sys_semas[NUM_SYS_SEMAS];

5
Kernel/KernelC.HPP

@ -581,8 +581,8 @@ public extern U0 QSortI64(I64 *base,I64 num,
public extern U0 ProgressBarsRst();
#help_index "MultiCore"
extern U0 APSethTask();
extern U0 BSPStartMP();
extern U0 Core0StartMP();
extern U0 CoreAPSethTask();
public extern U0 MPInt(U8 num,I64 cpu_num=1);
public extern U0 MPIntAll(U8 num);
public extern U0 MPNMInt();
@ -666,7 +666,6 @@ public extern U0 SleepUntil(I64 wake_jiffy);
#help_index "Task/Misc"
extern U0 (*fp_update_ctrls)(CTask *task);
public extern U0 OverRideSingleUserSwap();
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);

10
Kernel/KeyDev.CPP

@ -150,7 +150,7 @@ U0 CtrlAltE(I64)
U0 CtrlAltF(I64)
{
VGAFlush;
SwapI64(&text.font,&text.aux_font);
}
U0 CtrlAltM(I64)
@ -163,6 +163,11 @@ U0 CtrlAltT(I64)
LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_TAB);
}
U0 CtrlAltV(I64)
{
VGAFlush;
}
U0 CtrlAltX(I64)
{
LBts(sys_ctrl_alt_flags,SYSf_CTRL_ALT_X);
@ -204,8 +209,9 @@ U0 KeyDevInit()
CtrlAltCBSet('C',&CtrlAltC,"Cmd /Break Execution",,TRUE);
CtrlAltCBSet('D',&CtrlAltD,"Cmd /Enter Debugger",,TRUE);
CtrlAltCBSet('E',&CtrlAltE,"Cmd /Spawn New User Task");
CtrlAltCBSet('F',&CtrlAltF,"Cmd /VGA Flush",,TRUE);
CtrlAltCBSet('F',&CtrlAltF,"Cmd /Toggle Aux Font");
CtrlAltCBSet('M',&CtrlAltM,"Cmd /Toggle Mute");
CtrlAltCBSet('T',&CtrlAltT,"Cmd /Switch Focus to Next Task",,TRUE);
CtrlAltCBSet('V',&CtrlAltV,"Cmd /VGA Flush",,TRUE);
CtrlAltCBSet('X',&CtrlAltX,"Cmd /Kill Focused Task",,TRUE);
}

72
Kernel/Mem/BlkPool.CPP

@ -0,0 +1,72 @@
U0 BlkPoolAdd(CBlkPool *bp,CMemBlk *m,I64 pages512)
{//Add mem to BlkPool.
if (sys_mem_init_flag)
MemSet(m,sys_mem_init_val,pages512*512);
PUSHFD
CLI
while (LBts(&bp->locked_flags,BPlf_LOCKED))
PAUSE
m->next=bp->mem_free_lst;
m->pages=pages512;
m->mb_signature=MBS_UNUSED_SIGNATURE_VAL;
bp->alloced_u8s+=pages512<<PAGE_BITS;
bp->mem_free_lst=m;
LBtr(&bp->locked_flags,BPlf_LOCKED);
POPFD