TempleOSCDV5.01.ISO
This commit is contained in:
1 parent
f6eacf7744
commit
320c7ee98a
219 files changed
+5211
-4853
No files matched your search
@@ -102,8 +102,11 @@ U0 ATARepEntry(I64 base0,I64 base1,I64 unit,U8 *msg,
|
||||
"$$RED$$Hard Drive $$LTBLUE$$ATA ";
|
||||
else
|
||||
"$$RED$$CD/DVD Drive $$LTBLUE$$ATAPI ";
|
||||
"%s$$FG$$\nBase0:0x%04X Base1:0x%04X Unit:%d$$LM,0$$\n",
|
||||
msg,base0,base1,unit;
|
||||
"%s$$FG$$\n",msg;
|
||||
if (base0==blkdev.ins_base0 && unit==blkdev.ins_unit)
|
||||
"$$PURPLE$$(Drive originally installed from.)$$FG$$\n";
|
||||
"Base0:0x%04X Base1:0x%04X Unit:%d$$LM,0$$\n",
|
||||
base0,base1,unit;
|
||||
if (_head) {
|
||||
tmpha=CAlloc(sizeof(CATARep));
|
||||
tmpha->next=*_head;
|
||||
@@ -131,13 +134,13 @@ Bool ATARepExitAllApplications()
|
||||
public I64 ATARep(Bool pmt=TRUE,Bool just_ide=FALSE,CATARep **_head=NULL)
|
||||
{//Report possible ATA devices by probing. Hard disks and CD/DVDs.
|
||||
I64 d1,d2,i,j,k,cnt=0,unlock_flags=0,num_hints=0;
|
||||
#assert NUM_BLKDEVS<=64
|
||||
#assert BLKDEVS_NUM<=64
|
||||
if (_head) *_head=NULL;
|
||||
|
||||
if (pmt && ATARepExitAllApplications)
|
||||
return 0;
|
||||
|
||||
for (i=0;i<NUM_BLKDEVS;i++)
|
||||
for (i=0;i<BLKDEVS_NUM;i++)
|
||||
if (blkdev.blkdevs[i].bd_signature==BD_SIGNATURE_VAL)
|
||||
BEqu(&unlock_flags,i,
|
||||
BlkDevLock(&blkdev.blkdevs[i]));
|
||||
@@ -185,7 +188,7 @@ public I64 ATARep(Bool pmt=TRUE,Bool just_ide=FALSE,CATARep **_head=NULL)
|
||||
ATARepEntry(d1,d2,1,"Secondary IDE",_head,&num_hints);
|
||||
}
|
||||
'\n\n';
|
||||
for (i=0;i<NUM_BLKDEVS;i++)
|
||||
for (i=0;i<BLKDEVS_NUM;i++)
|
||||
if (Bt(&unlock_flags,i))
|
||||
BlkDevUnlock(&blkdev.blkdevs[i]);
|
||||
return num_hints;
|
||||
@@ -205,7 +208,7 @@ CATARep *ATAIDDrvs(CATARep *head,CATARep **_ata_drv,CATARep **_atapi_drv)
|
||||
{//This is for when trying to sort-out main hard drives and CD/DVD drives.
|
||||
CATARep *res=NULL,*tmpha=head,*ata_drv=NULL,*atapi_drv=NULL;
|
||||
CBlkDev *bd;
|
||||
Bool was_silent=Silent;
|
||||
Bool was_silent=Silent,ins_found=FALSE;
|
||||
bd=Let2BlkDev(':',FALSE);
|
||||
Silent(was_silent);
|
||||
while (tmpha) {
|
||||
@@ -223,11 +226,18 @@ CATARep *ATAIDDrvs(CATARep *head,CATARep **_ata_drv,CATARep **_atapi_drv)
|
||||
tmpha->unit==ata_drv->unit && tmpha->num<ata_drv->num)
|
||||
ata_drv=tmpha;
|
||||
} else if (tmpha->type==BDT_ATAPI) {
|
||||
if (!atapi_drv || tmpha->unit<atapi_drv->unit ||
|
||||
tmpha->unit==atapi_drv->unit && tmpha->num<atapi_drv->num)
|
||||
if (!atapi_drv || !ins_found && (tmpha->unit<atapi_drv->unit ||
|
||||
tmpha->unit==atapi_drv->unit && tmpha->num<atapi_drv->num))
|
||||
atapi_drv=tmpha;
|
||||
}
|
||||
}
|
||||
if (tmpha->type==BDT_ATAPI && bd && bd->type==BDT_ATA &&
|
||||
tmpha->base0==blkdev.ins_base0 && tmpha->unit==blkdev.ins_unit) {
|
||||
if (!ins_found) {
|
||||
atapi_drv=tmpha;
|
||||
ins_found=TRUE;
|
||||
}
|
||||
}
|
||||
tmpha=tmpha->next;
|
||||
}
|
||||
if (_ata_drv) *_ata_drv =ata_drv;
|
||||
@@ -238,7 +248,7 @@ CATARep *ATAIDDrvs(CATARep *head,CATARep **_ata_drv,CATARep **_atapi_drv)
|
||||
CBlkDev *ATAMount(U8 first_drv_let,I64 type,I64 base0,I64 base1,I64 unit)
|
||||
{
|
||||
CBlkDev *res;
|
||||
if (0<=first_drv_let-'A'<NUM_DRVS && (type==BDT_ATA || type==BDT_ATAPI) &&
|
||||
if (0<=first_drv_let-'A'<DRVS_NUM && (type==BDT_ATA || type==BDT_ATAPI) &&
|
||||
0<=unit<=1) {
|
||||
res=BlkDevNextFreeSlot(first_drv_let,type);
|
||||
res->unit=unit;
|
||||
|
||||
@@ -11,7 +11,7 @@ U0 BlkDevLockFwdingSet(CBlkDev *bd)
|
||||
break;
|
||||
case BDT_ATA:
|
||||
case BDT_ATAPI:
|
||||
for (i=0;i<NUM_BLKDEVS;i++) {
|
||||
for (i=0;i<BLKDEVS_NUM;i++) {
|
||||
bd1=&blkdev.blkdevs[i];
|
||||
if (bd1->bd_signature==BD_SIGNATURE_VAL && bd!=bd1 &&
|
||||
(bd1->type==BDT_ATAPI || bd1->type==BDT_ATA) &&
|
||||
@@ -24,7 +24,7 @@ U0 BlkDevLockFwdingSet(CBlkDev *bd)
|
||||
}
|
||||
}
|
||||
|
||||
I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=MIN_I64,
|
||||
I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=I64_MIN,
|
||||
Bool whole_drv,Bool make_free)
|
||||
{//It will mount just one partition of prt_num>=0.
|
||||
//When repartitioing whole drive, whole_drv=TRUE.
|
||||
@@ -226,9 +226,9 @@ U0 BlkDevsInitAll()
|
||||
{
|
||||
CBlkDev *bd;
|
||||
I64 i;
|
||||
blkdev.blkdevs=CAlloc(sizeof(CBlkDev)*NUM_BLKDEVS);
|
||||
blkdev.drvs=CAlloc(sizeof(CDrv)*NUM_DRVS);
|
||||
for (i=0;i<NUM_DRVS;i++)
|
||||
blkdev.blkdevs=CAlloc(sizeof(CBlkDev)*BLKDEVS_NUM);
|
||||
blkdev.drvs=CAlloc(sizeof(CDrv)*DRVS_NUM);
|
||||
for (i=0;i<DRVS_NUM;i++)
|
||||
blkdev.let_to_drv[i]=&blkdev.drvs[i];
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_AUTO_MOUNT_IDE])
|
||||
|
||||
@@ -115,7 +115,7 @@ U0 BlkDevsRelease()
|
||||
{//When task dies, release all owned BlkDevs.
|
||||
I64 i;
|
||||
CBlkDev *bd;
|
||||
for (i=0;i<NUM_BLKDEVS;i++) {
|
||||
for (i=0;i<BLKDEVS_NUM;i++) {
|
||||
bd=&blkdev.blkdevs[i];
|
||||
if (bd->owning_task==Fs && bd->bd_signature==BD_SIGNATURE_VAL)
|
||||
BlkDevUnlock(bd,TRUE);
|
||||
@@ -151,7 +151,7 @@ CBlkDev *BlkDevNextFreeSlot(U8 first_drv_let,I64 type)
|
||||
}
|
||||
return res;
|
||||
}
|
||||
} while (++i<NUM_BLKDEVS);
|
||||
} while (++i<BLKDEVS_NUM);
|
||||
throw('BlkDev');
|
||||
return NULL; //never gets here
|
||||
}
|
||||
@@ -168,7 +168,7 @@ U0 BlkDevDel(CBlkDev *bd)
|
||||
CBlkDev *BlkDevChk(CBlkDev *bd,Bool except=TRUE)
|
||||
{//Check for valid BlkDev. Throw exception.
|
||||
if (!bd || bd->bd_signature!=BD_SIGNATURE_VAL ||
|
||||
!(BDT_NULL<bd->type<BDT_NUM_TYPES)) {
|
||||
!(BDT_NULL<bd->type<BDT_TYPES_NUM)) {
|
||||
if (except)
|
||||
throw('BlkDev');
|
||||
else
|
||||
|
||||
@@ -19,7 +19,7 @@ CFile *FOpen(U8 *filename,U8 *flags,I64 cnt=0)
|
||||
if (cnt>0)
|
||||
f->max_blk=cnt-1;
|
||||
else
|
||||
f->max_blk=MAX_I64;
|
||||
f->max_blk=I64_MAX;
|
||||
f->file_cluster_num=INVALID_CLUSTER;
|
||||
full_name=FileNameAbs(filename);
|
||||
f->dv=Let2Drv(*full_name);
|
||||
@@ -103,7 +103,7 @@ I64 FSetCluster(CFile *f,I64 c,I64 blk,Bool read)
|
||||
if (f->cluster!=c) {
|
||||
if (f->flags & FF_BUF_DIRTY) {
|
||||
i=dv->spc;
|
||||
if (f->max_blk!=MAX_I64) {
|
||||
if (f->max_blk!=I64_MAX) {
|
||||
i=f->max_blk+1-f->file_cluster_num*dv->spc;
|
||||
if (i>dv->spc)
|
||||
i=dv->spc;
|
||||
@@ -115,7 +115,7 @@ I64 FSetCluster(CFile *f,I64 c,I64 blk,Bool read)
|
||||
f->file_cluster_num=blk/dv->spc;
|
||||
if (read) {
|
||||
i=dv->spc;
|
||||
if (f->max_blk!=MAX_I64) {
|
||||
if (f->max_blk!=I64_MAX) {
|
||||
i=f->max_blk+1-f->file_cluster_num*dv->spc;
|
||||
if (i>dv->spc)
|
||||
i=dv->spc;
|
||||
|
||||
@@ -28,7 +28,7 @@ U0 DrvsRelease()
|
||||
{//When task dies, release all owned drvs.
|
||||
I64 i;
|
||||
CDrv *dv;
|
||||
for (i=0;i<NUM_DRVS;i++) {
|
||||
for (i=0;i<DRVS_NUM;i++) {
|
||||
dv=&blkdev.drvs[i];
|
||||
if (dv->owning_task==Fs && dv->dv_signature==DRV_SIGNATURE_VAL)
|
||||
DrvUnlock(dv,TRUE);
|
||||
@@ -40,7 +40,7 @@ CDrv *DrvMakeFreeSlot(U8 drv_let)
|
||||
//!!! drv_let is not a $LK,"remapped",A="MN:DrvMap"$ drv.
|
||||
I64 i=Let2Let(drv_let)-'A';
|
||||
CDrv *res;
|
||||
if (!(0<=i<NUM_DRVS))
|
||||
if (!(0<=i<DRVS_NUM))
|
||||
throw('Drv');
|
||||
res=&blkdev.drvs[i];
|
||||
MemSet(res,0,sizeof(CDrv));
|
||||
@@ -52,7 +52,7 @@ U8 DrvNextFreeLet(U8 first_drv_let='C')
|
||||
{//Locate free slot for new drv, like during $LK,"Mount",A="MN:Mount"$().
|
||||
//!!! first_drv_let is not a $LK,"remapped",A="MN:DrvMap"$ drv.
|
||||
I64 i=Let2Let(first_drv_let)-'A',type=Let2BlkDevType(first_drv_let);
|
||||
if (!(0<=i<NUM_DRVS))
|
||||
if (!(0<=i<DRVS_NUM))
|
||||
throw('Drv');
|
||||
do
|
||||
if (blkdev.drvs[i].dv_signature!=DRV_SIGNATURE_VAL) {
|
||||
@@ -61,7 +61,7 @@ U8 DrvNextFreeLet(U8 first_drv_let='C')
|
||||
else
|
||||
return i+'A';
|
||||
}
|
||||
while (++i<NUM_DRVS);
|
||||
while (++i<DRVS_NUM);
|
||||
throw('Drv');
|
||||
return 0; //Never gets here.
|
||||
}
|
||||
@@ -79,7 +79,7 @@ U0 DrvBlkDevDel(CBlkDev *bd)
|
||||
{//Delete drv's of BlkDev
|
||||
I64 i;
|
||||
CDrv *dv;
|
||||
for (i=0;i<NUM_DRVS;i++) {
|
||||
for (i=0;i<DRVS_NUM;i++) {
|
||||
dv=&blkdev.drvs[i];
|
||||
if (dv->bd==bd)
|
||||
DrvDel(dv);
|
||||
@@ -316,7 +316,7 @@ U8 *DrvModelNum(U8 drv_let=0)
|
||||
return res;
|
||||
}
|
||||
|
||||
U8 blkdev_text_attr[BDT_NUM_TYPES]={BLACK,LTCYAN,WHITE,LTGREEN,LTRED,LTBLUE};
|
||||
U8 blkdev_text_attr[BDT_TYPES_NUM]={BLACK,LTCYAN,WHITE,LTGREEN,LTRED,LTBLUE};
|
||||
U8 drv_text_attr[3]={BLACK,BLUE,RED};
|
||||
|
||||
U8 DrvTextAttrGet(U8 drv_let=0)
|
||||
@@ -336,7 +336,7 @@ U0 DrvRep()
|
||||
I64 ch,i,drv_let,attr;
|
||||
U8 *st;
|
||||
"\nDefined Drives:\n";
|
||||
for (i=0,dv=blkdev.drvs;i<NUM_DRVS;i++,dv++) {
|
||||
for (i=0,dv=blkdev.drvs;i<DRVS_NUM;i++,dv++) {
|
||||
if (dv->dv_signature==DRV_SIGNATURE_VAL) {
|
||||
bd=dv->bd;
|
||||
drv_let=Drv2Let(dv);
|
||||
|
||||
@@ -302,7 +302,7 @@ U0 RedSeaFreeClusters(CDrv *dv,I64 c,I64 cnt)
|
||||
I64 RedSeaAllocClusters(CDrv *dv,I64 cnt)
|
||||
{
|
||||
CFreeLst *tmpf,*best_free=NULL;
|
||||
I64 i,first,best_size=MAX_I64;
|
||||
I64 i,first,best_size=I64_MAX;
|
||||
Bool unlock,unlock_break;
|
||||
if (cnt<=0)
|
||||
throw('Drv');
|
||||
|
||||
+6
-6
@@ -14,7 +14,7 @@ U0 ArcEntryGet(CArcCtrl *c)
|
||||
c->entry_used=FALSE;
|
||||
c->cur_entry=c->next_entry;
|
||||
c->cur_bits_in_use=c->next_bits_in_use;
|
||||
if (c->next_bits_in_use<ARC_MAX_BITS) {
|
||||
if (c->next_bits_in_use<ARC_BITS_MAX) {
|
||||
c->next_entry = &c->compress[i++];
|
||||
if (i==c->free_limit) {
|
||||
c->next_bits_in_use++;
|
||||
@@ -52,7 +52,7 @@ _ARC_ENTRY_GET::
|
||||
MOV U64 CArcCtrl.cur_entry[RSI],RAX
|
||||
MOV RCX,U64 CArcCtrl.next_bits_in_use[RSI]
|
||||
MOV U64 CArcCtrl.cur_bits_in_use[RSI],RCX
|
||||
CMP RCX,ARC_MAX_BITS
|
||||
CMP RCX,ARC_BITS_MAX
|
||||
JAE @@05
|
||||
MOV RAX,RDX
|
||||
SHL RAX,4
|
||||
@@ -116,7 +116,7 @@ U0 ArcCompressBuf(CArcCtrl *c)
|
||||
src_ptr=c->src_buf+c->src_pos;
|
||||
src_limit=c->src_buf+c->src_size;
|
||||
|
||||
if (c->saved_basecode==MAX_U32)
|
||||
if (c->saved_basecode==U32_MAX)
|
||||
basecode=*src_ptr++;
|
||||
else
|
||||
basecode=c->saved_basecode;
|
||||
@@ -175,7 +175,7 @@ U0 ArcExpandBuf(CArcCtrl *c)
|
||||
*dst_ptr++ = * -- c->stk_ptr;
|
||||
|
||||
if (c->stk_ptr==c->stk_base && dst_ptr<dst_limit) {
|
||||
if (c->saved_basecode==MAX_U32) {
|
||||
if (c->saved_basecode==U32_MAX) {
|
||||
lastcode=BFieldExtU32(c->src_buf,c->src_pos,
|
||||
c->next_bits_in_use);
|
||||
c->src_pos+=c->next_bits_in_use;
|
||||
@@ -223,7 +223,7 @@ CArcCtrl *ArcCtrlNew(Bool expand,I64 compression_type=CT_8_BIT)
|
||||
CArcCtrl *c;
|
||||
c=CAlloc(sizeof(CArcCtrl));
|
||||
if (expand) {
|
||||
c->stk_base=MAlloc(1<<ARC_MAX_BITS);
|
||||
c->stk_base=MAlloc(1<<ARC_BITS_MAX);
|
||||
c->stk_ptr=c->stk_base;
|
||||
}
|
||||
if (compression_type==CT_7_BIT)
|
||||
@@ -234,7 +234,7 @@ CArcCtrl *ArcCtrlNew(Bool expand,I64 compression_type=CT_8_BIT)
|
||||
c->free_idx=c->min_table_entry;
|
||||
c->next_bits_in_use=c->min_bits+1;
|
||||
c->free_limit=1<<c->next_bits_in_use;
|
||||
c->saved_basecode=MAX_U32;
|
||||
c->saved_basecode=U32_MAX;
|
||||
c->entry_used=TRUE;
|
||||
ArcEntryGet(c);
|
||||
c->entry_used=TRUE;
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ U8 *SrcFileName(U8 *addr,I64 cnt=1,CTask *mem_task=NULL)
|
||||
if (dbg_info=tmph->dbg_info) {
|
||||
j=dbg_info->max_line-dbg_info->min_line+1;
|
||||
body=dbg_info->body;
|
||||
best_d=MAX_I64;
|
||||
best_d=I64_MAX;
|
||||
for (i=0;i<j;i++) {
|
||||
if (0<body[i]<=addr<body[i]+cnt) {
|
||||
ii=i+1;
|
||||
|
||||
+1
-1
@@ -480,7 +480,7 @@ U0 InFile(U8 *filename)
|
||||
}
|
||||
|
||||
U0 In(U8 *fmt,...)
|
||||
{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOSDistro.HC"$.
|
||||
{//Send text to own input buffer. See $LK,"::/Demo/AcctExample/TOS/TOSDistro.HC"$.
|
||||
U8 *buf=StrPrintJoin(NULL,fmt,argc,argv),*st=AStrNew(buf);
|
||||
InStr("\"%%s\",%d;Free(%d);",st,st);
|
||||
Free(buf);
|
||||
|
||||
+23
-23
@@ -1,7 +1,7 @@
|
||||
//This is run in a $LK,"#exe",A="FF:::/Kernel/Kernel.PRJ,KCfg"${}.
|
||||
|
||||
U8 *kernel_cfg_options="MemInit\0HeapInit\0VarInit\0StaffMode\0"
|
||||
"HomeDir\0NoMP\0TextMode\0DontProbe\0AutoMountIDE\0BootRescueDrv\0Help\0";
|
||||
"HomeDir\0NoMP\0TextMode\0DontProbe\0AutoMountIDE\0DbgDistro\0Help\0";
|
||||
|
||||
#define CFG_MEM_INIT 0
|
||||
#define CFG_HEAP_INIT 1
|
||||
@@ -12,23 +12,23 @@ U8 *kernel_cfg_options="MemInit\0HeapInit\0VarInit\0StaffMode\0"
|
||||
#define CFG_TEXT_MODE 6
|
||||
#define CFG_DONT_PROBE 7
|
||||
#define CFG_AUTO_MOUNT_IDE 8
|
||||
#define CFG_BOOT_RESCUE_DRV 9
|
||||
#define CFG_NUM_OPTIONS 10
|
||||
#define CFG_DBG_DISTRO 9
|
||||
#define CFG_OPTIONS_NUM 10
|
||||
|
||||
#define CFG_HELP 10
|
||||
|
||||
class CKernelCfg
|
||||
class CKCfg
|
||||
{
|
||||
U8 *dsk_cache_size_exp;
|
||||
CDoc *add_dev;
|
||||
U8 *boot_rescue_drv_file,*boot_rescue_drv_start;
|
||||
U8 *dbg_distro_file,*dbg_distro_start;
|
||||
U8 *home_dir;
|
||||
Bool opts[CFG_NUM_OPTIONS];
|
||||
Bool opts[CFG_OPTIONS_NUM];
|
||||
U8 mem_init_val,heap_init_val,var_init_val,
|
||||
boot_drv_let,auto_mount_ide_hd_let,auto_mount_ide_cd_let;
|
||||
};
|
||||
|
||||
CDoc *KernelCfgAddDev(CKernelCfg *c)
|
||||
CDoc *KCfgAddDev(CKCfg *c)
|
||||
{
|
||||
I64 ch;
|
||||
CDoc *doc=DocNew;
|
||||
@@ -47,14 +47,14 @@ CDoc *KernelCfgAddDev(CKernelCfg *c)
|
||||
return doc;
|
||||
}
|
||||
|
||||
U0 KernelCfgOptions(CKernelCfg *c)
|
||||
U0 KCfgOptions(CKCfg *c)
|
||||
{
|
||||
I64 i;
|
||||
U8 *st=NULL,*st2,*st3;
|
||||
Bool state;
|
||||
do {
|
||||
Free(st);
|
||||
for (i=0;i<CFG_NUM_OPTIONS;i++)
|
||||
for (i=0;i<CFG_OPTIONS_NUM;i++)
|
||||
if (i==CFG_HOME_DIR)
|
||||
"$$PURPLE$$%13tz$$FG$$:\"%s\"\n",i,kernel_cfg_options,c->home_dir;
|
||||
else
|
||||
@@ -73,10 +73,10 @@ U0 KernelCfgOptions(CKernelCfg *c)
|
||||
"$$PURPLE$$TextMode$$FG$$ Text Mode (requires hard reboot).\n"
|
||||
"$$PURPLE$$DontProbe$$FG$$ Just prompt CD/DVD ports, don't probe.\n"
|
||||
"$$PURPLE$$AutoMountIDE$$FG$$ AutoMount IDE drives to 'C' and 'T'.\n"
|
||||
"$$PURPLE$$BootRescueDrv$$FG$$ Include RAM Drv in Kernel.BIN.\n"
|
||||
"$$PURPLE$$DbgDistro$$FG$$ Include RAM Drv in Kernel.BIN.\n"
|
||||
"\n";
|
||||
else
|
||||
if (0<=i<CFG_NUM_OPTIONS) {
|
||||
if (0<=i<CFG_OPTIONS_NUM) {
|
||||
state=c->opts[i]=!c->opts[i];
|
||||
switch (i) {
|
||||
case CFG_MEM_INIT:
|
||||
@@ -133,13 +133,13 @@ U0 KernelCfgOptions(CKernelCfg *c)
|
||||
c->auto_mount_ide_cd_let=0;
|
||||
}
|
||||
break;
|
||||
case CFG_BOOT_RESCUE_DRV:
|
||||
Free(c->boot_rescue_drv_file);
|
||||
c->boot_rescue_drv_file=0;
|
||||
c->boot_rescue_drv_start=0;
|
||||
case CFG_DBG_DISTRO:
|
||||
Free(c->dbg_distro_file);
|
||||
c->dbg_distro_file=0;
|
||||
c->dbg_distro_start=0;
|
||||
if (state) {
|
||||
c->boot_rescue_drv_file=GetStr("Boot Rescue Drv File:");
|
||||
c->boot_rescue_drv_start=GetI64("Boot Rescue Drv Start:");
|
||||
c->dbg_distro_file=GetStr("Dbg Distro File:");
|
||||
c->dbg_distro_start=GetI64("Dbg Distro Start:");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -148,25 +148,25 @@ U0 KernelCfgOptions(CKernelCfg *c)
|
||||
Free(st);
|
||||
}
|
||||
|
||||
CKernelCfg *KernelCfgNew()
|
||||
CKCfg *KCfgNew()
|
||||
{
|
||||
CKernelCfg *c=CAlloc(sizeof(CKernelCfg));
|
||||
CKCfg *c=CAlloc(sizeof(CKCfg));
|
||||
|
||||
c->add_dev=KernelCfgAddDev(c);
|
||||
c->add_dev=KCfgAddDev(c);
|
||||
c->home_dir=StrNew("::/Home");
|
||||
c->dsk_cache_size_exp=GetStr(
|
||||
"Disk Cache Size in Bytes,\n"
|
||||
"gets rounded-up funny,\n"
|
||||
"($$PURPLE$$<ENTER>$$FG$$ will use default.):",
|
||||
"Scale2Mem(0x80000,0x8000000)");
|
||||
KernelCfgOptions(c);
|
||||
KCfgOptions(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
U0 KernelCfgDel(CKernelCfg *c)
|
||||
U0 KCfgDel(CKCfg *c)
|
||||
{
|
||||
DocDel(c->add_dev);
|
||||
Free(c->boot_rescue_drv_file);
|
||||
Free(c->dbg_distro_file);
|
||||
Free(c->home_dir);
|
||||
Free(c->dsk_cache_size_exp);
|
||||
Free(c);
|
||||
|
||||
+24
-9
@@ -9,8 +9,9 @@ U0 SysGlblsInit()
|
||||
sys_focus_task=Fs;
|
||||
QueInit(&sys_macro_head);
|
||||
|
||||
blkdev.dft_iso_filename=AStrNew("::/Tmp/CDDVD.ISO");
|
||||
blkdev.tmp_filename=AStrNew("~/Tmp.DD.Z");
|
||||
blkdev.dft_iso_filename =AStrNew(DFT_ISO_FILENAME);
|
||||
blkdev.dft_iso_c_filename =AStrNew(DFT_ISO_C_FILENAME);
|
||||
blkdev.tmp_filename =AStrNew("~/Tmp.DD.Z");
|
||||
blkdev.dvd_boot_is_good=TRUE;
|
||||
#exe {
|
||||
if (!kernel_cfg->auto_mount_ide_hd_let)
|
||||
@@ -32,7 +33,7 @@ U0 SysGlblsInit()
|
||||
if (Bt(&i,j)) set_bits_table[i]++;
|
||||
}
|
||||
|
||||
ext=CAlloc(EXT_NUM_ENTRIES*sizeof(U8 *));
|
||||
ext=CAlloc(EXT_EXTS_NUM*sizeof(U8 *));
|
||||
fp_getstr2=&SysGetStr2;
|
||||
KeyDevInit;
|
||||
|
||||
@@ -130,8 +131,9 @@ U0 Reboot()
|
||||
SysHlt;
|
||||
}
|
||||
|
||||
U0 KernelMain()
|
||||
{//Continued from $LK,"Kernel",A="FF:::/Kernel/KStart64.HC,I32 &Kernel"$
|
||||
U0 KMain()
|
||||
{//Continued from $LK,"KStart64.HC",A="FF:::/Kernel/KStart64.HC,I32 &KMain"$
|
||||
CBlkDev *bd;
|
||||
OutU8(0x61,InU8(0x61)&~3); //Snd;
|
||||
adam_task=Fs;
|
||||
BlkPoolsInit;
|
||||
@@ -172,9 +174,22 @@ U0 KernelMain()
|
||||
BlkDevsInitAll;
|
||||
"ChgDsk(':');\n";
|
||||
ChgDsk(':');
|
||||
#exe {StreamPrint("HomeSet(\"%s\");",kernel_cfg->home_dir);}
|
||||
#exe {
|
||||
StreamPrint("HomeSet(\"%s\");\n"
|
||||
"blkdev.ins_base0=%d;blkdev.ins_base1=%d;blkdev.ins_unit =%d;\n",
|
||||
kernel_cfg->home_dir,
|
||||
blkdev.ins_base0,blkdev.ins_base1,blkdev.ins_unit);
|
||||
}
|
||||
Gs->idle_task->cur_dv=blkdev.let_to_drv[*blkdev.home_dir-'A'];
|
||||
DrvRep;
|
||||
if (blkdev.dvd_boot_is_good) {
|
||||
bd=Let2BlkDev(':');
|
||||
if (bd->type==BDT_ATAPI) {
|
||||
blkdev.ins_base0=bd->base0;
|
||||
blkdev.ins_base1=bd->base1;
|
||||
blkdev.ins_unit =bd->unit;
|
||||
}
|
||||
}
|
||||
LBts(&sys_run_level,RLf_BLKDEV);
|
||||
|
||||
#exe {
|
||||
@@ -213,10 +228,10 @@ U0 KernelMain()
|
||||
asm { ALIGN 16,OC_NOP
|
||||
SYS_KERNEL_END::
|
||||
#exe {
|
||||
if (kernel_cfg->opts[CFG_BOOT_RESCUE_DRV])
|
||||
if (kernel_cfg->opts[CFG_DBG_DISTRO])
|
||||
StreamPrint("DU8 0x%X-(SYS_KERNEL_END-SYS_KERNEL+"
|
||||
"BOOT_RAM_BASE+sizeof(CBinFile)) DUP (0);"
|
||||
"BINFILE \"%s\";",kernel_cfg->boot_rescue_drv_start,
|
||||
kernel_cfg->boot_rescue_drv_file);
|
||||
"BINFILE \"%s\";",kernel_cfg->dbg_distro_start,
|
||||
kernel_cfg->dbg_distro_file);
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@ 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,I64 prt_num=MIN_I64,
|
||||
extern I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=I64_MIN,
|
||||
Bool whole_drv,Bool make_free);
|
||||
extern CBlkDev *BlkDevChk(CBlkDev *bd,Bool except=TRUE);
|
||||
extern Bool BlkDevLock(CBlkDev *bd);
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ U8 *rev_bits_table, //Table with U8 bits revd
|
||||
*set_bits_table; //Table with count of set bits in a U8
|
||||
CDate local_time_offset;
|
||||
F64 *pow10_I64,
|
||||
sys_os_version=5.000;
|
||||
sys_os_version=5.010;
|
||||
|
||||
CAutoCompleteDictGlbls acd;
|
||||
CAutoCompleteGlbls ac;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ I64 HashVal(CHash *tmph)
|
||||
return tmph(CHashGeneric *)->user_data0;
|
||||
|
||||
case -1: //nobound switch
|
||||
case HTt_NUM_TYPES: //nobound switch
|
||||
case HTt_TYPES_NUM: //nobound switch
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
+3
-3
@@ -171,7 +171,7 @@ F64 Ona2Freq(I8 ona)
|
||||
I8 Freq2Ona(F64 freq)
|
||||
{//Freq to Ona. 440.0Hz is Ona=60.
|
||||
if (freq>0)
|
||||
return ClampI64(12*Log2(32.0/440.0*freq),ONA_REST+1,MAX_I8);
|
||||
return ClampI64(12*Log2(32.0/440.0*freq),ONA_REST+1,I8_MAX);
|
||||
else
|
||||
return ONA_REST;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ U0 Snd(I8 ona=ONA_REST)
|
||||
OutU8(0x61,InU8(0x61)&~3);
|
||||
} else if (ona!=snd.ona) {
|
||||
snd.ona=ona;
|
||||
period=ClampI64(SYS_TIMER_FREQ/Ona2Freq(ona),1,MAX_U16);
|
||||
period=ClampI64(SYS_TIMER_FREQ/Ona2Freq(ona),1,U16_MAX);
|
||||
OutU8(0x43,0xB6);
|
||||
OutU8(0x42,period);
|
||||
OutU8(0x42,period.u8[1]);
|
||||
@@ -301,7 +301,7 @@ Bool IsDbgMode()
|
||||
}
|
||||
|
||||
U0 ProgressBarsRst(U8 *path=NULL)
|
||||
{
|
||||
{//Reset all progress bars to zero.
|
||||
CallExtStr("ProgressBarsRegTf",path);
|
||||
MemSet(sys_progresses,0,sizeof(sys_progresses));
|
||||
}
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
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.DD"$ at $LK,"KernelMain",A="MN:KernelMain"$().
|
||||
and continues in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ at $LK,"KMain",A="MN:KMain"$().
|
||||
|
||||
The boot loader jumps here in real-mode (16-bit).
|
||||
It actually jumps to the $LK,"CBinFile",A="MN:CBinFile"$ header which is
|
||||
@@ -29,7 +29,7 @@ SYS_RUN_LEVEL:: DU32 0;
|
||||
|
||||
MEM_BOOT_BASE:: DU32 0; //Offset from start used by reboot
|
||||
MEM_E801:: DU16 0,0;
|
||||
MEM_E820:: DU8 MEM_NUM_E820_ENTRIES*sizeof(CMemE820) DUP (0);
|
||||
MEM_E820:: DU8 MEM_E820_ENTRIES_NUM*sizeof(CMemE820) DUP (0);
|
||||
MEM_PHYSICAL_SPACE:: DU64 0;
|
||||
SYS_GDT_PTR:: DU16 sizeof(CGDT)-1;
|
||||
DU64 0;
|
||||
@@ -45,8 +45,8 @@ GDT_CS64: DU64 0x00209A0000000000,0; //The $LK,"Charter",A="FI:::/Doc/Charter.DD
|
||||
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);
|
||||
GDT_TR_RING3: DU8 MP_MAX_PROCESSORS*16 DUP(0);
|
||||
GDT_TR: DU8 MP_PROCESSORS_NUM*16 DUP(0);
|
||||
GDT_TR_RING3: DU8 MP_PROCESSORS_NUM*16 DUP(0);
|
||||
#assert $$-SYS_GDT==sizeof(CGDT)
|
||||
|
||||
#assert $$-SYS_KERNEL==sizeof(CKernel)-sizeof(CBinFile)
|
||||
@@ -94,7 +94,7 @@ GET_RIP: POP BX
|
||||
MOV U16 [MEM_E801],CX
|
||||
MOV U16 [MEM_E801+2],DX
|
||||
|
||||
MOV CX,MEM_NUM_E820_ENTRIES-1 //Leave one to terminate
|
||||
MOV CX,MEM_E820_ENTRIES_NUM-1 //Leave one to terminate
|
||||
XOR EBX,EBX
|
||||
MOV AX,DS
|
||||
MOV ES,AX
|
||||
|
||||
+4
-4
@@ -7,9 +7,9 @@ MEM_HEAP_BASE:: DU64 0;
|
||||
MEM_HEAP_LIMIT:: DU64 0;
|
||||
MEM_PAGE_SIZE:: DU64 0;
|
||||
MEM_MAPPED_SPACE:: DU64 0;
|
||||
MEM_NUM_2MEG:: DU64 0;
|
||||
MEM_NUM_1GIG:: DU64 0;
|
||||
MEM_NUM_512GIG:: DU64 0;
|
||||
MEM_2MEG_NUM:: DU64 0;
|
||||
MEM_1GIG_NUM:: DU64 0;
|
||||
MEM_512GIG_NUM:: DU64 0;
|
||||
MEM_PML2:: DU64 0;
|
||||
MEM_PML3:: DU64 0;
|
||||
MEM_PML4:: DU64 0;
|
||||
@@ -69,7 +69,7 @@ SYS_MP_CNT_LOCK:: DU64 1;
|
||||
ALIGN DFT_CACHE_LINE_WIDTH,OC_NOP
|
||||
SYS_CACHE_LINE_WIDTH:: DU64 DFT_CACHE_LINE_WIDTH;
|
||||
DU8 DFT_CACHE_LINE_WIDTH-sizeof(CBinFile)-8 DUP(0);
|
||||
SYS_SEMAS:: DU8 SEMA_NUM_SEMAS*DFT_CACHE_LINE_WIDTH DUP(0);
|
||||
SYS_SEMAS:: DU8 SEMA_SEMAS_NUM*DFT_CACHE_LINE_WIDTH DUP(0);
|
||||
//************************************
|
||||
ALIGN 16,OC_NOP
|
||||
CORE0_32BIT_INIT:: //Entry point for $LK,"BootRAM",A="MN:BootRAM"$.
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ USE64
|
||||
CALL SET_FS_BASE
|
||||
MOV RSP,U64 CTask.rsp[RAX]
|
||||
|
||||
JMP I32 &KernelMain
|
||||
JMP I32 &KMain
|
||||
|
||||
//************************************
|
||||
USE32
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ U0 Exit()
|
||||
|
||||
Bool TaskValidate(CTask *task)
|
||||
{//return TRUE if task looks valid.
|
||||
if (!(0<task<=MAX_I32) || task->addr!=task ||
|
||||
if (!(0<task<=I32_MAX) || task->addr!=task ||
|
||||
task->task_signature!=TASK_SIGNATURE_VAL)
|
||||
return FALSE;
|
||||
else
|
||||
|
||||
+2009
-1985
File diff suppressed because it is too large.
Load diff
+3
-3
@@ -6,8 +6,8 @@
|
||||
Option(OPTf_WARN_PAREN,ON);
|
||||
Option(OPTf_WARN_DUP_TYPES,ON);
|
||||
#include "KCfg"
|
||||
CKernelCfg *kernel_cfg;
|
||||
kernel_cfg=KernelCfgNew;
|
||||
CKCfg *kernel_cfg;
|
||||
kernel_cfg=KCfgNew;
|
||||
};
|
||||
|
||||
#include "KernelA.HH"
|
||||
@@ -58,4 +58,4 @@
|
||||
#include "FunSeg"
|
||||
#include "KEnd"
|
||||
|
||||
#exe {KernelCfgDel(kernel_cfg);};
|
||||
#exe {KCfgDel(kernel_cfg);};
|
||||
+133
-117
@@ -21,30 +21,30 @@ extern class CTask;
|
||||
#define FALSE 0
|
||||
#define ON 1
|
||||
#define OFF 0
|
||||
#define MIN_I8 (-0x80)
|
||||
#define MAX_I8 0x7F
|
||||
#define MIN_U8 0
|
||||
#define MAX_U8 0xFF
|
||||
#define MIN_I16 (-0x8000)
|
||||
#define MAX_I16 0x7FFF
|
||||
#define MIN_U16 0
|
||||
#define MAX_U16 0xFFFF
|
||||
#define MIN_I32 (-0x80000000)
|
||||
#define MAX_I32 0x7FFFFFFF
|
||||
#define MIN_U32 0
|
||||
#define MAX_U32 0xFFFFFFFF
|
||||
#define MIN_I64 (-0x8000000000000000)
|
||||
#define MAX_I64 0x7FFFFFFFFFFFFFFF
|
||||
#define MIN_U64 0
|
||||
#define MAX_U64 0xFFFFFFFFFFFFFFFF
|
||||
#define INVALID_PTR MAX_I64
|
||||
#define I8_MIN (-0x80)
|
||||
#define I8_MAX 0x7F
|
||||
#define U8_MIN 0
|
||||
#define U8_MAX 0xFF
|
||||
#define I16_MIN (-0x8000)
|
||||
#define I16_MAX 0x7FFF
|
||||
#define U16_MIN 0
|
||||
#define U16_MAX 0xFFFF
|
||||
#define I32_MIN (-0x80000000)
|
||||
#define I32_MAX 0x7FFFFFFF
|
||||
#define U32_MIN 0
|
||||
#define U32_MAX 0xFFFFFFFF
|
||||
#define I64_MIN (-0x8000000000000000)
|
||||
#define I64_MAX 0x7FFFFFFFFFFFFFFF
|
||||
#define U64_MIN 0
|
||||
#define U64_MAX 0xFFFFFFFFFFFFFFFF
|
||||
#define INVALID_PTR I64_MAX
|
||||
#define STR_LEN 144
|
||||
|
||||
//(Int to F64 conversion is signed)
|
||||
//Turn off 80-bit float constants with $LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$.
|
||||
#define MAX_U64_F64 (0x43F0000000000000(F64))
|
||||
#define MAX_F64 (0x7FEFFFFFFFFFFFFF(F64))
|
||||
#define MIN_F64 (0xFFEFFFFFFFFFFFFF(F64))
|
||||
#define U64_F64_MAX (0x43F0000000000000(F64))
|
||||
#define F64_MAX (0x7FEFFFFFFFFFFFFF(F64))
|
||||
#define F64_MIN (0xFFEFFFFFFFFFFFFF(F64))
|
||||
#define inf (0x7FF0000000000000(F64))
|
||||
#define ì (0x7FF0000000000000(F64))
|
||||
#define pi (0x400921FB54442D18(F64))
|
||||
@@ -301,7 +301,7 @@ public class CMathODE
|
||||
//0xFF for your own interrupts.
|
||||
#define I_USER 0x40
|
||||
|
||||
#define MP_MAX_PROCESSORS 128
|
||||
#define MP_PROCESSORS_NUM 128
|
||||
|
||||
#define SYS_START_CR0 0x0031
|
||||
|
||||
@@ -343,8 +343,8 @@ class CGDT
|
||||
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];
|
||||
CGDTEntry tr_ring3[MP_MAX_PROCESSORS];
|
||||
CGDTEntry tr[MP_PROCESSORS_NUM];
|
||||
CGDTEntry tr_ring3[MP_PROCESSORS_NUM];
|
||||
};
|
||||
|
||||
class CSysLimitBase
|
||||
@@ -354,7 +354,7 @@ class CSysLimitBase
|
||||
};
|
||||
|
||||
#help_index "Memory/Info"
|
||||
#define MEM_NUM_E820_ENTRIES 48
|
||||
#define MEM_E820_ENTRIES_NUM 48
|
||||
class CMemE820
|
||||
{
|
||||
U8 *base;
|
||||
@@ -428,7 +428,7 @@ class CKernel
|
||||
U0 start;
|
||||
U32 boot_base;
|
||||
U16 mem_E801[2];
|
||||
CMemE820 mem_E820[MEM_NUM_E820_ENTRIES];
|
||||
CMemE820 mem_E820[MEM_E820_ENTRIES_NUM];
|
||||
U64 mem_physical_space;
|
||||
CSysLimitBase sys_gdt_ptr;
|
||||
U16 sys_pci_busses;
|
||||
@@ -456,26 +456,30 @@ class CKernel
|
||||
#define RLf_HOME 16
|
||||
#define RLf_AUTO_COMPLETE 17
|
||||
#define RLf_ADAM_SERVER 18
|
||||
#define RLf_ONCE_ADAM 19
|
||||
#define RLf_ONCE_USER 20
|
||||
|
||||
#define RLF_16BIT 0x00001
|
||||
#define RLF_VGA 0x00002
|
||||
#define RLF_32BIT 0x00004
|
||||
#define RLF_PATCHED 0x00008
|
||||
#define RLF_16MEG_SYS_CODE_BP 0x00010
|
||||
#define RLF_64BIT 0x00020
|
||||
#define RLF_16MEG_ADAM_HEAP_CTRL 0x00040
|
||||
#define RLF_FULL_HEAPS 0x00050
|
||||
#define RLF_RAW 0x00100
|
||||
#define RLF_INTERRUPTS 0x00200
|
||||
#define RLF_BLKDEV 0x00400
|
||||
#define RLF_MP 0x00800
|
||||
#define RLF_COMPILER 0x01000
|
||||
#define RLF_DOC 0x02000
|
||||
#define RLF_WINMGR 0x04000
|
||||
#define RLF_REGISTRY 0x08000
|
||||
#define RLF_HOME 0x10000
|
||||
#define RLF_AUTO_COMPLETE 0x20000
|
||||
#define RLF_ADAM_SERVER 0x40000
|
||||
#define RLF_16BIT 0x000001
|
||||
#define RLF_VGA 0x000002
|
||||
#define RLF_32BIT 0x000004
|
||||
#define RLF_PATCHED 0x000008
|
||||
#define RLF_16MEG_SYS_CODE_BP 0x000010
|
||||
#define RLF_64BIT 0x000020
|
||||
#define RLF_16MEG_ADAM_HEAP_CTRL 0x000040
|
||||
#define RLF_FULL_HEAPS 0x000050
|
||||
#define RLF_RAW 0x000100
|
||||
#define RLF_INTERRUPTS 0x000200
|
||||
#define RLF_BLKDEV 0x000400
|
||||
#define RLF_MP 0x000800
|
||||
#define RLF_COMPILER 0x001000
|
||||
#define RLF_DOC 0x002000
|
||||
#define RLF_WINMGR 0x004000
|
||||
#define RLF_REGISTRY 0x008000
|
||||
#define RLF_HOME 0x010000
|
||||
#define RLF_AUTO_COMPLETE 0x020000
|
||||
#define RLF_ADAM_SERVER 0x040000
|
||||
#define RLF_ONCE_ADAM 0x080000
|
||||
#define RLF_ONCE_USER 0x100000
|
||||
|
||||
#help_index "Processor"
|
||||
#define LAPIC_BASE 0xFEE00000
|
||||
@@ -581,7 +585,7 @@ class CRAXRBCRCXRDX
|
||||
#define EXT_HEAPLOG_MALLOC 2
|
||||
#define EXT_HEAPLOG_FREE 3
|
||||
#define EXT_DBG_RESUME 4
|
||||
#define EXT_NUM_ENTRIES 5
|
||||
#define EXT_EXTS_NUM 5
|
||||
|
||||
#help_index "Processor"
|
||||
#define DFT_CACHE_LINE_WIDTH 128
|
||||
@@ -613,7 +617,7 @@ class CSema
|
||||
#define SEMA_JUST_PUMP_MSGS 19
|
||||
#define SEMA_TMBEAT 20
|
||||
#define SEMA_FIX 21
|
||||
#define SEMA_NUM_SEMAS 22
|
||||
#define SEMA_SEMAS_NUM 22
|
||||
|
||||
#define CTRL_ALT_DEL 0
|
||||
#define CTRL_ALT_C 1
|
||||
@@ -655,7 +659,7 @@ public class CHashTable
|
||||
#define HTt_MODULE 14
|
||||
#define HTt_HELP_FILE 15
|
||||
#define HTt_FRAME_PTR 16
|
||||
#define HTt_NUM_TYPES 17
|
||||
#define HTt_TYPES_NUM 17
|
||||
|
||||
#define HTf_PRIVATE 23
|
||||
#define HTf_PUBLIC 24
|
||||
@@ -757,7 +761,7 @@ public class CHashImport:CHashSrcSym
|
||||
};
|
||||
|
||||
#help_index "Compiler/Internal"
|
||||
#define MAX_PTR_STARS 4
|
||||
#define PTR_STARS_NUM 4
|
||||
|
||||
//Member Lst Flags
|
||||
#define MLF_DFT_AVAILABLE 1
|
||||
@@ -930,7 +934,7 @@ public class CHashGlblVar:CHashSrcSym
|
||||
#define DOCT_HTML_CODE 41
|
||||
#define DOCT_ERROR 42
|
||||
|
||||
#define DOCT_NUM_TYPES 43
|
||||
#define DOCT_TYPES_NUM 43
|
||||
|
||||
//CDocEntry.type flags upper bits
|
||||
#define DOCET_BLINK ATTRF_BLINK
|
||||
@@ -945,7 +949,7 @@ public class CHashGlblVar:CHashSrcSym
|
||||
#define DOCEt_UNDERLINE ATTRf_UNDERLINE
|
||||
|
||||
#define DOCG_DBL_BUF_FLAGS (DOCF_OVERSTRIKE|DOCF_PLAIN_TEXT|\
|
||||
DOCF_PLAIN_TEXT_TABS|DOCF_MIN_SIZE|DOCF_NO_CURSOR|\
|
||||
DOCF_PLAIN_TEXT_TABS|DOCF_SIZE_MIN|DOCF_NO_CURSOR|\
|
||||
DOCF_FORM|DOCF_DBL_DOLLARS|DOCF_DONT_SWAP_OUT|\
|
||||
DOCF_DO_FULL_REFRESH|DOCF_BORDER_DOC|DOCF_HIDE_CURSOR|\
|
||||
DOCF_DONT_HIGHLIGHT_CURSOR|DOCF_CARRIAGE_RETURN)
|
||||
@@ -1098,7 +1102,7 @@ public class CHashGlblVar:CHashSrcSym
|
||||
#define DOCEf_DONT_DRAW 59 //only works on sprites
|
||||
#define DOCEf_DFT_LEN 60
|
||||
#define DOCEf_DFT_RAW_TYPE 61
|
||||
#define DOCEf_NUM_FLAGS 62
|
||||
#define DOCEf_FLAGS_NUM 62
|
||||
|
||||
public class CDocBin
|
||||
{
|
||||
@@ -1109,7 +1113,7 @@ public class CDocBin
|
||||
U32 num,flags,size,use_cnt;
|
||||
U0 end;
|
||||
U8 *data;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#define DOC_SCROLL_SPEED 8
|
||||
@@ -1127,11 +1131,17 @@ public class CDocBin
|
||||
#define DOC_COLOR_ANCHOR DKGRAY
|
||||
#define DOC_COLOR_TREE PURPLE
|
||||
#define DOC_COLOR_PMT GREEN
|
||||
#define DOC_COLOR_BIN CYAN
|
||||
#define DOC_COLOR_KEYWORD BLUE
|
||||
#define DOC_COLOR_KEYWORD2 LTRED
|
||||
#define DOC_COLOR_COMMENT GREEN
|
||||
#define DOC_COLOR_QUOTE BROWN
|
||||
#define DOC_COLOR_BIN LTGREEN
|
||||
#define DOC_COLOR_STR BROWN
|
||||
#define DOC_COLOR_CHAR_CONST BROWN
|
||||
#define DOC_COLOR_EXPORT_SYS_SYM LTPURPLE
|
||||
#define DOC_COLOR_DEFINE_STR CYAN
|
||||
#define DOC_COLOR_GLBL_VAR LTCYAN
|
||||
#define DOC_COLOR_CLASS LTBLUE
|
||||
#define DOC_COLOR_FUN PURPLE
|
||||
#define DOC_COLOR_KEYWORD BLUE
|
||||
#define DOC_COLOR_REG LTRED
|
||||
|
||||
public class CDocSettings
|
||||
{
|
||||
@@ -1143,7 +1153,7 @@ public class CDocSettings
|
||||
cur_text_attr,dft_text_attr;
|
||||
};
|
||||
|
||||
#define DOC_DFT MIN_I32
|
||||
#define DOC_DFT I32_MIN
|
||||
|
||||
public class CDocEntryBase
|
||||
{
|
||||
@@ -1162,7 +1172,7 @@ public class CDocEntryBase
|
||||
U32 min_col,max_col;
|
||||
CDocSettings settings;
|
||||
I64 user_data;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#define DOCE_LEN_DFT 64
|
||||
@@ -1197,11 +1207,11 @@ public class CDocEntry:CDocEntryBase
|
||||
U8 raw_type,pad[3];
|
||||
CDocBin *bin_data;
|
||||
U8 *data;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
//$LK,"DocForm",A="MN:DocForm"$() $LK,"DocMenu",A="MN:DocMenu"$() $LK,"DocEd",A="MN:DocEd"$() $LK,"PopUpMenu",A="MN:PopUpMenu"$()
|
||||
#define DOF_MIN_SIZE 0x01
|
||||
#define DOF_SIZE_MIN 0x01
|
||||
#define DOF_INTERCEPT_TASK_END 0x02
|
||||
#define DOF_DONT_HOME 0x04
|
||||
#define DOF_WIN_MAX 0x08
|
||||
@@ -1237,7 +1247,7 @@ class CEdFileName
|
||||
#define EDF_COLLAPSE 0x200
|
||||
#define EDF_UNCOLLAPSE 0x400
|
||||
#define EDF_WAS_WRITE 0x800 //Was exit ESC or SHIFT_ESC?
|
||||
//Combines with $LK,"Document Flags",A="MN:DOF_MIN_SIZE"$
|
||||
//Combines with $LK,"Document Flags",A="MN:DOF_SIZE_MIN"$
|
||||
|
||||
#define EDf_BAIL 8
|
||||
#define EDf_COLLAPSE 9
|
||||
@@ -1254,7 +1264,7 @@ class CEdFileName
|
||||
//Reserved x2
|
||||
#define DOCF_BORDER_DOC 0x100
|
||||
#define DOCF_FORM 0x200
|
||||
#define DOCF_MIN_SIZE 0x400
|
||||
#define DOCF_SIZE_MIN 0x400
|
||||
#define DOCF_HIDE_CURSOR 0x800 //use $LK,"DocCursor",A="MN:DocCursor"$
|
||||
#define DOCF_DONT_HIGHLIGHT_CURSOR 0x1000 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$
|
||||
#define DOCF_NO_SCROLL_BARS 0x2000 //use $LK,"DocScroll",A="MN:DocScroll"$
|
||||
@@ -1290,7 +1300,7 @@ class CEdFileName
|
||||
//Reserved x2
|
||||
#define DOCf_BORDER_DOC 8
|
||||
#define DOCf_FORM 9
|
||||
#define DOCf_MIN_SIZE 10
|
||||
#define DOCf_SIZE_MIN 10
|
||||
#define DOCf_HIDE_CURSOR 11 //use $LK,"DocCursor",A="MN:DocCursor"$
|
||||
#define DOCf_DONT_HIGHLIGHT_CURSOR 12 //use $LK,"DocHighlightCursor",A="MN:DocHighlightCursor"$
|
||||
#define DOCf_NO_SCROLL_BARS 13 //use $LK,"DocScroll",A="MN:DocScroll"$
|
||||
@@ -1381,7 +1391,7 @@ public class CDoc //Linked Text File header
|
||||
CDocUndo undo_head;
|
||||
|
||||
I64 user_data;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#help_index "Windows"
|
||||
@@ -1444,8 +1454,8 @@ tries to do something.
|
||||
class CWinMgrTimingGlbls
|
||||
{
|
||||
I64 last_total_jiffies,
|
||||
last_idle_pt_hits[MP_MAX_PROCESSORS],
|
||||
last_swap_cnter[MP_MAX_PROCESSORS];
|
||||
last_idle_pt_hits[MP_PROCESSORS_NUM],
|
||||
last_swap_cnter[MP_PROCESSORS_NUM];
|
||||
F64 last_calc_idle_time,calc_idle_delta_time;
|
||||
I64 calc_idle_cnt;
|
||||
};
|
||||
@@ -1467,7 +1477,7 @@ public class CWinMgrGlbls
|
||||
|
||||
#help_index "AutoComplete"
|
||||
#define ACf_INIT_IN_PROGRESS 0
|
||||
#define AC_MAX_FILLINS 10
|
||||
#define AC_FILLINS_NUM 10
|
||||
public class CAutoCompleteGlbls
|
||||
{
|
||||
I64 num_words;
|
||||
@@ -1476,8 +1486,8 @@ public class CAutoCompleteGlbls
|
||||
I64 flags;
|
||||
CTask *task;
|
||||
I64 partial_len,num_fillins,
|
||||
fillin_hits [AC_MAX_FILLINS+1];
|
||||
CHashAC *fillin_matches[AC_MAX_FILLINS+1];
|
||||
fillin_hits [AC_FILLINS_NUM+1];
|
||||
CHashAC *fillin_matches[AC_FILLINS_NUM+1];
|
||||
};
|
||||
|
||||
#help_index "AutoComplete/Dictionary"
|
||||
@@ -1504,12 +1514,12 @@ public class CAutoCompleteGlbls
|
||||
#define ACD_POS_CHAR 0x04
|
||||
#define ACD_EXTRA_CHAR 0x05
|
||||
|
||||
#define ACD_MAX_FILLINS 10
|
||||
#define ACD_FILLINS_NUM 10
|
||||
public class CAutoCompleteDictGlbls
|
||||
{
|
||||
U8 *word_lst;
|
||||
I64 word_lst_size,num_words,num_fillins;
|
||||
U8 *fillins[ACD_MAX_FILLINS];
|
||||
U8 *fillins[ACD_FILLINS_NUM];
|
||||
Bool has_words,has_defs;
|
||||
};
|
||||
|
||||
@@ -1551,7 +1561,7 @@ public class CAutoCompleteDictGlbls
|
||||
#define RT_UF32 13 //Not implemented, Fictitious
|
||||
#define RT_F64 14
|
||||
#define RT_UF64 15 //Fictitious
|
||||
#define RT_NUM_IT 16
|
||||
#define RT_RTS_NUM 16
|
||||
#define RTF_UNSIGNED 1
|
||||
#define RTG_MASK 0xFF
|
||||
|
||||
@@ -1658,7 +1668,7 @@ class CIntermediateCode:CIntermediateCodeBase
|
||||
//Tree links are used during passes 012 and 3 for determining types.
|
||||
CICTreeLinks t;
|
||||
};
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
class CPrsStk
|
||||
@@ -1685,7 +1695,7 @@ class CPrsStk
|
||||
#define CMF_I16_JMP_TABLE 0x10
|
||||
#define CMF_U16_JMP_TABLE 0x20
|
||||
|
||||
#define CM_MAX_CONSTS 16
|
||||
#define CM_CONSTS_NUM 16
|
||||
|
||||
class CCodeMisc
|
||||
{
|
||||
@@ -1756,22 +1766,22 @@ PUSH RDI PUSH R8 PUSH R9 PUSH R10 PUSH R11 PUSH R12 PUSH R13 PUSH R14 PUSH R15
|
||||
#define POP_REGS POP R15 POP R14 POP R13 POP R12 POP R11 POP R10 POP R9 \
|
||||
POP R8 POP RDI POP RSI POP RBP POP RBX POP RDX POP RCX POP RAX
|
||||
|
||||
#define NUM_REGS 16
|
||||
#define REG_RAX 0
|
||||
#define REG_RCX 1
|
||||
#define REG_RDX 2
|
||||
#define REG_RBX 3
|
||||
#define REG_RSP 4
|
||||
#define REG_RBP 5
|
||||
#define REG_RSI 6
|
||||
#define REG_RDI 7
|
||||
#define REG_R8 8
|
||||
#define REG_REGS_NUM 16
|
||||
|
||||
#define REG_RAX 0
|
||||
#define REG_RCX 1
|
||||
#define REG_RDX 2
|
||||
#define REG_RBX 3
|
||||
#define REG_RSP 4
|
||||
#define REG_RBP 5
|
||||
#define REG_RSI 6
|
||||
#define REG_RDI 7
|
||||
#define REG_R8 8
|
||||
#define REG_RIP 16 //Used by compiler, not really it's num
|
||||
#define REG_RIP 16 //Used by compiler, not really it's num
|
||||
//Be careful: RBPu8, RSPu8, RSIu8, RDIu8 are 20-24
|
||||
#define REG_NONE 32 //noreg flag sets it to this
|
||||
#define REG_ALLOC 33 //reg flag sets it to this
|
||||
#define REG_UNDEF MIN_I8
|
||||
#define REG_UNDEF I8_MIN
|
||||
|
||||
#define REGG_CLOBBERED 0x013F //RAX,RCX,RDX,RBX,R8
|
||||
#define REGG_SAVED 0x0030 //RBP,RSP
|
||||
@@ -2094,7 +2104,7 @@ class CAOTCtrl
|
||||
#define TK_ELLIPSIS 0x124
|
||||
#define TK_INS_BIN 0x125
|
||||
#define TK_INS_BIN_SIZE 0x126
|
||||
#define TK_NUM_TK 0x127
|
||||
#define TK_TKS_NUM 0x127
|
||||
|
||||
class CLexHashTableContext
|
||||
{
|
||||
@@ -2119,7 +2129,7 @@ class CLexHashTableContext
|
||||
#define CCF_JUST_LOAD 0x040
|
||||
#define CCF_KEEP_NEW_LINES 0x080
|
||||
#define CCF_KEEP_DOT 0x100
|
||||
#define CCF_KEEP_NUM_SIGN 0x200
|
||||
#define CCF_KEEP_SIGN_NUM 0x200
|
||||
#define CCF_KEEP_AT_SIGN 0x400
|
||||
#define CCF_NO_CHAR_CONST 0x800
|
||||
#define CCf_PASS_TRACE_PRESENT 12
|
||||
@@ -2194,14 +2204,14 @@ public class CCmpCtrl
|
||||
CPrsStk *ps;
|
||||
CAOTCtrl *aotc;
|
||||
I64 aot_depth,pmt_line;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#help_index "Compiler"
|
||||
public class CCmpGlbls
|
||||
{
|
||||
CHashTable *asm_hash;
|
||||
CHashClass *internal_types[RT_NUM_IT];
|
||||
CHashClass *internal_types[RT_RTS_NUM];
|
||||
CIntermediateCode ic_nop;
|
||||
U32 *dual_U16_tokens1,*dual_U16_tokens2,*dual_U16_tokens3,
|
||||
*binary_ops;
|
||||
@@ -2621,7 +2631,7 @@ public class CDirEntry
|
||||
#define BDT_ISO_FILE_READ 3
|
||||
#define BDT_ISO_FILE_WRITE 4
|
||||
#define BDT_ATAPI 5
|
||||
#define BDT_NUM_TYPES 6
|
||||
#define BDT_TYPES_NUM 6
|
||||
|
||||
#define BDF_REMOVABLE 0x001
|
||||
#define BDF_INITIALIZED 0x002
|
||||
@@ -2646,7 +2656,7 @@ public class CDirEntry
|
||||
//locked flags
|
||||
#define BDlf_LOCKED 0
|
||||
|
||||
#define NUM_BLKDEVS 26
|
||||
#define BLKDEVS_NUM 26
|
||||
#define BD_SIGNATURE_VAL 'BDSV'
|
||||
public class CBlkDev
|
||||
{
|
||||
@@ -2680,7 +2690,7 @@ public class CBlkDev
|
||||
#define FSt_ISO13346 5 //Not Supported (CD/DVD)
|
||||
#define FSt_NTFS 6 //Not Supported
|
||||
#define FSt_UNKNOWN 7
|
||||
#define FSt_NUM_TYPES 8
|
||||
#define FSt_TYPES_NUM 8
|
||||
#define FSG_TYPE_MASK 0x7FFF
|
||||
//File system type flags
|
||||
#define FStf_DISABLE 15
|
||||
@@ -2701,7 +2711,7 @@ class CFreeLst
|
||||
I64 start,size;
|
||||
};
|
||||
|
||||
#define NUM_DRVS 26
|
||||
#define DRVS_NUM 26
|
||||
|
||||
#define DRV_SIGNATURE_VAL 'DVSV'
|
||||
public class CDrv
|
||||
@@ -2743,18 +2753,23 @@ class CCacheBlk
|
||||
};
|
||||
|
||||
#help_index "File/System"
|
||||
#define DFT_ISO_FILENAME "::/Tmp/CDDVD.ISO"
|
||||
#define DFT_ISO_C_FILENAME "::/Tmp/CDDVD.ISO.C"
|
||||
|
||||
public class CBlkDevGlbls
|
||||
{
|
||||
CBlkDev *blkdevs;
|
||||
U8 *dft_iso_filename; //See $LK,"blkdev.dft_iso_filename",A="FF:::/Kernel/KEnd.HC,blkdev.dft_iso_filename"$
|
||||
U8 *dft_iso_filename; //$TX,"\"::/Tmp/CDDVD.ISO\"",D="DFT_ISO_FILENAME"$
|
||||
U8 *dft_iso_c_filename; //$TX,"\"::/Tmp/CDDVD.ISO.C\"",D="DFT_ISO_C_FILENAME"$
|
||||
U8 *tmp_filename;
|
||||
U8 *home_dir;
|
||||
CCacheBlk *cache_base,*cache_ctrl,**cache_hash_table;
|
||||
I64 cache_size,read_cnt,write_cnt;
|
||||
CDrv *drvs,*let_to_drv[32];
|
||||
I64 auto_mount_ide_cnt;
|
||||
I64 auto_mount_ide_cnt,
|
||||
ins_base0,ins_base1; //Install cd/dvd controller.
|
||||
U8 boot_drv_let,first_hd_drv_let,first_dvd_drv_let;
|
||||
Bool dvd_boot_is_good,pad[4];
|
||||
Bool dvd_boot_is_good,ins_unit,pad[3];
|
||||
};
|
||||
|
||||
#help_index "File/Internal"
|
||||
@@ -2765,7 +2780,7 @@ public class CDirContext
|
||||
};
|
||||
|
||||
#help_index "File/CFile"
|
||||
#define FFB_NEXT_BLK MAX_I64
|
||||
#define FFB_NEXT_BLK I64_MAX
|
||||
|
||||
#define FF_WRITE 1
|
||||
#define FF_NEW_FILE 2
|
||||
@@ -2893,7 +2908,7 @@ public class CDevGlbls
|
||||
I64 *idt;
|
||||
U8 *mem64_ptr;
|
||||
U8 *uncached_alias; //Alias of lowest 4Gig.
|
||||
U8 mp_apic_ids[MP_MAX_PROCESSORS];
|
||||
U8 mp_apic_ids[MP_PROCESSORS_NUM];
|
||||
CMemRange mem32_head;
|
||||
CPCIDev pci_head;
|
||||
};
|
||||
@@ -2942,7 +2957,7 @@ public class CDevGlbls
|
||||
#define YELLOW 14
|
||||
#define WHITE 15
|
||||
|
||||
#define NUM_COLORS 16
|
||||
#define COLORS_NUM 16
|
||||
#define COLOR_INVALID 16
|
||||
#define COLOR_MONO 0xFF
|
||||
|
||||
@@ -3034,8 +3049,9 @@ public class CMsStateGlbls
|
||||
public class CGridGlbls
|
||||
{
|
||||
Bool snap fmtstr "$$CB,\"Snap Grid\"$$\n",
|
||||
show fmtstr "$$CB,\"Show Grid\"$$\n";
|
||||
U8 pad[6];
|
||||
show fmtstr "$$CB,\"Show Grid\"$$\n",
|
||||
coord fmtstr "$$CB,\"Show Coordinates\"$$\n";
|
||||
U8 pad[5];
|
||||
F64 x fmtstr "$$DA-TRM,A=\"X Spacing:%6.3f\"$$\n",
|
||||
y fmtstr "$$DA-TRM,A=\"Y Spacing:%6.3f\"$$\n",
|
||||
z fmtstr "$$DA-TRM,A=\"Z Spacing:%6.3f\"$$\n",
|
||||
@@ -3215,13 +3231,13 @@ public class CTaskSettings
|
||||
U0 (*task_end_cb)();
|
||||
CTask *song_task,*animate_task;
|
||||
I64 scroll_x,scroll_y,scroll_z;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
U32 win_inhibit;
|
||||
U8 text_attr,title_src,
|
||||
border_attr,border_src,
|
||||
task_title[STR_LEN];
|
||||
Bool border,hide_cursor,highlight_cursor,scroll,autocomplete,pad[3];
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#help_index "Task"
|
||||
@@ -3284,7 +3300,7 @@ public class CTask //The Fs segment reg points to current CTask.
|
||||
{
|
||||
CTask *addr; //Self-addressed ptr
|
||||
U32 task_signature,win_inhibit;
|
||||
;#assert $$==offset(CTaskDying.wake_jiffy)
|
||||
#assert $$==offset(CTaskDying.wake_jiffy)
|
||||
I64 wake_jiffy;
|
||||
U32 task_flags,display_flags;
|
||||
|
||||
@@ -3361,7 +3377,7 @@ public class CTask //The Fs segment reg points to current CTask.
|
||||
CWinScroll horz_scroll,vert_scroll;
|
||||
|
||||
I64 user_data;
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
class CTSS
|
||||
@@ -3416,7 +3432,7 @@ public class CCPU //The Gs segment reg points to current CCPU.
|
||||
I64 kill_jiffy;
|
||||
CTSS *tss;
|
||||
I64 start_stk[16];
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#help_index "Memory/Page Tables"
|
||||
@@ -3570,7 +3586,7 @@ public class CTextGlbls
|
||||
//z-vals less than zero are in front of scrn and not drawn.
|
||||
//we want to shift all Z-vals into a drawable range.
|
||||
//GR_Z_ALL is set to half of the Z-range which is an I32.
|
||||
#define GR_Z_ALL (MAX_I32/2)
|
||||
#define GR_Z_ALL (I32_MAX/2)
|
||||
|
||||
#help_index "Graphics/Device Contexts"
|
||||
//Low 8 bits reserved for flags that go into saved bitmaps
|
||||
@@ -3615,7 +3631,7 @@ public class CDC
|
||||
height,
|
||||
flags;
|
||||
U0 end;
|
||||
CBGR48 palette[NUM_COLORS];
|
||||
CBGR48 palette[COLORS_NUM];
|
||||
|
||||
//public (Change directly)
|
||||
CColorROPU32 color,
|
||||
@@ -3665,7 +3681,7 @@ public class CDC
|
||||
//Set by $LK,"DCDepthBufAlloc",A="MN:DCDepthBufAlloc"$()
|
||||
I32 *depth_buf;
|
||||
I64 db_z; //private
|
||||
;#assert !($$&7) //(compiler lags one token)
|
||||
#assert !($$&7)
|
||||
};
|
||||
|
||||
#help_index "Devices"
|
||||
@@ -3692,7 +3708,7 @@ public class CDC
|
||||
#define VGAR_MAP_MASK 0x02
|
||||
|
||||
#help_index "Compression/Piece by Piece"
|
||||
#define ARC_MAX_BITS 12
|
||||
#define ARC_BITS_MAX 12
|
||||
|
||||
#define CT_NONE 1
|
||||
#define CT_7_BIT 2
|
||||
@@ -3718,8 +3734,8 @@ public class CArcCtrl
|
||||
saved_basecode,
|
||||
entry_used,
|
||||
last_ch;
|
||||
CArcEntry compress[1<<ARC_MAX_BITS],
|
||||
*hash[1<<ARC_MAX_BITS];
|
||||
CArcEntry compress[1<<ARC_BITS_MAX],
|
||||
*hash[1<<ARC_BITS_MAX];
|
||||
};
|
||||
|
||||
#help_index "Compression"
|
||||
@@ -3781,7 +3797,7 @@ class CKeyDevGlbls
|
||||
};
|
||||
|
||||
#help_index "Snd"
|
||||
#define ONA_REST MIN_I8
|
||||
#define ONA_REST I8_MIN
|
||||
class CSndData
|
||||
{
|
||||
CSndData *next,*last;
|
||||
@@ -3845,7 +3861,7 @@ public class CDbgGlbls
|
||||
// $LK,"In",A="MN:In"$("") StdIn for call to $LK,"BootHDIns",A="MN:BootHDIns"$().
|
||||
#define STD_DISTRO_DVD_CFG "TB\nScale2Mem(2048,0x40000)\nT \n\n\n\n"
|
||||
|
||||
#help_index "Misc/Registry"
|
||||
#help_index "Registry"
|
||||
//Registry sys_msg_flags. $LK,"RegOneTimePopUp",A="MN:RegOneTimePopUp"$()
|
||||
#define ARf_FLOODFILL 0
|
||||
#define ARf_CSPRITE_INS_CLIPBOARD 1
|
||||
@@ -3856,7 +3872,7 @@ public class CDbgGlbls
|
||||
#define ARf_MANAGE_SLIDER 6
|
||||
|
||||
#help_index "Misc/Progress Bars"
|
||||
#define NUM_PROGRESS_BARS 4
|
||||
#define PROGRESS_BARS_NUM 4
|
||||
#define PROGRESS_DESC_LEN (64-8-8)
|
||||
class CProgress
|
||||
{
|
||||
@@ -3892,7 +3908,7 @@ class CProgress
|
||||
#define VM_QEMU 3
|
||||
#define VM_VIRTUALBOX 4
|
||||
|
||||
#help_index "Misc/Install Registration"
|
||||
#help_index "Registry/Install Registration"
|
||||
public class CInsReg
|
||||
{
|
||||
Bool registered;
|
||||
|
||||
+3
-3
@@ -50,7 +50,7 @@ public _extern _CALL_IND I64 CallInd(
|
||||
|
||||
#help_index "Call/System Extern Num"
|
||||
public _extern SYS_EXTERN_TABLE /*argpop*/
|
||||
I64 (**ext)(...); //Array of fun ptrs. See $LK,"Extern Num Definitions",A="MN:EXT_NUM_ENTRIES"$
|
||||
I64 (**ext)(...); //Array of fun ptrs. See $LK,"Extern Num Definitions",A="MN:EXT_EXTS_NUM"$
|
||||
public _extern _CALLEXTNUM
|
||||
I64 CallExtNum(I64 num,...); //Call ext num with fixed number of args.
|
||||
|
||||
@@ -230,7 +230,7 @@ public _extern SYS_PROGRESS4_MAX I64 progress4_max; //Progress 4 max.
|
||||
public _extern SYS_PROGRESS4_T0 F64 progress4_t0; //Progress 4 start time.
|
||||
public _extern SYS_PROGRESS4_TF F64 progress4_tf; //Progress 4 end time.
|
||||
public _extern SYS_PROGRESSES
|
||||
CProgress sys_progresses[NUM_PROGRESS_BARS]; //All progress bars.
|
||||
CProgress sys_progresses[PROGRESS_BARS_NUM]; //All progress bars.
|
||||
|
||||
#help_index "MultiCore"
|
||||
#help_file "::/Doc/MultiCore"
|
||||
@@ -238,7 +238,7 @@ public _extern SYS_CPU_STRUCTS CCPU *cpu_structs; //$LK,"Gs",A="MN:Gs"$ points t
|
||||
public _extern SYS_MP_CNT I64 mp_cnt; //Count of cores
|
||||
_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[SEMA_NUM_SEMAS];
|
||||
_extern SYS_SEMAS CSema sys_semas[SEMA_SEMAS_NUM];
|
||||
|
||||
#help_index "MultiCore;Processor"
|
||||
public _intern IC_GS CCPU *Gs(); //GS points to current $LK,"CCPU",A="MN:CCPU"$.
|
||||
|
||||
+4
-3
@@ -38,6 +38,7 @@ char_bmp_zero_tab_cr_nl_cursor_dollar[16],
|
||||
char_bmp_macro[16], char_bmp_printable[16],
|
||||
char_bmp_displayable[16], char_bmp_safe_dollar[16],
|
||||
char_bmp_filename[16], char_bmp_non_eol[16];
|
||||
|
||||
#help_index "Char/Conversion"
|
||||
public extern U8 *Char2KeyName(I64 ch,Bool include_ctrl=TRUE);
|
||||
public extern I64 Char2ScanCode(I64 ch,I64 sc_flags=0);
|
||||
@@ -385,7 +386,7 @@ extern I64 ATAProbe(I64 base0,I64 base1,I64 unit);
|
||||
extern U0 ATAReadBlks(CBlkDev *bd,U8 *buf, I64 blk, I64 cnt);
|
||||
extern U0 ATAWriteBlks(CBlkDev *bd,U8 *buf, I64 blk, I64 cnt);
|
||||
public extern I64 AutoMountIDE();
|
||||
extern I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=MIN_I64,
|
||||
extern I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=I64_MIN,
|
||||
Bool whole_drv,Bool make_free);
|
||||
extern U0 DskCacheInit(I64 size_in_U8s);
|
||||
public extern U0 DskCacheInvalidate(CDrv *dv);
|
||||
@@ -610,8 +611,8 @@ public extern U0 ProgressBarsRst(U8 *path=NULL);
|
||||
#help_index "Mouse"
|
||||
#help_file "::/Doc/Mouse"
|
||||
public extern U0 GridInit();
|
||||
public extern U0 MsSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,
|
||||
I64 l=MAX_I64,I64 r=MAX_I64);
|
||||
public extern U0 MsSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,
|
||||
I64 l=I64_MAX,I64 r=I64_MAX);
|
||||
public extern CMsStateGlbls ms;
|
||||
public extern CGridGlbls ms_grid;
|
||||
public extern CMsHardStateGlbls ms_hard;
|
||||
|
||||
+13
-13
@@ -30,8 +30,8 @@ SYS_INIT_PAGE_TABLES::
|
||||
ADC EDX,0
|
||||
SHRD EAX,EDX
|
||||
SHR EDX,CL
|
||||
MOV [MEM_NUM_2MEG],EAX
|
||||
MOV [MEM_NUM_2MEG+4],EDX
|
||||
MOV [MEM_2MEG_NUM],EAX
|
||||
MOV [MEM_2MEG_NUM+4],EDX
|
||||
|
||||
//How many 1Gig pages?
|
||||
MOV CL,9
|
||||
@@ -39,8 +39,8 @@ SYS_INIT_PAGE_TABLES::
|
||||
ADC EDX,0
|
||||
SHRD EAX,EDX
|
||||
SHR EDX,CL
|
||||
MOV [MEM_NUM_1GIG],EAX
|
||||
MOV [MEM_NUM_1GIG+4],EDX
|
||||
MOV [MEM_1GIG_NUM],EAX
|
||||
MOV [MEM_1GIG_NUM+4],EDX
|
||||
|
||||
//How many 512Gig pages?
|
||||
MOV CL,9
|
||||
@@ -48,8 +48,8 @@ SYS_INIT_PAGE_TABLES::
|
||||
ADC EDX,0
|
||||
SHRD EAX,EDX
|
||||
SHR EDX,CL
|
||||
MOV [MEM_NUM_512GIG],EAX
|
||||
MOV [MEM_NUM_512GIG+4],EDX
|
||||
MOV [MEM_512GIG_NUM],EAX
|
||||
MOV [MEM_512GIG_NUM+4],EDX
|
||||
|
||||
//Set $LK,"CSysFixedArea",A="MN:CSysFixedArea"$ to zero
|
||||
MOV EDI,SYS_FIXED_AREA
|
||||
@@ -62,7 +62,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
BT U32 [MEM_PAGE_SIZE],30
|
||||
JC @@15
|
||||
//Find PML2 Size
|
||||
MOV EAX,U32 [MEM_NUM_2MEG]
|
||||
MOV EAX,U32 [MEM_2MEG_NUM]
|
||||
ADD EAX,0x1FF
|
||||
AND EAX,~0x1FF
|
||||
SHL EAX,3
|
||||
@@ -70,7 +70,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
|
||||
//Find PML3 Size
|
||||
@@15: MOV U32 [MEM_PML3],EDI
|
||||
MOV EAX,U32 [MEM_NUM_1GIG]
|
||||
MOV EAX,U32 [MEM_1GIG_NUM]
|
||||
ADD EAX,0x1FF
|
||||
AND EAX,~0x1FF
|
||||
SHL EAX,3
|
||||
@@ -78,7 +78,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
|
||||
//Find PML4 Size
|
||||
MOV U32 [MEM_PML4],EDI
|
||||
MOV EAX,U32 [MEM_NUM_512GIG]
|
||||
MOV EAX,U32 [MEM_512GIG_NUM]
|
||||
ADD EAX,0x1FF
|
||||
AND EAX,~0x1FF
|
||||
SHL EAX,3
|
||||
@@ -102,7 +102,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
MOV EAX,0x87 //bit 7 is page size (2Meg)
|
||||
XOR EDX,EDX
|
||||
MOV EDI,[MEM_PML2]
|
||||
MOV ECX,[MEM_NUM_2MEG]
|
||||
MOV ECX,[MEM_2MEG_NUM]
|
||||
@@20: MOV U32 [EDI],EAX
|
||||
ADD EDI,4
|
||||
MOV U32 [EDI],EDX
|
||||
@@ -115,7 +115,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
OR EAX,7
|
||||
XOR EDX,EDX
|
||||
MOV EDI,[MEM_PML3]
|
||||
MOV ECX,[MEM_NUM_1GIG]
|
||||
MOV ECX,[MEM_1GIG_NUM]
|
||||
@@25: MOV U32 [EDI],EAX
|
||||
ADD EDI,4
|
||||
MOV U32 [EDI],EDX
|
||||
@@ -129,7 +129,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
@@30: MOV EAX,0x87 //bit 7 is page size (1Gig)
|
||||
XOR EDX,EDX
|
||||
MOV EDI,[MEM_PML3]
|
||||
MOV ECX,[MEM_NUM_1GIG]
|
||||
MOV ECX,[MEM_1GIG_NUM]
|
||||
@@35: MOV U32 [EDI],EAX
|
||||
ADD EDI,4
|
||||
MOV U32 [EDI],EDX
|
||||
@@ -143,7 +143,7 @@ SYS_INIT_PAGE_TABLES::
|
||||
OR EAX,7
|
||||
XOR EDX,EDX
|
||||
MOV EDI,[MEM_PML4]
|
||||
MOV ECX,[MEM_NUM_512GIG]
|
||||
MOV ECX,[MEM_512GIG_NUM]
|
||||
@@45: MOV U32 [EDI],EAX
|
||||
ADD EDI,4
|
||||
MOV U32 [EDI],EDX
|
||||
|
||||
+5
-5
@@ -44,7 +44,7 @@ AP_32BIT_INIT:
|
||||
LOCK
|
||||
BTR U32 [SYS_MP_CNT_LOCK],0
|
||||
|
||||
CMP ESI,MP_MAX_PROCESSORS
|
||||
CMP ESI,MP_PROCESSORS_NUM
|
||||
JAE I32 _SYS_HLT
|
||||
|
||||
IMUL2 ESI,sizeof(CCPU)
|
||||
@@ -304,7 +304,7 @@ U0 Core0StartMP()
|
||||
JobQueDel(&c->seth_task->srv_ctrl.next_done);
|
||||
}
|
||||
}
|
||||
MemSet(&cpu_structs[1],0,sizeof(CCPU)*(MP_MAX_PROCESSORS-1));
|
||||
MemSet(&cpu_structs[1],0,sizeof(CCPU)*(MP_PROCESSORS_NUM-1));
|
||||
|
||||
//When you start-up other cores, they jump to an addr
|
||||
//specified by a byte vect number, $LK,"MPN_VECT",A="MN:MPN_VECT"$ which corresponds
|
||||
@@ -330,8 +330,8 @@ U0 Core0StartMP()
|
||||
LBts(&mp_cnt_lock,0); //Don't let more through
|
||||
my_mp_cnt=mp_cnt_initial;
|
||||
|
||||
if (my_mp_cnt>MP_MAX_PROCESSORS)
|
||||
my_mp_cnt=MP_MAX_PROCESSORS;
|
||||
if (my_mp_cnt>MP_PROCESSORS_NUM)
|
||||
my_mp_cnt=MP_PROCESSORS_NUM;
|
||||
|
||||
for (i=1;i<my_mp_cnt;i++) {
|
||||
StrPrint(buf,"Seth Task CPU%02X",i);
|
||||
@@ -363,7 +363,7 @@ U0 Core0Init()
|
||||
|
||||
//Must be in code heap because init code uses 32 bit addr of cpu_struct
|
||||
adam_task->gs=cpu_structs=
|
||||
CAlloc(sizeof(CCPU)*MP_MAX_PROCESSORS,Fs->code_heap);
|
||||
CAlloc(sizeof(CCPU)*MP_PROCESSORS_NUM,Fs->code_heap);
|
||||
CPUStructInit(0,cpu_structs,adam_task);
|
||||
asm {//RAX has GS
|
||||
IMPORT SET_GS_BASE;
|
||||
|
||||
@@ -3,7 +3,7 @@ U0 GridInit()
|
||||
ms_grid.x=ms_grid.y=ms_grid.z=8;
|
||||
ms_grid.x_offset=ms_grid.y_offset=ms_grid.z_offset=0;
|
||||
ms_grid.x_speed =ms_grid.y_speed =ms_grid.z_speed =1;
|
||||
ms_grid.show=ms_grid.snap=FALSE;
|
||||
ms_grid.show=ms_grid.snap=ms_grid.coord=FALSE;
|
||||
}
|
||||
|
||||
U0 MsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
@@ -39,13 +39,13 @@ U0 MsUpdate(I64 x,I64 y,I64 z,Bool l,Bool r)
|
||||
LBEqu(&kbd.scan_code,SCf_MS_R_DOWN,ms.rb);
|
||||
}
|
||||
|
||||
U0 MsSet(I64 x=MAX_I64,I64 y=MAX_I64,I64 z=MAX_I64,I64 l=MAX_I64,I64 r=MAX_I64)
|
||||
U0 MsSet(I64 x=I64_MAX,I64 y=I64_MAX,I64 z=I64_MAX,I64 l=I64_MAX,I64 r=I64_MAX)
|
||||
{//Note: Generates a message. See $LK,"MsSet",A="FF:::/Demo/Games/Zing.HC,MsSet"$().
|
||||
if (!(0<=x<GR_WIDTH))
|
||||
x=ms.pos.x;
|
||||
if (!(0<=y<GR_HEIGHT))
|
||||
y=ms.pos.y;
|
||||
if (z==MAX_I64)
|
||||
if (z==I64_MAX)
|
||||
z=ms.pos.z;
|
||||
|
||||
if (!(FALSE<=l<=TRUE))
|
||||
|
||||
Reference in new issue
Block a user