mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2025-03-14 12:05:07 +00:00
Add total memory report to MemBIOSRep
This commit is contained in:
parent
32363328e9
commit
b09ee0e580
8 changed files with 1854 additions and 1860 deletions
Binary file not shown.
Binary file not shown.
BIN
src/Kernel.BIN.C
BIN
src/Kernel.BIN.C
Binary file not shown.
|
@ -212,7 +212,6 @@ GET_IP: POP BX
|
|||
BTS U32 [SYS_RUN_LEVEL], RLf_VESA
|
||||
@@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.
|
||||
|
@ -226,10 +225,11 @@ GET_IP: POP BX
|
|||
@@12: MOV U16 [MEM_E801], AX
|
||||
MOV U16 [MEM_E801+2], BX
|
||||
|
||||
MOV CX,MEM_E820_ENTRIES_NUM - 1 //Leave one to terminate
|
||||
//Get E820 memory map.
|
||||
MOV CX , MEM_E820_ENTRIES_NUM - 1 //Leave one to terminate
|
||||
XOR EBX, EBX
|
||||
MOV AX, DS
|
||||
MOV ES, AX
|
||||
PUSH DS
|
||||
POP ES
|
||||
MOV DI , MEM_E820
|
||||
@@15: PUSH CX
|
||||
MOV EAX, 0xE820
|
||||
|
@ -245,7 +245,7 @@ GET_IP: POP BX
|
|||
POP CX
|
||||
LOOP @@15
|
||||
SUB SP , 2
|
||||
@@20: ADD SP, 2
|
||||
@@20: ADD SP , 2 //if called failed we want to nullify the PUSHed CX value.
|
||||
|
||||
//Find how much space to map, start with E801 limit.
|
||||
XOR EAX,EAX
|
||||
|
@ -261,7 +261,7 @@ GET_IP: POP BX
|
|||
JZ @@35
|
||||
MOV EBX, CMemE820.base [SI]
|
||||
MOV ECX, CMemE820.base+4[SI]
|
||||
ADD EBX,CMemE820.len[SI]
|
||||
ADD EBX, CMemE820.len [SI]
|
||||
ADC ECX, CMemE820.len+4 [SI]
|
||||
SUB EBX, EAX
|
||||
SBB ECX, EDX
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -334,6 +334,21 @@ public class CMathODE
|
|||
|
||||
#define MP_PROCESSORS_NUM 128
|
||||
|
||||
//Control register flag bits
|
||||
#define CR0f_MP 1 //Monitor coprocessor
|
||||
#define CR0f_EM 2 //Emulation of coprocessor
|
||||
#define CR0f_TS 3 //Task switched, some irrelevant x87 task management stuff
|
||||
#define CR0f_NE 5 //Numeric error
|
||||
#define CR0f_PG 31//Enable paging
|
||||
|
||||
#define CR4f_PAE 5 //Physical Address Extension, required by long mode
|
||||
#define CR4f_PGE 7 //Page-Global Enable
|
||||
#define CR4f_OSFXSR 9 //FXSAVE/FXRSTOR support enabled
|
||||
|
||||
#define CR4F_PAE (1<<CR4f_PAE)
|
||||
#define CR4F_PGE (1<<CR4f_PGE)
|
||||
#define CR4F_OSFXSR (1<<CR4f_OSFXSR)
|
||||
|
||||
#define SYS_START_CR0 0x0031
|
||||
|
||||
#define RFLAGf_CARRY 0
|
||||
|
@ -356,7 +371,7 @@ public class CMathODE
|
|||
#define RFLAGf_ID 21
|
||||
|
||||
#define RFLAGG_START 0x0000
|
||||
#define RFLAGG_NORMAL (1<<RFLAGf_INT)
|
||||
#define RFLAGG_NORMAL (1<<RFLAGf_INT)
|
||||
|
||||
//Global Descriptor Table
|
||||
class CGDTEntry
|
||||
|
@ -385,7 +400,7 @@ class CSysLimitBase
|
|||
};
|
||||
|
||||
#help_index "Memory/Info"
|
||||
#define MEM_E820_ENTRIES_NUM 48
|
||||
#define MEM_E820_ENTRIES_NUM 24
|
||||
#define MEM_E820t_USABLE 1
|
||||
#define MEM_E820t_RESERVED 2
|
||||
#define MEM_E820t_ACPI 3
|
||||
|
@ -584,20 +599,6 @@ class CKernel
|
|||
#define RLF_ONCE_USER (1<<RLf_ONCE_USER)
|
||||
|
||||
#help_index "Processor"
|
||||
//Control register flag bits
|
||||
#define CR0f_MP 1 //Monitor coprocessor
|
||||
#define CR0f_EM 2 //Emulation of coprocessor
|
||||
#define CR0f_TS 3 //Task switched, some irrelevant x87 task management stuff
|
||||
#define CR0f_NE 5 //Numeric error
|
||||
#define CR0f_PG 31//Enable paging
|
||||
|
||||
#define CR4f_PAE 5 //Physical Address Extension, required by long mode
|
||||
#define CR4f_PGE 7 //Page-Global Enable
|
||||
#define CR4f_OSFXSR 9 //FXSAVE/FXRSTOR support enabled
|
||||
|
||||
#define CR4F_PAE (1<<CR4f_PAE)
|
||||
#define CR4F_PGE (1<<CR4f_PGE)
|
||||
#define CR4F_OSFXSR (1<<CR4f_OSFXSR)
|
||||
|
||||
//Model specific regs.
|
||||
#define IA32F_SCE 0x001
|
||||
|
@ -1593,7 +1594,7 @@ class CWinMgrTimingGlobals
|
|||
};
|
||||
|
||||
#define WINMGR_FPS (30000.0/1001)
|
||||
#define WINMGR_PERIOD (1001/30000.0)
|
||||
#define WINMGR_PERIOD (1001/30000.0)
|
||||
|
||||
public class CWinMgrGlobals
|
||||
{
|
||||
|
|
Binary file not shown.
|
@ -225,10 +225,10 @@ public U0 MemBIOSRep()
|
|||
CMemRange *tmpmr;
|
||||
|
||||
"$$PURPLE$$Standard Addresses$$FG$$\n"
|
||||
"FEE00000-FEE00FFF See $$LK,\"APIC\",A=\"MN:LAPIC_BASE\"$$\n\n"
|
||||
"FEE00000-FEE00FFF See $LK,"APIC",A="MN:LAPIC_BASE"$\n\n"
|
||||
|
||||
"$$PURPLE$$VBE Linear Framebuffer$$FG$$\n"
|
||||
"%08X-%08X See $$LK,\"VBE Mode\",A=\"FF:::/Kernel/KernelA.HH,framebuffer\"$$\n", text.fb_alias,
|
||||
"%08X-%08X See $LK,"VBE Mode",A="FF:::/Kernel/KernelA.HH,framebuffer"$\n", text.fb_alias,
|
||||
text.fb_alias(U8 *) + text.buffer_size - 1;
|
||||
"\n$$PURPLE$$32 Bit Device Mem$$FG$$\n";
|
||||
while (LBts(&sys_semas[SEMA_DEV_MEM],0))
|
||||
|
@ -242,7 +242,7 @@ 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] * 1024 - 1;
|
||||
"0000000000000000-%016X\n", 0x100000 + m01[0] * 1024 - 1;
|
||||
"0000000001000000-%016X\n", SYS_16MEG_AREA_LIMIT + m01[1] * 64 * 1024 - 1;
|
||||
|
||||
if (m20->type)
|
||||
|
@ -273,6 +273,11 @@ public U0 MemBIOSRep()
|
|||
m20++;
|
||||
}
|
||||
}
|
||||
"\n$$PURPLE$$BIOS Total Memory Report$$FG$$: ";
|
||||
if (MemBIOSTotal < 1024 * 1024 * 1024)
|
||||
"%03d MiB\n", MemBIOSTotal / 1024 / 1024;
|
||||
else
|
||||
"%04d GiB\n", MemBIOSTotal / 1024 / 1024 / 1024;
|
||||
}
|
||||
|
||||
public U0 MemPageRep()
|
||||
|
|
Loading…
Reference in a new issue