Remove text.vga_alias and VGAM_GRAPHICS.

This commit is contained in:
TomAwezome 2022-10-26 18:35:52 -04:00
parent d8444770b2
commit 1d74c8116e
5 changed files with 10 additions and 20 deletions

View file

@ -1,7 +1,7 @@
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$ $WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
$IV,1$----10/25/22 17:56:27----$IV,0$ $IV,1$----10/26/22 18:30:33----$IV,0$
* Raised version number to 2.00. * Raised version number to 2.00.
* Updated the $LK,"Charter",A="FI:::/Doc/Charter.DD"$ to allow non-Public-Domain MBR/UEFI bootloaders, as long as the Public Domain ZealOS HDD/DVD Boot Loaders are included, offered, and functional. The Charter still upholds that all operating system code must still be 100% public domain. Updated $LK+PU,"Credits",A="FI:::/Doc/Credits.DD"$, $LK+PU,"FAQ",A="FI:::/Doc/FAQ.DD"$, $LK+PU,"Features.DD",A="FI:::/Doc/Features.DD"$. * Updated the $LK,"Charter",A="FI:::/Doc/Charter.DD"$ to allow non-Public-Domain MBR/UEFI bootloaders, as long as the Public Domain ZealOS HDD/DVD Boot Loaders are included, offered, and functional. The Charter still upholds that all operating system code must still be 100% public domain. Updated $LK+PU,"Credits",A="FI:::/Doc/Credits.DD"$, $LK+PU,"FAQ",A="FI:::/Doc/FAQ.DD"$, $LK+PU,"Features.DD",A="FI:::/Doc/Features.DD"$, $LK+PU,"Welcome.DD",A="FI:::/Doc/Welcome.DD"$.
* Added 128-bit signature to $LK+PU,"KStart32",A="FF:::/Kernel/KStart32.ZC,JMP @@02"$ to allow for booting the ZealOS Kernel.ZXE from 32-bit mode via a prekernel booted from any other bootloader. The signature is jumped over with JMP if booted from the Public Domain ZealOS Boot Loaders to KStart16 to KStart32. * Added 128-bit signature to $LK+PU,"KStart32",A="FF:::/Kernel/KStart32.ZC,JMP @@02"$ to allow for booting the ZealOS Kernel.ZXE from 32-bit mode via a prekernel booted from any other bootloader. The signature is jumped over with JMP if booted from the Public Domain ZealOS Boot Loaders to KStart16 to KStart32.
* Created external Public Domain "ZealBooter" prekernel written in C, for use with booting Kernel.ZXE from other bootloaders, primarily targeting Limine. ZealBooter compiles to an ELF file that Limine boots into and passes boot-time information to, which ZealBooter then uses to boot into and pass information to the Kernel.ZXE kernel header. * Created external Public Domain "ZealBooter" prekernel written in C, for use with booting Kernel.ZXE from other bootloaders, primarily targeting Limine. ZealBooter compiles to an ELF file that Limine boots into and passes boot-time information to, which ZealBooter then uses to boot into and pass information to the Kernel.ZXE kernel header.
* Implemented Limine bootloader install prompt to $LK+PU,"OSInstall",A="FI:::/Misc/OSInstall.ZC"$. Created $LK+PU,"LimineCFGMake and LimineMHDIns",A="FI:::/System/Boot/LimineMHDIns.ZC"$ to allow for installing Limine to MBR, and for generating the Limine.CFG file required. * Implemented Limine bootloader install prompt to $LK+PU,"OSInstall",A="FI:::/Misc/OSInstall.ZC"$. Created $LK+PU,"LimineCFGMake and LimineMHDIns",A="FI:::/System/Boot/LimineMHDIns.ZC"$ to allow for installing Limine to MBR, and for generating the Limine.CFG file required.
@ -26,6 +26,7 @@ $IV,1$----10/25/22 17:56:27----$IV,0$
* Replace SYS_FONT_PTR VGA ROM 16-bit mode aux font retrieval with $LK+PU,"FontAux",A="FI:::/Kernel/FontAux.ZC"$. * Replace SYS_FONT_PTR VGA ROM 16-bit mode aux font retrieval with $LK+PU,"FontAux",A="FI:::/Kernel/FontAux.ZC"$.
* Lowered $LK+PU,"PTR_STARS_NUM",A="MN:PTR_STARS_NUM"$ from 4 to 3. * Lowered $LK+PU,"PTR_STARS_NUM",A="MN:PTR_STARS_NUM"$ from 4 to 3.
* Moved $LK+PU,"PCILookUpSingle",A="MN:PCILookUpSingle"$, $LK+PU,"PCILookUpDevs",A="MN:PCILookUpDevs"$, $LK+PU,"PCIDevFind",A="MN:PCIDevFind"$, and $LK+PU,"PCIRep",A="MN:PCIRep"$ out of System/DevInfo.ZC to new file $LK+PU,"System/Utils/PCIRep.ZC",A="FI:::/System/Utils/PCIRep.ZC"$. Added including this file to $LK+PU,"MakeUtils",A="FF:::/System/Utils/MakeUtils.ZC,PCIRep"$. * Moved $LK+PU,"PCILookUpSingle",A="MN:PCILookUpSingle"$, $LK+PU,"PCILookUpDevs",A="MN:PCILookUpDevs"$, $LK+PU,"PCIDevFind",A="MN:PCIDevFind"$, and $LK+PU,"PCIRep",A="MN:PCIRep"$ out of System/DevInfo.ZC to new file $LK+PU,"System/Utils/PCIRep.ZC",A="FI:::/System/Utils/PCIRep.ZC"$. Added including this file to $LK+PU,"MakeUtils",A="FF:::/System/Utils/MakeUtils.ZC,PCIRep"$.
* Removed VGAM_GRAPHICS, text.vga_alias, and all code/documentation referencing them or legacy VGA graphics. MiniGrLib now needs a complete rewrite.
$IV,1$----04/16/22 20:24:18----$IV,0$ $IV,1$----04/16/22 20:24:18----$IV,0$
* Inverted $LK+PU,"DocBorderNew",A="MN:DocBorderNew"$ and $LK+PU,"DocEd",A="MN:DocEd"$ bottom-right window text, adjusted DolDoc tag placement to make solid, changed Ed callbacks ($LK+PU,"EdOverStrikeCB",A="MN:EdOverStrikeCB"$, $LK+PU,"EdAutoSaveCB",A="MN:EdAutoSaveCB"$, $LK+PU,"EdFilterCB",A="MN:EdFilterCB"$, $LK+PU,"EdDollarCB",A="MN:EdDollarCB"$, $LK+PU,"EdMoreCB",A="MN:EdMoreCB"$) to return ' ' SPACE character(s) for disabled flags now since invert renders it solid foreground color, appended ' ' SPACE character at $LK+PU,"EdDollarTypeCB",A="FF:::/System/DolDoc/DocEd.ZC,\"%-3ts \""$ to pad. * Inverted $LK+PU,"DocBorderNew",A="MN:DocBorderNew"$ and $LK+PU,"DocEd",A="MN:DocEd"$ bottom-right window text, adjusted DolDoc tag placement to make solid, changed Ed callbacks ($LK+PU,"EdOverStrikeCB",A="MN:EdOverStrikeCB"$, $LK+PU,"EdAutoSaveCB",A="MN:EdAutoSaveCB"$, $LK+PU,"EdFilterCB",A="MN:EdFilterCB"$, $LK+PU,"EdDollarCB",A="MN:EdDollarCB"$, $LK+PU,"EdMoreCB",A="MN:EdMoreCB"$) to return ' ' SPACE character(s) for disabled flags now since invert renders it solid foreground color, appended ' ' SPACE character at $LK+PU,"EdDollarTypeCB",A="FF:::/System/DolDoc/DocEd.ZC,\"%-3ts \""$ to pad.

