MemBIOSTotal function renamed, rewritten, exported

MemRep tab spacing fixed
Added check for invalid results of BIOS call E801
AutoComplete shortcuts updated in Tips
This commit is contained in:
xmm15 2020-02-21 02:09:06 -06:00
parent 8723b39969
commit 32363328e9
16 changed files with 296 additions and 288 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -8,7 +8,7 @@ $WW,1$$FG,5$$TX+CX,"Tips"$$FG$
* See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a list of defined keys. Define your own keys in $LK,"MyPutKey",A="MN:MyPutKey"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
* $FG,2$<ALT-m>$FG$ maximizes a window. $FG,2$<ALT-SHIFT-w>$FG$ closes AutoComplete. $FG,2$<ALT-w>$FG$ brings back AutoComplete. $FG,2$<ALT-v>$FG$ vertically tiles windows. $FG,2$<ALT-h>$FG$ horizontally tiles windows. The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.CC"$. You can customize them.
* $FG,2$<ALT-m>$FG$ maximizes a window. $FG,2$<ALT-SHIFT-a>$FG$ closes AutoComplete. $FG,2$<ALT-a>$FG$ brings back AutoComplete. $FG,2$<ALT-v>$FG$ vertically tiles windows. $FG,2$<ALT-h>$FG$ horizontally tiles windows. The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.CC"$. You can customize them.
* If you make changes to ZenithOS files in your $FG,2$/Home$FG$ directory, generally you reboot to make them take effect. (You don't compile anything.) You should have two ZenithOS partitions on your hard drive because a syntax error in a start-up file will make the partition unbootable. Boot to the second partition or boot to a standard ZenithOS CD/DVD and use $LK,"Mount",A="MN:Mount"$() to mount your hard drive.
@ -93,7 +93,7 @@ $FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
* You can access the word under the cursor at $LK,"ac.cur_word",A="MN:CAutoCompleteGlobals"$.
* You can reactivate $FG,2$AutoComplete$FG$ after closing it by pressing $FG,2$<CTRL-Fun Key>$FG$ or $FG,2$<ALT-w>$FG$ if you have it defined.
* You can reactivate $FG,2$AutoComplete$FG$ after closing it by pressing $FG,2$<CTRL-Fun Key>$FG$ or $FG,2$<ALT-a>$FG$.
* $FG,2$<CTRL-SHIFT-T>$FG$ to toggle to/from plain text just the $LK,"CDoc",A="MN:CDoc"$ cmd under the cursor. See $LK,"::/Demo/DolDoc/TextDemo.CC"$.

Binary file not shown.

View file

@ -11,7 +11,7 @@ import Bool DocUnlock(CDoc *doc);
import Bool Ed(U8 *link_st,I64 edf_dof_flags=0);
extern U0 ZenithErr(U8 *format,...);
extern U0 ZenithLog(U8 *format,...);
extern I64 BIOSTotalMem();
extern I64 MemBIOSTotal();
extern I64 BlkDevAdd(CBlkDev *bd,I64 prt_num=I64_MIN,
Bool whole_drive,Bool make_free);
extern CBlkDev *BlkDevCheck(CBlkDev *bd,Bool except=TRUE);

View file

@ -149,7 +149,7 @@ U0 KMain()
sys_os_version,sys_compile_time,sys_compile_time;
TimerInit;
if (BIOSTotalMem<ToI64(0.95*MEM_MIN_MEG*0x100000))
if (MemBIOSTotal < ToI64 (0.95*MEM_MIN_MEG*0x100000) )
RawPrint(4000,"!!! Requires $TX,"512Meg",D="DD_MEM_MIN_MEG"$ of RAM Memory !!!");
IntsInit;

View file

@ -27,7 +27,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_E820_ENTRIES_NUM*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;
@ -213,12 +213,20 @@ GET_IP: POP BX
@@10:
//Get mem maps.
//Get E801 memory map.
//Output: AX = Memory between 1MiB and 16MiB in KiB (max 0x3C00 == 15 MiB)
// BX = Memory after 16MiB until first memory hole in 64KiB blocks.
XOR CX, CX
XOR DX, DX
MOV AX, 0xE801
INT 0x15
MOV U16 [MEM_E801],CX
MOV U16 [MEM_E801+2],DX
JCXZ @@12 //if CX and DX are zero, use AX and BX instead.
MOV AX, CX
MOV BX, DX
@@12: MOV U16 [MEM_E801], AX
MOV U16 [MEM_E801+2], BX
MOV CX,MEM_E820_ENTRIES_NUM-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

File diff suppressed because it is too large Load diff

View file

@ -555,6 +555,9 @@ public extern U64 RandU64();
public extern I64 RoundI64(I64 num,I64 to);
public extern I64 Seed(I64 seed=0,CTask *task=NULL);
#help_index "Memory/Info"
public extern I64 MemBIOSTotal();
#help_index "Memory/Zenith Heap"
public extern U8 *ZCAlloc(I64 size);
public extern U8 *ZMAlloc(I64 size);

View file

@ -32,7 +32,7 @@ U0 BlkPoolsInit()
CMemE820 *m20=MEM_E820;
Bool first=TRUE;
total=BIOSTotalMem;
total=MemBIOSTotal;
if (total<=0x80000000)
code_heap_limit=total;

View file

@ -148,7 +148,7 @@ U0 UncachedAliasAlloc() //Make uncached alias for 4 lowest Gig.
} while (a-dev.uncached_alias<1<<32);
}
I64 BIOSTotalMem()
I64 MemBIOSTotal()
{//Returns max of either E801 or E820 mem map.
I64 total01 = 0x100000, total20 = 0;
U16 *mem01 = MEM_E801;
@ -171,7 +171,7 @@ I64 BIOSTotalMem()
I64 Scale2Mem(I64 min,I64 max,I64 limit=2*1024*1024*1024)
{//Helps pick DiskCache and RAMDisk sizes.
//Can be used in $LK,"BootHDIns",A="MN:BootHDIns"$() config scripts.
//Can be used in $LK,"BootHDIns",A="MN:BootHDIns"$() config scripts.
I64 i;
if (sys_data_bp)
i=sys_data_bp->alloced_u8s;

Binary file not shown.

View file

@ -242,8 +242,8 @@ public U0 MemBIOSRep()
LBtr(&sys_semas[SEMA_DEV_MEM],0);
"\n$$PURPLE$$BIOS Memory Report 15:E801$$FG$$\n"
"0000000000000000-%016X\n", 0x100000 + m01[0] << 10 - 1;
"0000000001000000-%016X\n", SYS_16MEG_AREA_LIMIT + m01[1] << 16 - 1;
"0000000000000000-%016X\n", 0x100000 + m01[0] * 1024 - 1;
"0000000001000000-%016X\n", SYS_16MEG_AREA_LIMIT + m01[1] * 64 * 1024 - 1;
if (m20->type)
{
@ -269,7 +269,7 @@ public U0 MemBIOSRep()
case MEM_E820t_PERM_MEM:
"Perm memory:";
}
"%016X-%016X$$FG$$\n", m20->base, m20->base + m20->len - 1;
"%016X-%016X$$FG$$\n", m20->base, m20->base + m20->len - 1;
m20++;
}
}

View file

@ -111,11 +111,11 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
"Stack\t\t:$$RED$$$$BK,1$$Overflow$$BK,0$$$$FG$$/%010X\n",j;
"HashTable\t:%010X\n",HashTableSize2(task->hash_table);
"FPU\t\t:%010X\n",MSize2(task->fpu_mmx);
"DirCur\t:%010X\n",MSize2(task->cur_dir);
"FPU\t\t\t:%010X\n",MSize2(task->fpu_mmx);
"DirCur\t\t:%010X\n",MSize2(task->cur_dir);
if (pdoc=DocPut(task))
"PutDoc\t:%010X\n",DocSize(pdoc);
"PutDoc\t\t:%010X\n",DocSize(pdoc);
if ((ddoc=DocDisplay(task)) && pdoc!=ddoc)
"DisplayDoc\t:%010X\n",DocSize(ddoc);
if (bdoc=DocBorder(task))
@ -161,26 +161,26 @@ Bool MemRepTask(CTask *task,Bool override_validate=FALSE)
m+=MSize2(task1->code_heap);
}
"TaskStructs\t:%010X\n",j;
"TSSes\t:%010X\n",k;
"TSSes\t\t:%010X\n",k;
"HeapCtrls\t:%010X\n",m;
if (n)
"TaskQueues\t:%010X\n",n;
"BlkDevs\t:%010X\n",BlkDevsSize;
"Drives\t:%010X\n",DrivesSize;
"BlkDevs\t\t:%010X\n",BlkDevsSize;
"Drives\t\t:%010X\n",DrivesSize;
if (blkdev.cache_base)
"DiskCache\t:%010X\n",MSize2(blkdev.cache_base)+MSize2(blkdev.cache_hash_table)+ MSize2(blkdev.cache_ctrl);
"Clip\t:%010X\n",DocSize(sys_clip_doc);
"Clip\t\t:%010X\n",DocSize(sys_clip_doc);
"AutoComplete:%010X\n",CallExtStr("AutoCompleteSize");
"text.font\t:%010X\n", MSize2(text.font);
"text.font\t\t:%010X\n", MSize2(text.font);
"text.raw_screen\t:%010X\n", MSize2(text.raw_screen);
"gr.to_8_bits\t:%010X\n",MSize2(gr.to_8_bits);
"gr.to_8_colors\t:%010X\n",MSize2(gr.to_8_colors);
"gr.text_base\t:%010X\n",MSize2(gr.text_base);
"gr.screen_cache\t:%010X\n",MSize2(gr.screen_cache);
"gr.win_z_buf\t:%010X\n",MSize2(gr.win_z_buf)+ MSize2(gr.win_uncovered_bitmap);
"gr.dc\t\t:%010X\n",DCSize(gr.dc);
"gr.dc1\t\t:%010X\n",DCSize(gr.dc1);
"gr.dc2\t\t:%010X\n",DCSize(gr.dc2);
"gr.dc\t\t\t:%010X\n",DCSize(gr.dc);
"gr.dc1\t\t\t:%010X\n",DCSize(gr.dc1);
"gr.dc2\t\t\t:%010X\n",DCSize(gr.dc2);
"gr.dc_cache\t\t:%010X\n",DCSize(gr.dc_cache);
"gr.screen_image\t:%010X\n",DCSize(gr.screen_image);
"gr.zoomed_dc\t:%010X\n",DCSize(gr.zoomed_dc);
@ -197,22 +197,19 @@ public U0 MemRep()
CBinFile *bfh=mem_boot_base-sizeof(CBinFile);
bfh(I64)+=bfh->file_size-1;
"$$BLACK$$Low Memory\t:0000100000$$FG$$\n$$ID,2$$";
"Kernel\t:%010X-%010X\n",mem_boot_base-sizeof(CBinFile),bfh;
"$$BLACK$$Low Memory\t:00100000$$FG$$\n$$ID,2$$";
"Kernel\t:%08X-%08X\n",mem_boot_base-sizeof(CBinFile),bfh;
"$$ID,-2$$$$BLACK$$HighMemory\t:0000100000-%010X$$FG$$\n",
mem_heap_limit;
"$LK,"SYS_FIXED_AREA",A="MN:CSysFixedArea"$\t:%010X-%010X\n",
SYS_FIXED_AREA,SYS_FIXED_AREA+sizeof(CSysFixedArea)-1;
"$$ID,-2$$$$BLACK$$HighMemory\t:00100000-%08X$$FG$$\n",mem_heap_limit;
"$LK,"SYS_FIXED_AREA",A="MN:CSysFixedArea"$\t:%08X-%08X\n",SYS_FIXED_AREA,SYS_FIXED_AREA+sizeof(CSysFixedArea)-1;
if (sys_data_bp) {
"$$BLACK$$Code Heap\t:%010X/%010X$$FG$$\n",
sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
"$$BLACK$$Data Heap\t:%010X/%010X$$FG$$\n",
sys_data_bp->used_u8s,sys_data_bp->alloced_u8s;
"$LK,"VBE framebuffer",A="FF:::/Kernel/KernelA.HH,framebuffer"$\t:%08X-%08X\n", text.fb_alias, text.fb_alias(U8 *) + text.buffer_size - 1;
if (sys_data_bp)
{
"$$BLACK$$Code Heap\t:%010X/%010X$$FG$$\n",sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
"$$BLACK$$Data Heap\t:%010X/%010X$$FG$$\n", sys_data_bp->used_u8s,sys_data_bp->alloced_u8s;
} else
"$$BLACK$$Code/Data Heap\t:%010X/%010X$$FG$$\n",
sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
"$$BLACK$$Code/Data Heap\t:%08X/%08X$$FG$$\n",sys_code_bp->used_u8s,sys_code_bp->alloced_u8s;
for (i=0;i<mp_count;i++) {
c=&cpu_structs[i];