View file

@ -8,7 +8,7 @@ You can create new, independent heaps using $LK,"HeapCtrlInit",A="MN:HeapCtrlIni
Memory alloced by a task will be freed when the task is killed. The $LK,"System Task",A="FF:::/Doc/Glossary.DD,System Task"$ is a task that never dies. Its memory is like kernel memory in other operating systems. See $LK,"SysCAlloc",A="MN:SysCAlloc"$(), $LK,"SysMAlloc",A="MN:SysMAlloc"$(), $LK,"SysMAllocIdent",A="MN:SysMAllocIdent"$() and $LK,"SysStrNew",A="MN:SysStrNew"$(). Memory alloced by a task will be freed when the task is killed. The $LK,"System Task",A="FF:::/Doc/Glossary.DD,System Task"$ is a task that never dies. Its memory is like kernel memory in other operating systems. See $LK,"SysCAlloc",A="MN:SysCAlloc"$(), $LK,"SysMAlloc",A="MN:SysMAlloc"$(), $LK,"SysMAllocIdent",A="MN:SysMAllocIdent"$() and $LK,"SysStrNew",A="MN:SysStrNew"$().
All of the regular page tables are marked, "cached". When accessing hardware, however, you need uncached page table. The lowest 4Gig addresses have an alias to access hardware located toward the top of mapped space, $FG,2$0x$TX,"0100000000",D="DD_UNCACHED_ALIAS"$$FG$. See $LK,"dev.uncached_alias",A="FF:::/Kernel/MultiProc.ZC,dev.uncached_alias"$. All of the regular page tables are marked, "cached". When accessing hardware, however, you need uncached page table. The lowest 4Gig addresses have an alias to access hardware located toward the top of mapped space, $FG,2$0x$TX,"0124000000",D="DD_UNCACHED_ALIAS"$$FG$. See $LK,"dev.uncached_alias",A="FF:::/Kernel/MultiProc.ZC,dev.uncached_alias"$.
During an extended powered-on session of ZealOS, in theory, memory will become fragmented, requiring a reboot. During an extended powered-on session of ZealOS, in theory, memory will become fragmented, requiring a reboot.
@ -17,7 +17,7 @@ See $LK,"MemRep",A="MN:MemRep"$() and $LK,"::/Demo/MemDemo.ZC"$.
$FG,5$$TX+CX,"Single System-wide Memory Map"$ $FG,5$$TX+CX,"Single System-wide Memory Map"$
$FG,2$ 0x00$TX,"00007C00",D="DD_KERNEL"$- 0x00$TX,"0003813F",D="DD_KERNEL_END"$$FG$ $FG,2$ 0x00$TX,"0003F000",D="DD_KERNEL"$- 0x00$TX,"000712CF",D="DD_KERNEL_END"$$FG$
$ID,2$Kernel module, placed here by the boot-loader, $LK,"BOOT_RAM_BASE",A="MN:BOOT_RAM_BASE"$. $ID,2$Kernel module, placed here by the boot-loader, $LK,"BOOT_RAM_BASE",A="MN:BOOT_RAM_BASE"$.
$ID,-2$ $ID,-2$
$FG,2$ 0x00$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$- 0x00$TX,"00096FFF",D="DD_BOOT_HIGH_LOC_DVD_END"$$FG$ $FG,2$ 0x00$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$- 0x00$TX,"00096FFF",D="DD_BOOT_HIGH_LOC_DVD_END"$$FG$
@ -25,21 +25,20 @@ $ID,2$$FG$Boot block relocated here before loading the Kernel module, $LK,"BootD
$ID,-2$ $ID,-2$
$FG,2$ 0x00$TX,"00097000",D="DD_MP_VECT"$- 0x00$TX,"0009703B",D="DD_MP_VECT_END"$$FG$ Multicore start-up vect code, $LK,"MPN_VECT",A="MN:MPN_VECT"$. $FG,2$ 0x00$TX,"00097000",D="DD_MP_VECT"$- 0x00$TX,"0009703B",D="DD_MP_VECT_END"$$FG$ Multicore start-up vect code, $LK,"MPN_VECT",A="MN:MPN_VECT"$.
$FG,2$~0x000009F000- 0x000009FFFF$FG$ Extended BIOS data area. $FG,2$~0x000009F000- 0x000009FFFF$FG$ Extended BIOS data area.
$FG,2$ 0x00000A0000- 0x00000BFFFF$FG$ VGA graphics mem with alias at $LK,"text",A="MN:text"$.vga_alias.
$FG,2$ 0x00$TX,"00100000",D="DD_SYS_FIXED_AREA_BASE"$- 0x00$TX,"00102FFF",D="DD_SYS_FIXED_AREA_END"$$FG$ $LK,"CSysFixedArea",A="MN:CSysFixedArea"$ for misc. $FG,2$ 0x00$TX,"00100000",D="DD_SYS_FIXED_AREA_BASE"$- 0x00$TX,"00102FFF",D="DD_SYS_FIXED_AREA_END"$$FG$ $LK,"CSysFixedArea",A="MN:CSysFixedArea"$ for misc.
$FG,2$ 0x00$TX,"0010D000",D="DD_MEM_HEAP_BASE"$- 0x00$TX,"33BFFFFF",D="DD_MEM_HEAP_LIMIT"$$FG$ Code Heap mem. $FG,2$ 0x00$TX,"0010E000",D="DD_MEM_HEAP_BASE"$- 0x00$TX,"3FFE37FF",D="DD_MEM_HEAP_LIMIT"$$FG$ Code Heap mem.
$FG,2$ 0x00E0000000- 0x00FFFFFFFF$FG$ $FG,2$ 0x00E0000000- 0x00FFFFFFFF$FG$
$ID,2$32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, since some PCs already have devices at 0xF0000000. PCI devices are supported, so $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() flaws could become an issue. $ID,2$32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, since some PCs already have devices at 0xF0000000. PCI devices are supported, so $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() flaws could become an issue.
$ID,-2$ $ID,-2$
$FG,2$ 0x0080000000-~0x00DFFFFFFF$FG$ $FG,2$ 0x0080000000-~0x00DFFFFFFF$FG$
$FG,2$ 0x0100000000-~0x$TX,"00FFFFFFFF",D="DD_PHYSICAL_SPACE_END"$$FG$ $FG,2$ 0x0100000000-~0x$TX,"0123FFFFFF",D="DD_PHYSICAL_SPACE_END"$$FG$
$ID,2$Data Heap mem. (The physical memory that exists in this range is data heap.) $ID,2$Data Heap mem. (The physical memory that exists in this range is data heap.)
$ID,-2$ $ID,-2$
$FG,2$ 0x$TX,"0100000000",D="DD_UNCACHED_ALIAS"$- 0x$TX,"01FFFFFFFF",D="DD_MAPPED_SPACE_END"$$FG$ $FG,2$ 0x$TX,"0124000000",D="DD_UNCACHED_ALIAS"$- 0x$TX,"0223FFFFFF",D="DD_MAPPED_SPACE_END"$$FG$
$ID,2$Uncached alias of first 4Gig. (For 32-bit device access.) $ID,2$Uncached alias of first 4Gig. (For 32-bit device access.)
$ID,-2$ $ID,-2$
$FG,2$ - 0x$TX,"01FFFFFFFF",D="DD_MAPPED_SPACE_END"$$FG$ $FG,2$ - 0x$TX,"0223FFFFFF",D="DD_MAPPED_SPACE_END"$$FG$
$ID,2$64-bit devices are alloced with $LK,"Mem64DevAlloc",A="MN:Mem64DevAlloc"$() counting backward$WW,0$. $ID,2$64-bit devices are alloced with $LK,"Mem64DevAlloc",A="MN:Mem64DevAlloc"$() counting backward$WW,0$.
$ID,-2$ $ID,-2$
@ -55,7 +54,7 @@ In 2003, Terry Davis wanted to make a no-paging ring-0-only 64-bit operating sys
Terry needed VGA A0000-BFFFF memory to be write-through and 0xE0000000-0xFFFFFFFF to be uncached for various devices. All 64-bit computers allow stopping address translation at 2Meg page size, not using 4K. He wanted to use 2Meg for everything because it's faster, with one less level of page tables. He had to make A0000-BFFFF write-through, though, so he could not use 2Meg size on the lowest page. He did the lowest 2Meg area as 4K pages. He also unmapped the first 4K to cause a fault when dereferencing NULL. Terry needed VGA A0000-BFFFF memory to be write-through and 0xE0000000-0xFFFFFFFF to be uncached for various devices. All 64-bit computers allow stopping address translation at 2Meg page size, not using 4K. He wanted to use 2Meg for everything because it's faster, with one less level of page tables. He had to make A0000-BFFFF write-through, though, so he could not use 2Meg size on the lowest page. He did the lowest 2Meg area as 4K pages. He also unmapped the first 4K to cause a fault when dereferencing NULL.
In 2016, Terry came-up with an alternate idea. He double mapped the lowest memory with an alias that was uncached. Accessing the lowest 2Meg area directly was cached but the alias he created up at the top of address space was uncached. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Unfortunately, he could no longer boast of the simplicity of identity mapping everything. Since many of the users are familiar with A0000-BFFFF, it is actually pretty seriously unfortunate that they cannot use the easy-to-understand numbers of A0000-BFFFF, but must access the relocated alias location. See $LK,"text.vga_alias",A="FF:::/Kernel/KMain.ZC,text.vga_alias"$. We also no longer cause a fault when dereferencing NULL. In 2016, Terry came-up with an alternate idea. He double mapped the lowest memory with an alias that was uncached. Accessing the lowest 2Meg area directly was cached but the alias he created up at the top of address space was uncached. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Unfortunately, he could no longer boast of the simplicity of identity mapping everything. We also no longer cause a fault when dereferencing NULL.
Then, Terry switched to 1Gig page sizes. For the lowest 4Gig, he set-up an alias up at the top of address space. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Not all computers support 1Gig page tables, however, so he also supported 2Meg. Then, Terry switched to 1Gig page sizes. For the lowest 4Gig, he set-up an alias up at the top of address space. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Not all computers support 1Gig page tables, however, so he also supported 2Meg.

View file

@ -2,16 +2,12 @@ Bool CheckPtr(U8 *ptr)
{//Check if address is valid pointer. {//Check if address is valid pointer.
if (mem_heap_base <= ptr <= mem_mapped_space) if (mem_heap_base <= ptr <= mem_mapped_space)
return *MemPageTable(ptr) & 1; return *MemPageTable(ptr) & 1;
else
return mem_boot_base < ptr < VGAM_GRAPHICS;
} }
Bool CheckCodePtr(U8 *ptr) Bool CheckCodePtr(U8 *ptr)
{//Check if address is valid code address. {//Check if address is valid code address.
if (mem_heap_base <= ptr <= mem_heap_limit) if (mem_heap_base <= ptr <= mem_heap_limit)
return *MemPageTable(ptr) & 1; return *MemPageTable(ptr) & 1;
else
return mem_boot_base < ptr < VGAM_GRAPHICS;
} }
Bool CheckOnStack(U8 *ptr, CTask *task=NULL) Bool CheckOnStack(U8 *ptr, CTask *task=NULL)

View file

@ -97,7 +97,6 @@ U0 SysGrInit()
text.fb_alias = sys_framebuffer_addr; text.fb_alias = sys_framebuffer_addr;
MemSetU32(text.fb_alias, BLACK32, text.screen_size); MemSetU32(text.fb_alias, BLACK32, text.screen_size);
text.vga_alias = CAlloc(text.rows * text.cols * 8);
} }
U0 TimerInit() U0 TimerInit()

View file

@ -4281,7 +4281,6 @@ public class CTextGlobals
U32 *raw_screen, *fb_alias; U32 *raw_screen, *fb_alias;
I64 rows, cols; //Use TEXT_ROWS,TEXT_COLS I64 rows, cols; //Use TEXT_ROWS,TEXT_COLS
U64 *font, *aux_font, screen_size, buffer_size; U64 *font, *aux_font, screen_size, buffer_size;
U8 *vga_alias;
U8 border_chars[16]; U8 border_chars[16];
Bool is_fb_busy; Bool is_fb_busy;
}; };
@ -4390,10 +4389,6 @@ public class CDC
#assert !($$ & 7) #assert !($$ & 7)
}; };
#help_index "Devices"
//VGA Memory
#define VGAM_GRAPHICS 0xA0000
#define "Char/Input;StdIn" #define "Char/Input;StdIn"
//StrGet flags //StrGet flags
#define SGF_SHIFT_ESC_EXIT 1 //This kills task on <SHIFT-ESC> #define SGF_SHIFT_ESC_EXIT 1 //This kills task on <SHIFT-ESC>