Change .BIN format to .ZXE (Zeal Executable).

Remove .C suffix on non-executable binary files.
This commit is contained in:
TomAwezome 2022-01-28 03:05:21 -05:00
parent c01db2d14f
commit dd21cff146
46 changed files with 186 additions and 190 deletions

3
.gitignore vendored
View file

@ -1,4 +1,5 @@
*.BIN*
*.BIN
*.ZXE
*.MAP
src/Boot/
docs/Boot/

Binary file not shown.

View file

@ -92,7 +92,7 @@ U8 *friendly_imgs[4] = {$IB,"<5>",BI=5$, $IB,"<4>",BI=4$, $IB,"<5>",BI=5$, $IB,"
U8 *CIA_neeger_imgs[4] = {$IB,"<8>",BI=8$, $IB,"<7>",BI=7$, $IB,"<8>",BI=8$, $IB,"<9>",BI=9$};
U8 *CIA_agent_imgs[4] = {$IB,"<8>",BI=8$, $IB,"<7>",BI=7$, $IB,"<8>",BI=8$, $IB,"<9>",BI=9$};
@ -334,7 +334,7 @@ U0 MPMenDraw(CDC *dc2)
if (tmpu->friendly)
{
if (tmpu->CIA && Blink)
_tmps = CIA_neeger_imgs;
_tmps = CIA_agent_imgs;
else
_tmps = friendly_imgs;
}

View file

@ -1145,7 +1145,7 @@ U0 ParseAsmDefine(CCompCtrl *cc, I64 U8_count)
Lex(cc);
}
U0 ParseBinFile(CCompCtrl *cc)
U0 ParseBinLoad(CCompCtrl *cc)
{
I64 i, size;
U8 *buf, *st;
@ -1259,8 +1259,8 @@ U0 ParseAsmBlk(CCompCtrl *cc, I64 comp_flags)
ParseAsmDefine(cc, 8);
break;
case AKW_BINFILE:
ParseBinFile(cc);
case AKW_BINLOAD:
ParseBinLoad(cc);
break;
case AKW_LIST:

View file

@ -1,7 +1,7 @@
I64 HashEntrySize(CHashSrcSym *tmph)
{//Logical size of a std system hash entry.
CDebugInfo *debug_info;
CBinFile *bfh;
CZXE *zxe;
switch (HashTypeNum(tmph))
{
@ -27,8 +27,8 @@ I64 HashEntrySize(CHashSrcSym *tmph)
return MSize(tmph(CHashGeneric *)->user_data0);
else
{
bfh = mem_boot_base - sizeof(CBinFile);
return bfh->file_size;
zxe = mem_boot_base - sizeof(CZXE);
return zxe->file_size;
}
case HTt_WORD:
@ -59,7 +59,7 @@ I64 HashEntrySize2(CHashSrcSym *tmph)
{
res += MemberListSize(tmph);
if (debug_info = tmph->debug_info)
//This should be $LK,"MSize",A="MN:MSize"$() but it would crash on AOT .BIN file functions.
//This should be $LK,"MSize",A="MN:MSize"$() but it would crash on AOT .ZXE file functions.
res += debug_info->body[debug_info->max_line + 1 - debug_info->min_line] - debug_info->body[0];
}
else if (tmph->type & HTT_DEFINE_STR)

View file

@ -492,11 +492,11 @@ U0 CompFixUpAOTAsm(CCompCtrl *cc, CAOT *tmpaot)
}
I64 Comp(U8 *filename, U8 *map_name=NULL, U8 *out_name=NULL, U8 mapfile_drive_let=0)
{//AOT Compile CC or PRJ file a and output BIN file. Returns err_count.
{//AOT Compile ZC or PRJ file and output ZXE file. Returns err_count.
U8 *ptr, *fbuf = NULL, *fbuf2 = NULL, *fbuf3 = NULL, *patch_table = MAlloc(0x20000);
CAOT *tmpaot;
I64 i, count, size = 0, error_count = 0, warning_count = 0, aot_U8s = 0;
CBinFile *bfh;
CZXE *zxe;
CAOTImportExport *tmpie, *tmpie1;
CAOTAbsAddr *tmpa, *tmpa1;
CAOTHeapGlobalRef *tmphgr, *tmphgr1;
@ -626,25 +626,25 @@ I64 Comp(U8 *filename, U8 *map_name=NULL, U8 *out_name=NULL, U8 mapfile_drive_le
MemSet(ptr, 0, 16);
i = ptr - patch_table;
//Needs 16 ALIGN
size = (sizeof(CBinFile) + aot_U8s + i + 15) & -16;
bfh = MAlloc(size);
bfh->jmp = 0xEB + 256 * (sizeof(CBinFile) - 2);
#assert sizeof(CBinFile) - 2 <= I8_MAX
bfh->reserved = 0;
bfh->bin_signature = BIN_SIGNATURE_VAL;
bfh->org = tmpaot->org;
bfh->module_align_bits = tmpaot->max_align_bits;
bfh->patch_table_offset = sizeof(CBinFile)+aot_U8s;
bfh->file_size = size;
MemCopy(bfh(U8 *) + sizeof(CBinFile), tmpaot->buf, aot_U8s);
MemCopy(bfh(U8 *) + sizeof(CBinFile) + aot_U8s, patch_table, size - aot_U8s - sizeof(CBinFile));
size = (sizeof(CZXE) + aot_U8s + i + 15) & -16;
zxe = MAlloc(size);
zxe->jmp = 0xEB + 256 * (sizeof(CZXE) - 2);
#assert sizeof(CZXE) - 2 <= I8_MAX
zxe->reserved = 0;
zxe->signature = ZXE_SIGNATURE_VAL;
zxe->org = tmpaot->org;
zxe->module_align_bits = tmpaot->max_align_bits;
zxe->patch_table_offset = sizeof(CZXE) + aot_U8s;
zxe->file_size = size;
MemCopy(zxe(U8 *) + sizeof(CZXE), tmpaot->buf, aot_U8s);
MemCopy(zxe(U8 *) + sizeof(CZXE) + aot_U8s, patch_table, size - aot_U8s - sizeof(CZXE));
Free(fbuf2);
if (out_name)
fbuf2 = ExtDefault(out_name, "BIN");
fbuf2 = ExtDefault(out_name, "ZXE");
else
fbuf2 = ExtChange(fbuf, "BIN");
FileWrite(fbuf2, bfh, size);
Free(bfh);
fbuf2 = ExtChange(fbuf, "ZXE");
FileWrite(fbuf2, zxe, size);
Free(zxe);
Free(tmpaot->buf);
QueueDel(tmpaot);
Free(tmpaot);

View file

@ -310,7 +310,7 @@ class CIntermediateStruct
#define AKW_IMPORT 85
#define AKW_LIST 86
#define AKW_NOLIST 87
#define AKW_BINFILE 88
#define AKW_BINLOAD 88
#define KW_KWS_NUM 89
#define CMP_TEMPLATE_INC 0x00

View file

@ -218,7 +218,7 @@ ASM_KEYWORD USE64 84;
ASM_KEYWORD IMPORT 85;
ASM_KEYWORD LIST 86;
ASM_KEYWORD NOLIST 87;
ASM_KEYWORD BINFILE 88;
ASM_KEYWORD BINLOAD 88;
OPCODE PUSH
0x0E, CS

Binary file not shown.

View file

@ -1,7 +1,5 @@
$WW,1$$FG,5$$TX+CX,"TODO"$$FG$
* Get rid of niggerlicious name "binary".
* Change mouse Z to wheel.
* 10/28/17 Editor froze when filter search 3, in bible, "hour".
@ -463,26 +461,3 @@ $TX,"Peter Gadwa",HTML="http://www.wired.com/magazine/2010/11/mf_ticketmaster/al
$TX,"Ticketmaster",HTML="http://www.nytimes.com/1994/11/06/business/ticketmaster-s-mr-tough-guy.html?pagewanted=a"$
$TX,"Tom Foley",HTML="http://web.gccaz.edu/~tfoley/perspage.html"$
$TX,"Graphic Technologies",HTML="https://web.archive.org/web/20020811060541/http://www.graphic-technologies.com/"$
$SP,"<1>",BI=1$
Òœÿÿÿ#ºÿÿÿ#A#œÿÿÿºÿÿÿA        

View file

@ -4,13 +4,13 @@
U0 TOSDebugDistro1()
{
CBinFile *bfh = mem_boot_base - sizeof(CBinFile);
CZXE *zxe = mem_boot_base - sizeof(CZXE);
bfh(I64) += bfh->file_size - 1;
zxe(I64) += zxe->file_size - 1;
DefinePrint("TOS_DEBUG_DISTRO", "0x%X", CeilI64(SYS_KERNEL_END + SLOP, BLK_SIZE));
DefinePrint("TOS_DEBUG_DISTRO_END", "0x%X",
FloorI64((BOOT_RAM_LIMIT - (BOOT_STACK_SIZE + DVD_BOOT_LOADER_SIZE)) >> 4 << 4 -
(bfh(I64) - SYS_KERNEL_END) - SLOP, BLK_SIZE));
(zxe(I64) - SYS_KERNEL_END) - SLOP, BLK_SIZE));
DefinePrint("CONFIG_DEBUG_DISTRO_FILE", "\"/Tmp/DebugDistro.BIN\"");
} TOSDebugDistro1;

View file

@ -103,7 +103,7 @@ U0 DebugDistroFilePrep()
Format('A',, FALSE, FSt_REDSEA);
DirMake("A:/Compiler");
Copy("C:/Compiler/Compiler.BIN", "A:/Compiler");
Copy("C:/Compiler/Compiler.ZXE", "A:/Compiler");
Copy("C:/Compiler/OpCodes.DD", "A:/Compiler");
Copy("C:/Compiler/CompilerA.HH", "A:/Compiler");
Copy("C:/Compiler/CompilerB.HH", "A:/Compiler");
@ -138,14 +138,14 @@ U0 StdDistroPrep()
CopyTree("C:/", TOS_DISTRO_DIR "/");
DelTree(TOS_DISTRO_DIR "/Home");
DirMake(TOS_DISTRO_DIR "/Home");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
Del(TOS_DISTRO_DIR "/" KERNEL_ZXE);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN");
}
U0 MakeStdDistro()
{
StdDistroPrep;
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_ZXE);
DefinePrint("DD_TEMPLEOSCD_SIZE", "Download $TX,"ZealOS V1.01",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1 * (10 * Size(TOS_ISO_NAME, "+s") / 1024 / 1024));
Drive('C');
@ -165,9 +165,9 @@ U0 LiteDistroPrep()
DelTree(TOS_DISTRO_DIR "/Apps");
DelTree(TOS_DISTRO_DIR "/Demo");
Copy(TOS_DISTRO_DIR "/Demo/Games/Talons.ZC", TOS_DISTRO_DIR "/Home");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
Del(TOS_DISTRO_DIR "/" KERNEL_ZXE);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN");
Del(TOS_DISTRO_DIR "/System/AutoComplete/ACDefs.DATA");
Del(TOS_DISTRO_DIR "/System/AutoComplete/ACWords.DATA");
Del(TOS_DISTRO_DIR "/Misc/Bible.TXT");
@ -175,7 +175,7 @@ U0 LiteDistroPrep()
U0 MakeLiteDistro()
{
LiteDistroPrep;
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_ZXE);
DefinePrint("DD_TEMPLEOSCD_SIZE", "Download $TX,"ZealOS V1.01",D="DD_OS_NAME_VERSION"$ - Standard Distro (%0.1fMB)",
0.1 * (10 * Size(TOS_ISO_NAME, "+s") / 1024 / 1024));
Drive('C');
@ -193,14 +193,14 @@ U0 DebugDistroPrep()
CopyTree("C:/", TOS_DISTRO_DIR "/");
DelTree(TOS_DISTRO_DIR "/Home");
DirMake(TOS_DISTRO_DIR "/Home");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN.C");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN.C");
Del(TOS_DISTRO_DIR "/" KERNEL_ZXE);
Del(TOS_DISTRO_DIR BOOT_DIR "/OldMBR.BIN");
Del(TOS_DISTRO_DIR BOOT_DIR "/BootMHD2.BIN");
}
U0 MakeDebugDistro()
{
DebugDistroPrep;
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_ZXE);
DefinePrint("DD_TEMPLEOS_DEBUG_SIZE", "Download $TX,"ZealOS V1.01",D="DD_OS_NAME_VERSION"$ - Debug Distro (%0.1fMB)",
0.1 * (10 * Size(TOS_ISO_NAME, "+s") / 1024 / 1024));
Drive('C');
@ -218,12 +218,12 @@ U0 StaffDistroPrep()
DelTree(TOS_DISTRO_DIR "/Home/Sup1");
DelTree(TOS_DISTRO_DIR "/Home/Sup2");
DelTree(TOS_DISTRO_DIR "/Home/Sup3");
Del(TOS_DISTRO_DIR "/" KERNEL_BIN_C);
Del(TOS_DISTRO_DIR "/" KERNEL_ZXE);
}
U0 MakeStaffDistro()
{
StaffDistroPrep;
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(TOS_ISO_NAME, TOS_DISTRO_DIR, TOS_DISTRO_DIR BOOT_DIR_KERNEL_ZXE);
DefinePrint("DD_TEMPLEOS_STAFF_SIZE", "Download $TX,"ZealOS V1.01",D="DD_OS_NAME_VERSION"$ - T.S. Company Internal Distro (%0.1fMB)",
0.1 * (10 * Size(TOS_ISO_NAME, "+s") / 1024 / 1024));
Drive('C');
@ -383,6 +383,6 @@ public U0 TOSRegen()
{//Generate distro ISO's
TOSBootHDIns('C');
Once("PopUp(\"TOSRegen2;\");");
// BootRAM("C:/Kernel/" KERNEL_BIN_C); //Boot to load $LK,"TOS_CONFIG",A="PF:::/Demo/AcctExample/TOS/TOSConfig.ZC,TOS_CONFIG"$.
BootRAM("::" BOOT_DIR_KERNEL_BIN_C); //Boot to load $LK,"TOS_CONFIG",A="PF:::/Demo/AcctExample/TOS/TOSConfig.ZC,TOS_CONFIG"$.
// BootRAM("C:/Kernel/" KERNEL_ZXE); //Boot to load $LK,"TOS_CONFIG",A="PF:::/Demo/AcctExample/TOS/TOSConfig.ZC,TOS_CONFIG"$.
BootRAM("::" BOOT_DIR_KERNEL_ZXE); //Boot to load $LK,"TOS_CONFIG",A="PF:::/Demo/AcctExample/TOS/TOSConfig.ZC,TOS_CONFIG"$.
}

View file

@ -42,7 +42,7 @@ point, but might res in odd differences, perhaps
from the order things are evaluated.
Data heap globals are good for AOT modules
because they don't take-up room in the .BIN file.
because they don't take-up room in the .ZXE file.
*/
#ifjit

Binary file not shown.

View file

@ -40,8 +40,8 @@ $FG,2$ALIGN$FG$ $FG,4$num$FG$, $FG,4$fill_byte$FG$
Align to $FG,4$num$FG$ boundary and fill with $FG,4$fill_byte$FG$.
$FG,2$ORG$FG$ $FG,4$num$FG$
Set code address for JIT or set module $LK,"Load",A="MN:Load"$() address -- has 16-byte $LK,"CBinFile",A="MN:CBinFile"$ header and patch table trailing.
Set code address for JIT or set module $LK,"Load",A="MN:Load"$() address -- has 16-byte $LK,"CZXE",A="MN:CZXE"$ header and patch table trailing.
$FG,2$BINFILE$FG,4$ "FileName.BIN"$FG$;
$FG,2$BINLOAD$FG,4$ "FileName.BIN"$FG$;
See $LK,"Assembly Language",A="FF:::/Doc/GuideLines.DD,Assembly Language"$, $LK,"::/Demo/Asm/AsmAndC1.ZC"$, $LK,"::/Demo/Asm/AsmAndC2.ZC"$ and $LK,"::/Demo/Asm/AsmAndC3.ZC"$.

Binary file not shown.

View file

@ -1,4 +1,24 @@
$WW,1$$FG,5$$TX+CX,"ChangeLog"$$FG$
$IV,1$----01/28/22 02:22:37----$IV,0$
* Raised version number to 1.10.
* Removed .C suffix on non-executable binary files.
- $LK,"R",A="MN:R"$("BOOT_DIR_OLDMBR_BIN_C", "$LK+PU,"BOOT_DIR_OLDMBR_BIN",A="MN:BOOT_DIR_OLDMBR_BIN"$");
- $LK,"R",A="MN:R"$("BOOT_DIR_BOOTMHD2_BIN_C", "$LK+PU,"BOOT_DIR_BOOTMHD2_BIN",A="MN:BOOT_DIR_BOOTMHD2_BIN"$");
- $LK,"R",A="MN:R"$("\"CC\", "\"ZC\"");
* Renamed executable binary file format .BIN to .ZXE (Binary -> Zeal Executable).
- $LK,"R",A="MN:R"$("CBinFile", "$LK+PU,"CZXE",A="MN:CZXE"$");
- $LK,"R",A="MN:R"$("BINFILE", "BINLOAD", "-i");
- $LK,"R",A="MN:R"$("ParseBinFile", "$LK+PU,"ParseBinLoad",A="MN:ParseBinLoad"$");
- $LK,"R",A="MN:R"$("\".BIN\", "\".ZXE\""); // carefully...
- $LK,"R",A="MN:R"$("\"BIN\", "\"ZXE\""); // carefully...
- $LK,"R",A="MN:R"$(".BIN", ".ZXE"); // carefully...
- $LK,"R",A="MN:R"$("KERNEL_BIN_C", "$LK+PU,"KERNEL_ZXE",A="MN:KERNEL_ZXE"$");
- $LK,"R",A="MN:R"$("BOOT_DIR_KERNEL_BIN_C", "$LK+PU,"BOOT_DIR_KERNEL_ZXE",A="MN:BOOT_DIR_KERNEL_ZXE"$");
- $LK,"R",A="MN:R"$("BOOT_DIR_DVD_KERNEL_BIN_C", "$LK+PU,"BOOT_DIR_DVD_KERNEL_ZXE",A="MN:BOOT_DIR_DVD_KERNEL_ZXE"$");
- $LK,"R",A="MN:R"$("BIN_SIGNATURE_VAL", "$LK+PU,"ZXE_SIGNATURE_VAL",A="MN:ZXE_SIGNATURE_VAL"$");
- $LK,"R",A="MN:R"$("BinRep", "$LK+PU,"ZXERep",A="MN:ZXERep"$");
- $LK,"R",A="MN:R"$("ST_BIN_FILE_TYPES", "$LK+PU,"ST_ZXE_FILE_TYPES",A="MN:ST_ZXE_FILE_TYPES"$");
$IV,1$----01/18/22 00:35:45----$IV,0$
* Raised version number to 1.09.
* Integrated HolyMath into OS (from https://github.com/TempleProgramming/HolyMath).

View file

@ -29,7 +29,7 @@ $ID,2$The term $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"
$ID,-2$$TR,"Is it open source? How do I build it?"$
$ID,2$ZealOS is 100% open source. All the source code is included in the distro. Use $LK,"BootHDIns",A="MN:BootHDIns"$() to compile the kernel and compiler. The rest is $LK,"JIT Compiled",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ during boot. See $LK,"::/StartOS.ZC"$.
$ID,-2$$TR,"Where are object files? How do I link?"$
$ID,2$ZealOS does not use object files or a linker. $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ is used to directly create flat binary files, $LK,"::/Boot/Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.BIN",A="FI:::/Compiler/Compiler.PRJ"$ with no object files and linking.$FG$ $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ place code in memory, ready to run, with no object files or linking. Linking is done when $FG,2$BIN$FG$ modules are $LK,"Load",A="MN:Load"$()ed.
$ID,2$ZealOS does not use object files or a linker. $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ is used to directly create flat binary files, $LK,"::/Boot/Kernel.ZXE",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.ZXE",A="FI:::/Compiler/Compiler.PRJ"$ with no object files and linking.$FG$ $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ place code in memory, ready to run, with no object files or linking. Linking is done when $FG,2$ZXE$FG$ modules are $LK,"Load",A="MN:Load"$()ed.
$ID,-2$$TR,"What is the FPS refresh rate?"$
$ID,2$The refresh rate is $TX,"(60000.0 / 1001)",D="WINMGR_FPS"$ frames-per-second. That is how often ZealOS updates screen mem. It is not synchronized to the hardware.
$ID,-2$$TR,"How does a task own the speaker?"$
@ -52,7 +52,7 @@ $ID,-2$$TR,"How do I set the PATH?"$
$ID,2$There is no $FG,2$PATH$FG$. You do not enter filenames at the command-line and expect them to run. You enter C-like code. $LK,"Get Started Here",A="FI:::/Doc/CmdLineOverview.DD"$.
$ID,-2$$TR,"How do I boot it with Grub?"$
$ID,2$If you use Grub, you $FG,2$chain-load$FG$ like Windows. See $LK,"Boot",A="FI:::/Doc/Boot.DD"$. You can use the ZealOS boot-loader. $LK,"Master-Boot-Loader-Stage1",A="FI:::/System/Boot/BootMHD.ZC"$, $LK,"Master-Boot-Loader-Stage2",A="FI:::/System/Boot/BootMHD2.ZC"$, $LK,"Partition-Boot-Loader",A="FI:::/System/Boot/BootHD.ZC"$, $LK,"CD-DVD-Boot-Loader",A="FI:::/System/Boot/BootDVD.ZC"$.
$ID,-2$$TR,"How do I get Kernel.BIN to boot?"$
$ID,-2$$TR,"How do I get Kernel.ZXE to boot?"$
$ID,2$The boot-loaders must be patched by you running $LK,"BootHDIns",A="MN:BootHDIns"$() or $LK,"BootMHDIns",A="MN:BootMHDIns"$(). Those will write the block address into the boot-loader because the boot-loaders do not navigate file systems to find the $LK,"Stage2",A="FI:::/Kernel/KStart16.ZC"$ if you relocate it.
$ID,-2$$TR,"Why is there some 16-Bit code?"$
$ID,2$ZealOS is 64-bit. Like all PC operating systems, the boot-loader starts in 16-bit real-mode. ZealOS calls a few $FG,2$BIOS$FG$ info routines, switches to VGA-640x480x4bit, switches to 32-bit, then, 64-bit mode. There is an odd thing called a $FG,2$$TX,"PCI BIOS",HTML="http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf"$$FG$ which is 32-bit used for $FG,2$PCI$FG$ config space access. If supported, ZealOS calls $LK,"that",A="FI:::/Kernel/PCIBIOS.ZC"$ a couple times, otherwise using Port I/O for PCI. It must temporarily drop-out-of 64-bit mode for that and stop multi-tasking.
@ -63,7 +63,7 @@ $ID,2$$FG,2$XOR EAX,EAX$FG$ : Operations on 32-bit registers clear the high 32-b
$ID,-2$$TR,"How do you use the FS and GS segment registers."$
$ID,2$$FG,2$MOV RAX,FS:[RAX]$FG$ : FS can be set with a $FG,2$WRMSR$FG$, but displacement is RIP relative, so it's tricky to use. FS is used for the current $LK,"CTask",A="MN:CTask"$, GS for $LK,"CCPU",A="MN:CCPU"$.
$ID,-2$$TR,"How do I set ORG for position of code?"$
$ID,2$The compiler creates $FG,2$pos independent$FG$ code. Don't create code which is loaded at a fixed, specified location. Code in a BIN file is $FG,2$pos independent$FG$ by virtue of a table in the BIN file for patching absolute addresses.
$ID,2$The compiler creates $FG,2$pos independent$FG$ code. Don't create code which is loaded at a fixed, specified location. Code in a ZXE file is $FG,2$pos independent$FG$ by virtue of a table in the ZXE file for patching absolute addresses.
$ID,-2$$TR,"How are symbols loaded?"$
$ID,2$Binary executable files have export symbols which are loaded into the symbol tables. The operating system $FG,2$Kernel$FG$ has such an export table. In addition, some map files are processed to provide more information on symbols -- src file links. This is how the $LK,"Man",A="MN:Man"$()/$FG,2$AutoComplete$FG$ feature can find src lines.
$ID,-2$$TR,"Why doesn't assert work?"$
@ -79,7 +79,7 @@ $ID,2$Binary sprite data is stored beyond the terminating $FG,2$NULL$FG$ in text
$ID,-2$$TR,"Why are sprites so small?"$
$ID,2$Sprites can be stored as vector graphics so they might take shockingly little room. They can be converted to bitmaps.
$ID,-2$$TR,"Why don't I need to recompile /System and /Home files?"$
$ID,2$If you change code in the $FG,2$/System$FG$ or your $FG,2$/Home$FG$ directory, you don't need to recompile, you just need to reboot because those directories get recompiled when you boot. It uses $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. There is no $FG,2$.BIN$FG$ file for $FG,2$JIT$FG$ compilation. See $LK,"::/StartOS.ZC"$.
$ID,2$If you change code in the $FG,2$/System$FG$ or your $FG,2$/Home$FG$ directory, you don't need to recompile, you just need to reboot because those directories get recompiled when you boot. It uses $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. There is no $FG,2$.ZXE$FG$ file for $FG,2$JIT$FG$ compilation. See $LK,"::/StartOS.ZC"$.
$ID,-2$$TR,"Why does it finds files that aren't there?"$
$ID,2$If a file is not found, the parent directories are searched for a file of the same name.
$ID,-2$

View file

@ -159,9 +159,9 @@ $ID,2$$LK,"ZealC",A="FI:::/Doc/ZealC.DD"$ is more than $FG,2$C$FG$ and less than
$ID,-2$$TR,"AOT Compile Mode"$
$ID,2$$FG,2$Ahead-of-Time$FG$ compiling is conventional compilation mode. Do not use $FG,2$AOT$FG$, use $FG,2$JIT$FG$ compiling.
In $FG,2$AOT$FG$ mode, $FG,2$.PRJ$FG$ files are compiled to $FG,2$.BIN$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, $FG,2$.BIN$FG$ files are $LK,"Load",A="MN:Load"$()ed.
In $FG,2$AOT$FG$ mode, $FG,2$.PRJ$FG$ files are compiled to $FG,2$.ZXE$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, $FG,2$.ZXE$FG$ files are $LK,"Load",A="MN:Load"$()ed.
There is no $FG,2$main()$FG$ routine. Instead, statements outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$AOT Compiled Mode$FG$, $LK,"Comp",A="MN:Comp"$() is used. The $FG,2$Kernel$FG$ module and compiler are made in $FG,2$AOT$FG$ compiled mode. See $LK,"BootHDIns",A="MN:BootHDIns"$() which calls $LK,"MakeAll",A="MN:MakeAll"$() where $LK,"::/Boot/Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.BIN",A="FI:::/Compiler/Compiler.PRJ"$ are created.
There is no $FG,2$main()$FG$ routine. Instead, statements outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$AOT Compiled Mode$FG$, $LK,"Comp",A="MN:Comp"$() is used. The $FG,2$Kernel$FG$ module and compiler are made in $FG,2$AOT$FG$ compiled mode. See $LK,"BootHDIns",A="MN:BootHDIns"$() which calls $LK,"MakeAll",A="MN:MakeAll"$() where $LK,"::/Boot/Kernel.ZXE",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.ZXE",A="FI:::/Compiler/Compiler.PRJ"$ are created.
$ID,-2$$TR,"JIT Compile Mode"$
$ID,2$In $FG,2$just-in-time$FG$ mode, the compiler places code and data in memory alloced from the heap, incrementally, making them immediately ready for in-place execution. This mode is used during cmd line operations. When you $FG,2$#include$FG$ a file, it is compiled function by function and code ends-up all over in the memory, at least in the first 2Gig of memory. The $LK,"ExeFile",A="MN:ExeFile"$() routine is the same as $FG,2$#include$FG$ but can be used in programs. $LK,"ExePrint",A="MN:ExePrint"$() routine will compile and run a string.
$ID,-2$$TR,"Compiler Intermediate Code"$
@ -213,7 +213,7 @@ $FG,5$*.HH$FG$
ZealC src header files.
$FG,5$*.MAP$FG$
Compiler "map" files
$FG,5$*.BIN;*.BIN.C$FG$
$FG,5$*.ZXE;*.ZXE$FG$
Binary executable files, created by $LK,"Comp",A="MN:Comp"$() and read by $LK,"Load",A="MN:Load"$().
$FG,5$*.DATA$FG$
Data files

View file

@ -14,7 +14,7 @@ $FG,2$/Compiler$FG$ The compiler module src code is found here. The compiler is
$FG,2$/System$FG$ The non-kernel part of the operating system is found here. It is $FG,2$JIT$FG$ compiled during boot. The $LK,"System Task",A="FF:::/Doc/Glossary.DD,System Task"$ is the most important task. It never dies.
$FG,2$/Boot$FG$ Boot files go here. Stage 2 of the ZealOS hard drive master boot loader, the old hard drive master boot record which is just block#0, and the HDD & CD/DVD $LK,"Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ file go here.
$FG,2$/Boot$FG$ Boot files go here. Stage 2 of the ZealOS hard drive master boot loader, the old hard drive master boot record which is just block#0, and the HDD & CD/DVD $LK,"Kernel.ZXE",A="FI:::/Kernel/Kernel.PRJ"$ file go here.
@ -78,7 +78,7 @@ $ID,-5$
* Avoid boolean expression assignments. Boolean assignments don't have short circuit logic and are not compiled efficiently. The $FG,2$Bool$FG$ type is just an alias for a 1 byte signed int -- nothing forces it to $FG,2$1$FG$ or $FG,2$0$FG$. There is a $LK,"ToBool",A="MN:ToBool"$() function that will for to $FG,2$1$FG$ ot $FG,2$0$FG$, however.
* Global variables in $FG,2$AOT$FG$ BIN modules are initialized to zero. They occupy space in BIN files.
* Global variables in $FG,2$AOT$FG$ ZXE modules are initialized to zero. They occupy space in ZXE files.
* Bracketing code with $FG,2$PUSHFD CLI$FG$ and $FG,2$POPFD$FG$ will protect against simultaneous accesses from tasks on $UL,1$one$UL,0$ core. To protect against multiple cores, you need a locked semaphore. Semaphores might need to be in their own cache line. Lock bits are used in a lot of places not aligned.

View file

@ -26,7 +26,7 @@ $ID,-2$
$ID,-2$2) $LK,"Format",A="MN:Format"$($FG,2$'D'$FG$,$FG,2$ TRUE$FG$,$FG,2$ FALSE$FG$,$FG,2$ FSt_FAT32$FG$)
$ID,2$This command formats a drive with $FG,2$FAT32$FG$ or the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system type. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/Boot/OldMBR.BIN.C$FG$.
$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/Boot/OldMBR.BIN$FG$.
$ID,-2$3) $LK,"CopyTree",A="MN:CopyTree"$($FG,2$"T:/"$FG$,$FG,2$ "D:/"$FG$)
$ID,2$This command is used to copy files onto a hard drive partition from the CD/DVD. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
@ -36,9 +36,9 @@ $ID,2$This command recompiles the source code on a drive and writes to the $UL,1
$ID,-2$5) Use Linux's Grub or ZealOS' $LK,"BootMHDIns",A="MN:BootMHDIns"$($FG,2$'D'$FG$)
$ID,2$
The $LK,"BootMHDIns",A="MN:BootMHDIns"$() command places a boot loader on a drive. It saves the old master boot record to $FG,2$/Boot/OldMBR.BIN.C$FG$ and replaces it. When you boot, you will have the option of booting the old master boot record. This command can be skipped if you already have a boot loader. Be sure not to lose the copy of the old boot record, like if you reformat the drive.
The $LK,"BootMHDIns",A="MN:BootMHDIns"$() command places a boot loader on a drive. It saves the old master boot record to $FG,2$/Boot/OldMBR.BIN$FG$ and replaces it. When you boot, you will have the option of booting the old master boot record. This command can be skipped if you already have a boot loader. Be sure not to lose the copy of the old boot record, like if you reformat the drive.
Delete $FG,2$/Boot/OldMBR.BIN.C$FG$ if you want to get a fresh copy of a mbr, like if installing from your own custom CD containing it's own $FG,2$/Boot/OldMBR.BIN.C$FG$ onto a system with a non-ZealOS boot loader.
Delete $FG,2$/Boot/OldMBR.BIN$FG$ if you want to get a fresh copy of a mbr, like if installing from your own custom CD containing it's own $FG,2$/Boot/OldMBR.BIN$FG$ onto a system with a non-ZealOS boot loader.
If you have anti-virus software, it might object to having a different master boot record.
$ID,-2$

View file

@ -2,7 +2,7 @@ $WW,1$$FG,5$$TX+CX,"Compiler Options"$$FG$
Use $LK,"Option",A="MN:Option"$(). You might need to do $FG,2$#exe {Option();}$FG$.
$LK,"OPTf_GLOBALS_ON_DATA_HEAP",A="MN:OPTf_GLOBALS_ON_DATA_HEAP"$ without this option, global variables are placed in the code heap which is limited to 2Gig. In $FG,2$AOT$FG$ modules, global variables take-up room in the $FG,2$.BIN$FG$ file, so you might want to use this option, instead. You might wish to turn it on and off around specific variables. A disadvantage of data heap global variables in $FG,2$AOT$FG$ modules is they can't be initialized.
$LK,"OPTf_GLOBALS_ON_DATA_HEAP",A="MN:OPTf_GLOBALS_ON_DATA_HEAP"$ without this option, global variables are placed in the code heap which is limited to 2Gig. In $FG,2$AOT$FG$ modules, global variables take-up room in the $FG,2$.ZXE$FG$ file, so you might want to use this option, instead. You might wish to turn it on and off around specific variables. A disadvantage of data heap global variables in $FG,2$AOT$FG$ modules is they can't be initialized.
$LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE",A="MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need. They're to allow the same header file for $FG,2$Kernel$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by $FG,2$AOT$FG$ modules.

View file

@ -38,7 +38,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
Copy("/*", "/Distro");
progress1++;
DirMake("/Distro" BOOT_DIR);
Move(BOOT_DIR_DVD_KERNEL_BIN_C, "/Distro" BOOT_DIR_KERNEL_BIN_C);
Move(BOOT_DIR_DVD_KERNEL_ZXE, "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
CopyTree("/Home", "/Distro/Home");
progress1++;
@ -66,7 +66,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
DirMake("/Distro/Tmp/ScreenShots");
progress1++;
StrCopy(progress1_desc, "Building ISO");
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
//If CD-ROM use MT_CD instead of MT_DVD.

View file

@ -85,8 +85,8 @@ I64 Dir2Html(U8 *src_files_find_mask, U8 *dst_files_find_mask)
if (!(tmpde1->attr & RS_ATTR_DIR))
{
if (StrCompare(dest_ext, "BIN.C") &&
StrCompare(dest_ext, "BIN") &&
if (StrCompare(dest_ext, "ZXE") &&
StrCompare(dest_ext, "ZXE") &&
StrCompare(dest_ext, "ISO.C") &&
StrCompare(dest_ext, "html") &&
StrCompare(dest_ext, "DATA") &&

View file

@ -18,7 +18,7 @@ CBlkDev *ATAMount(U8 first_drive_let, I64 type, I64 port_num)
I64 MountAHCIAuto()
{//Try to mount hard drives and CD/DVD drives automatically. (Kernel.Config option).
//It uses 'C' and 'T' as first drive letters or whatever you set
//in config when compiling Kernel.BIN.
//in config when compiling Kernel.ZXE.
CBlkDev *bd = Letter2BlkDev(':', FALSE);
I64 res = 0, i, ata_port = -1, atapi_port = -1;
CAHCIPort *port;

View file

@ -77,7 +77,7 @@ U0 KConfigOptions(CKConfig *c)
"$$PURPLE$$HomeDir$$FG$$ Set home dir.\n"
"$$PURPLE$$NoMP$$FG$$ No multicore.\n"
"$$PURPLE$$MountAHCIAuto$$FG$$ Auto Mount AHCI drives to 'C' and 'T'.\n"
"$$PURPLE$$DebugDistro$$FG$$ Include RAM Drive in Kernel.BIN.\n"
"$$PURPLE$$DebugDistro$$FG$$ Include RAM Drive in Kernel.ZXE.\n"
"\n";
else
if (0 <= i < CONFIG_OPTIONS_NUM)

View file

@ -13,7 +13,7 @@ CTask *sys_winmgr_task,
U8 *rev_bits_table; //Table with U8 bits reversed
CDate local_time_offset;
F64 *pow10_I64,
sys_os_version = 1.09;
sys_os_version = 1.10;
CAutoCompleteDictGlobals acd;
CAutoCompleteGlobals ac;

View file

@ -205,58 +205,58 @@ U0 LoadPass2(U8 *src, U8 *module_base, I64)
}
}
CBinFile *Load(U8 *filename, I64 ld_flags=0, CBinFile *bfh_addr=INVALID_PTR)
{//Load a .BIN file module into memory.
//bfh_addr==INVALID_PTR means don't care what load address.
CZXE *Load(U8 *filename, I64 ld_flags=0, CZXE *zxe_addr=INVALID_PTR)
{//Load a .ZXE file module into memory.
//zxe_addr==INVALID_PTR means don't care what load address.
U8 *fbuf, *module_base, *absname;
I64 size, module_align, misalignment;
CBinFile *bfh;
CZXE *zxe;
fbuf = ExtDefault(filename, "BIN");
if (!(bfh = FileRead(fbuf, &size)))
fbuf = ExtDefault(filename, "ZXE");
if (!(zxe = FileRead(fbuf, &size)))
{
Free(fbuf);
return NULL;
}
//See $LK,"Patch Table Generation",A="FF:::/Compiler/CMain.ZC,IET_ABS_ADDR"$
module_align = 1 << bfh->module_align_bits;
if (!module_align || bfh->bin_signature != BIN_SIGNATURE_VAL)
module_align = 1 << zxe->module_align_bits;
if (!module_align || zxe->signature != ZXE_SIGNATURE_VAL)
{
Free(bfh);
Free(zxe);
Free(fbuf);
throw('BinModul');
throw('ZXEModul');
}
if (bfh_addr == INVALID_PTR)
if (zxe_addr == INVALID_PTR)
{
if (bfh->org == INVALID_PTR)
if (zxe->org == INVALID_PTR)
{
misalignment = module_align - sizeof(CBinFile);
misalignment = module_align - sizeof(CZXE);
if (misalignment < 0)
misalignment &= module_align - 1;
if (Fs->code_heap != Fs->data_heap)
{
if (module_align < 16)
module_align = 16;
bfh_addr = MAllocAligned(size, module_align, Fs->code_heap, misalignment);
zxe_addr = MAllocAligned(size, module_align, Fs->code_heap, misalignment);
}
else if (module_align > 8)
bfh_addr = MAllocAligned(size, module_align,, misalignment);
zxe_addr = MAllocAligned(size, module_align,, misalignment);
else
{//Less than 2Gig system memory
bfh_addr = bfh;
zxe_addr = zxe;
goto lo_skip; //File is already in code heap area, don't copy.
}
}
else
bfh_addr = bfh->org;
zxe_addr = zxe->org;
}
MemCopy(bfh_addr, bfh, size);
Free(bfh);
MemCopy(zxe_addr, zxe, size);
Free(zxe);
lo_skip:
module_base = bfh_addr(U8 *) + sizeof(CBinFile);
module_base = zxe_addr(U8 *) + sizeof(CZXE);
absname = FileNameAbs(fbuf);
Free(fbuf);
@ -264,21 +264,21 @@ CBinFile *Load(U8 *filename, I64 ld_flags=0, CBinFile *bfh_addr=INVALID_PTR)
FileExtRemove(fbuf);
if (fbuf[1] == ':' && StrLen(fbuf) > 2)
HashGenericAdd(fbuf + 2, HTT_MODULE | HTF_PUBLIC, bfh_addr);
HashGenericAdd(fbuf + 2, HTT_MODULE | HTF_PUBLIC, zxe_addr);
LoadPass1(bfh_addr(U8 *) + bfh_addr->patch_table_offset, module_base, ld_flags);
LoadPass1(zxe_addr(U8 *) + zxe_addr->patch_table_offset, module_base, ld_flags);
if (!(ld_flags & LDF_JUST_LOAD))
LoadPass2(bfh_addr(U8 *) + bfh_addr->patch_table_offset, module_base, ld_flags);
LoadPass2(zxe_addr(U8 *) + zxe_addr->patch_table_offset, module_base, ld_flags);
Free(absname);
Free(fbuf);
return bfh_addr;
return zxe_addr;
}
U0 LoadKernel()
{
HashGenericAdd(KERNEL_MODULE_NAME, HTT_MODULE | HTF_PUBLIC, mem_boot_base - sizeof(CBinFile));
HashGenericAdd(KERNEL_MODULE_NAME, HTT_MODULE | HTF_PUBLIC, mem_boot_base - sizeof(CZXE));
//Abs patches done here $LK,"CPatchTableAbsAddr",A="FF:::/Kernel/KStart32.ZC,CPatchTableAbsAddr"$.
LoadPass1(sys_boot_patch_table_base, mem_boot_base, LDF_NO_ABSS | LDF_SILENT);

View file

@ -256,8 +256,8 @@ asm
SYS_KERNEL_END::
#exe {
if (kernel_config->opts[CONFIG_DEBUG_DISTRO])
StreamPrint("DU8 0x%X - (SYS_KERNEL_END-SYS_KERNEL + BOOT_RAM_BASE + sizeof(CBinFile)) DUP (0);"
"BINFILE \"%s\";",
StreamPrint("DU8 0x%X - (SYS_KERNEL_END-SYS_KERNEL + BOOT_RAM_BASE + sizeof(CZXE)) DUP (0);"
"BINLOAD \"%s\";",
kernel_config->debug_distro_start, kernel_config->debug_distro_file);
};

View file

@ -2,7 +2,7 @@ asm {/* See $LK,"::/Doc/Boot.DD"$.
ZealOS starts in real, calls some BIOS routines, switches to 32 bit, and 64 bit mode and continues in $LK,"ZealC",A="FI:::/Doc/ZealC.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 placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.ZC,16 ALIGN"$.
It actually jumps to the $LK,"CZXE",A="MN:CZXE"$ header which is placed just before this by $LK,"the compiler",A="FF:::/Compiler/CMain.ZC,16 ALIGN"$.
The header begins with a short jmp to the start of this file's code which begins with the following small jump past some data.
This file is first in the Kernel image because it is #included first. $LK,"Kernel.PRJ",A="FF:::/Kernel/Kernel.PRJ,KStart16:1"$
@ -25,7 +25,7 @@ SYS_RUN_LEVEL:: DU32 0;
StreamPrint("SYS_COMPILE_TIME:: DU64 0x%X;", Now); //See $LK,"AHCIBootDVDProbeAll",A="MN:AHCIBootDVDProbeAll"$
};
#assert SYS_COMPILE_TIME + sizeof(CDate) + sizeof(CBinFile) < DVD_BLK_SIZE
#assert SYS_COMPILE_TIME + sizeof(CDate) + sizeof(CZXE) < DVD_BLK_SIZE
MEM_BOOT_BASE:: DU32 0; //Offset from start used by reboot
MEM_E801:: DU16 0, 0;
@ -56,7 +56,7 @@ SYS_VBE_INFO:: DU8 sizeof(CVBEInfo) DUP(0);
SYS_VBE_MODES:: DU8 sizeof(CVBEModeShort) * VBE_MODES_NUM DUP(0);
SYS_VBE_FINAL_MODE:: DU8 sizeof(CVBEMode) DUP(0);
SYS_VBE_FINAL_MODE_NUM::DU16 0; //mode number of final mode set
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CBinFile)
#assert $$ - SYS_KERNEL == sizeof(CKernel) - sizeof(CZXE)
TEMP_VBE_MODE: DU8 sizeof(CVBEMode) DUP(0);
MAX_VBE_MODE: DU8 sizeof(CVBEModeShort) DUP(0);
@ -320,13 +320,13 @@ GET_IP: POP BX
MOV U32 [MEM_BOOT_BASE], EAX
MOV DX, CS
SUB DX, sizeof(CBinFile) / 16
#assert !(sizeof(CBinFile) & 0xF)
SUB DX, sizeof(CZXE) / 16
#assert !(sizeof(CZXE) & 0xF)
MOV GS, DX
MOV EDX, EAX
ADD EDX, U32 GS:[CBinFile.patch_table_offset]
SUB EDX, sizeof(CBinFile)
ADD EDX, U32 GS:[CZXE.patch_table_offset]
SUB EDX, sizeof(CZXE)
MOV U32 [SYS_BOOT_PATCH_TABLE_BASE], EDX
ADD U32 [GDT_BOOT_DS+2], EAX

View file

@ -72,7 +72,7 @@ SYS_MP_COUNT_LOCK:: DU64 1;
ALIGN DEFAULT_CACHE_LINE_WIDTH, OC_NOP
SYS_CACHE_LINE_WIDTH:: DU64 DEFAULT_CACHE_LINE_WIDTH;
DU8 DEFAULT_CACHE_LINE_WIDTH - sizeof(CBinFile) - 8 DUP(0);
DU8 DEFAULT_CACHE_LINE_WIDTH - sizeof(CZXE) - 8 DUP(0);
SYS_SEMAS:: DU8 SEMA_SEMAS_NUM * DEFAULT_CACHE_LINE_WIDTH DUP(0);
//************************************
ALIGN 16, OC_NOP

View file

@ -448,13 +448,13 @@ class CMemE820
#define LDF_JUST_LOAD 2
#define LDF_SILENT 4
#define BIN_SIGNATURE_VAL 'ZCCB' //Zeal ZealC Binary
class CBinFile
{//$LK,"Bin File Header Generation",A="FF:::/Compiler/CMain.ZC,16 ALIGN"$ by compiler.
#define ZXE_SIGNATURE_VAL 'ZXE' // Zeal Executable
class CZXE
{// $LK,"ZXE Header Generation",A="FF:::/Compiler/CMain.ZC,16 ALIGN"$ by compiler.
U16 jmp;
U8 module_align_bits,
reserved;
U32 bin_signature;
U32 signature;
I64 org,
patch_table_offset, //$LK,"Patch Table Generation",A="FF:::/Compiler/CMain.ZC,IET_ABS_ADDR"$
file_size;
@ -547,7 +547,7 @@ class CVBEModeShort
#help_index "Boot"
class CKernel
{//Must match $LK,"OSStartUp",A="FF:::/Kernel/KStart16.ZC,MEM_BOOT_BASE"$
CBinFile h;
CZXE h;
U32 jmp,
boot_src,
boot_blk,

View file

@ -112,7 +112,7 @@ public extern CTextGlobals text;
public extern U0 HashSrcFileSet(CCompCtrl *cc, CHashSrcSym *h, I64 line_num_offset=0);
#help_index "Compiler;Cmd Line (Typically)"
extern U8 *Load(U8 *filename, I64 ld_flags=0, CBinFile *bfh_addr=INVALID_PTR); //INVALID_PTR=don't care what load address
extern U8 *Load(U8 *filename, I64 ld_flags=0, CZXE *zxe_addr=INVALID_PTR); //INVALID_PTR=don't care what load address
#help_index "Data Types/Circular Queue"
public extern I64 QueueCount(CQueue *head);

View file

@ -21,7 +21,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
Copy("/*","/Distro");
DirMake("/Distro" BOOT_DIR);
Move(BOOT_DIR_DVD_KERNEL_BIN_C, "/Distro" BOOT_DIR_KERNEL_BIN_C);
Move(BOOT_DIR_DVD_KERNEL_ZXE, "/Distro" BOOT_DIR_KERNEL_ZXE);
CopyTree("/Home", "/Distro/Home");
Del("/Distro/Home/Registry.ZC");
@ -39,7 +39,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
Del("/Distro/Misc/Bible.TXT");
Del("/Distro/Misc/Clementine.TXT");
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_ZXE);
DelTree("/Distro");
Free(out_iso_filename);

View file

@ -32,7 +32,7 @@ U0 MakeMyISO()
Copy("/*", "/Distro");
progress1++;
DirMake("/Distro" BOOT_DIR);
Move(BOOT_DIR_DVD_KERNEL_BIN_C, "/Distro" BOOT_DIR_KERNEL_BIN_C);
Move(BOOT_DIR_DVD_KERNEL_ZXE, "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
CopyTree("/Home", "/Distro/Home");
progress1++;
@ -58,7 +58,7 @@ U0 MakeMyISO()
DirMake("/Distro/Tmp/ScreenShots");
progress1++;
StrCopy(progress1_desc, "Building ISO");
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_ZXE);
progress1++;
//If CD-ROM use MT_CD instead of MT_DVD.

View file

@ -113,7 +113,7 @@ Bool DoInstall(Bool prompt_reboot)
VMInstallWiz();
res = TRUE;
OnceDrive('C', "PopUp(\"#include \\\"/Misc/Auto/AutoFullDistro0\\\";\");");
BootRAM("C:" BOOT_DIR_KERNEL_BIN_C);
BootRAM("C:" BOOT_DIR_KERNEL_ZXE);
return res;
}

View file

@ -19,9 +19,9 @@ U0 MakeMyISO(U8 *_out_iso_filename)
BootDVDIns;
Copy("/*","/Distro");
// Del("/Distro/" KERNEL_BIN_C);
// Del("/Distro/" KERNEL_ZXE);
DirMake("/Distro" BOOT_DIR);
Move(BOOT_DIR_DVD_KERNEL_BIN_C, "/Distro" BOOT_DIR_KERNEL_BIN_C);
Move(BOOT_DIR_DVD_KERNEL_ZXE, "/Distro" BOOT_DIR_KERNEL_ZXE);
// CopyTree(BOOT_DIR, "/Distro" BOOT_DIR);
CopyTree("/Home", "/Distro/Home");
@ -39,7 +39,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
CopyTree("/Downloads", "/Distro/Downloads"); //You can leave this out.
DirMake("/Distro/Tmp");
DirMake("/Distro/Tmp/ScreenShots");
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_BIN_C);
RedSeaISO(out_iso_filename, "/Distro", "/Distro" BOOT_DIR_KERNEL_ZXE);
//If CD-ROM use MT_CD instead of MT_DVD.
//DVDImageWrite('T',out_iso_filename,MT_DVD); //Uncomment to burn.

View file

@ -6,9 +6,9 @@
#help_index "Install"
#define KERNEL_BIN_C "Kernel.BIN.C"
#define KERNEL_ZXE "Kernel.ZXE"
#define BOOT_DIR "/Boot"
#define BOOT_DIR_DVD_KERNEL_BIN_C BOOT_DIR "/DVD" KERNEL_BIN_C
#define BOOT_DIR_DVD_KERNEL_ZXE BOOT_DIR "/DVD" KERNEL_ZXE
U0 MakeAll()
{
@ -25,7 +25,7 @@ public U0 BootDVDIns(U8 drv_let=0)
if (!Drive(drv_let))
throw;
MakeAll;
Move("/Kernel/Kernel.BIN", BOOT_DIR_DVD_KERNEL_BIN_C);
Move("/Kernel/Kernel.ZXE", BOOT_DIR_DVD_KERNEL_ZXE);
}
catch
{

View file

@ -5,9 +5,9 @@
#help_index "Install"
#define KERNEL_BIN_C "Kernel.BIN.C"
#define KERNEL_ZXE "Kernel.ZXE"
#define BOOT_DIR "/Boot"
#define BOOT_DIR_KERNEL_BIN_C BOOT_DIR "/" KERNEL_BIN_C
#define BOOT_DIR_KERNEL_ZXE BOOT_DIR "/" KERNEL_ZXE
U0 CompComp()
{
@ -41,10 +41,10 @@ public U0 BootHDIns(U8 drv_let=0)
{
case BDT_RAM:
case BDT_ATA:
Move("/Kernel/Kernel.BIN", BOOT_DIR_KERNEL_BIN_C);
Move("/Kernel/Kernel.ZXE", BOOT_DIR_KERNEL_ZXE);
if (!FileFind(BOOT_DIR_KERNEL_BIN_C, &de, FUF_JUST_FILES))
"No Kernel.BIN.C\n";
if (!FileFind(BOOT_DIR_KERNEL_ZXE, &de, FUF_JUST_FILES))
"No Kernel.ZXE\n";
else
{
Free(de.full_name);

View file

@ -8,9 +8,9 @@
#define BOOT_DIR "/Boot"
//Stage 2 of master boot loader
#define BOOT_DIR_BOOTMHD2_BIN_C BOOT_DIR "/BootMHD2.BIN.C"
#define BOOT_DIR_BOOTMHD2_BIN BOOT_DIR "/BootMHD2.BIN"
//Old master boot record
#define BOOT_DIR_OLDMBR_BIN_C BOOT_DIR "/OldMBR.BIN.C"
#define BOOT_DIR_OLDMBR_BIN BOOT_DIR "/OldMBR.BIN"
public U0 BootMHDOldRead(U8 src_drive, U8 dst_drive)
{//Reads MBR from disk drive containing src partition.
@ -33,7 +33,7 @@ public U0 BootMHDOldRead(U8 src_drive, U8 dst_drive)
Drive(dst_drive);
DirMake(BOOT_DIR);
FileWrite(BOOT_DIR_OLDMBR_BIN_C, &mbr, BLK_SIZE);
FileWrite(BOOT_DIR_OLDMBR_BIN, &mbr, BLK_SIZE);
}
}
@ -45,7 +45,7 @@ public U0 BootMHDOldWrite(U8 src_drive, U8 dst_drive)
Drive(src_drive);
if (mbr = FileRead(BOOT_DIR_OLDMBR_BIN_C))
if (mbr = FileRead(BOOT_DIR_OLDMBR_BIN))
{
//Bypass partition bounds-checking
BlkDevLock(bd);
@ -108,7 +108,7 @@ public Bool BootMHDIns(U8 drv_let, U8 *drv_list=NULL)
{
bd = drive->bd;
if (!FileFind(BOOT_DIR_OLDMBR_BIN_C,, FUF_JUST_FILES))
if (!FileFind(BOOT_DIR_OLDMBR_BIN,, FUF_JUST_FILES))
BootMHDOldRead(drv_let, drv_let);
_q = BMHD2_BLK_ARRAY;
@ -117,7 +117,7 @@ public Bool BootMHDIns(U8 drv_let, U8 *drv_list=NULL)
StrPrint(menu_ptr, "\n\r\n\rZealOS Boot Loader\n\r\n\r");
j = 0;
if (FileFind(BOOT_DIR_OLDMBR_BIN_C, &de, FUF_JUST_FILES))
if (FileFind(BOOT_DIR_OLDMBR_BIN, &de, FUF_JUST_FILES))
{
Free(de.full_name);
*_q++ = Clus2Blk(drive, de.clus);
@ -139,9 +139,9 @@ public Bool BootMHDIns(U8 drv_let, U8 *drv_list=NULL)
CatPrint(menu_ptr, "\n\rSelection:");
size = BMHD2_END - BMHD2_START;
FileWrite(BOOT_DIR_BOOTMHD2_BIN_C, BMHD2_START, size);
FileWrite(BOOT_DIR_BOOTMHD2_BIN, BMHD2_START, size);
if (!FileFind(BOOT_DIR_BOOTMHD2_BIN_C, &de, FUF_JUST_FILES))
if (!FileFind(BOOT_DIR_BOOTMHD2_BIN, &de, FUF_JUST_FILES))
"No Boot Loader Image\n";
else
{

View file

@ -30,10 +30,10 @@ _extern _HI_CALL I64 HiCall(U8 *machine_code);
_extern _HI_MEMCOPY U8 *HiMemCopy(U8 *dst, U8 *src, I64 count);
#help_index "Boot"
public U0 BootRAM(U8 *filename="::" BOOT_DIR_KERNEL_BIN_C)
{//Softboot Kernel.BIN file. No hardware reset.
public U0 BootRAM(U8 *filename="::" BOOT_DIR_KERNEL_ZXE)
{//Softboot Kernel.ZXE file. No hardware reset.
I64 size;
CKernel *hi_image, *lo_image = mem_boot_base - sizeof(CBinFile), reg *sys_ram_reboot;
CKernel *hi_image, *lo_image = mem_boot_base - sizeof(CZXE), reg *sys_ram_reboot;
do
if (!(hi_image = FileRead(filename, &size)))
return;

View file

@ -2,21 +2,21 @@
U0 LoadDocDefines()
{
CBinFile *bfh = mem_boot_base - sizeof(CBinFile);
CZXE *zxe = mem_boot_base - sizeof(CZXE);
DefinePrint("DD_OS_NAME_VERSION", "ZealOS V%0.2f", sys_os_version);
DefinePrint("DD_ZEALOS_AGE", "%0.1f", (Now - Str2Date("9/1/2019")) / ToF64(1 << 32) / CDATE_YEAR_DAYS);
DefinePrint("DD_TEMPLEOS_AGE", "%0.1f", (Str2Date("8/11/2018") - Str2Date("8/1/2003")) / ToF64(1 << 32) / CDATE_YEAR_DAYS);
DefinePrint("DD_KERNEL", "%08X", bfh);
bfh(I64) += bfh->file_size - 1;
DefinePrint("DD_KERNEL_END", "%08X", bfh);
DefinePrint("DD_KERNEL", "%08X", zxe);
zxe(I64) += zxe->file_size - 1;
DefinePrint("DD_KERNEL_END", "%08X", zxe);
//$LK,"DD_BOOT_HIGH_LOC_DVD",A="FF:::/System/Boot/BootDVD.ZC,DD_BOOT_HIGH_LOC_DVD"$
$TR,"LineRep"$
$ID,2$DefinePrint("DD_ZEALOS_LOC","97,294");
$ID,-2$
$ID,-2$
DefinePrint("DD_MP_VECT", "%08X", MP_VECT_ADDR);
DefinePrint("DD_MP_VECT_END", "%08X", MP_VECT_ADDR + COREAP_16BIT_INIT_END - COREAP_16BIT_INIT - 1);

View file

@ -427,7 +427,7 @@ public U0 MapFileLoad(U8 *filename)
FileExtRemove(absname);
if (absname[1] == ':' && StrLen(absname) > 2 && (tmph = HashSingleTableFind(absname + 2, Fs->hash_table, HTT_MODULE)))
base = tmph(CHashGeneric *)->user_data0 + sizeof(CBinFile);
base = tmph(CHashGeneric *)->user_data0 + sizeof(CZXE);
if (!doc) return;
doc_e = doc->head.next;

View file

@ -1,6 +1,6 @@
Cd(__DIR__);;
#include "BinRep"
#include "ZXERep"
#include "SysRep"
#include "CPURep"
#include "Diff"

View file

@ -221,12 +221,12 @@ public U0 MemRep()
I64 i;
CTask *task;
CCPU *c;
CBinFile *bfh = mem_boot_base - sizeof(CBinFile);
CZXE *zxe = mem_boot_base - sizeof(CZXE);
bfh(I64) += bfh->file_size - 1;
zxe(I64) += zxe->file_size - 1;
"$$BLACK$$Low Memory\t:00100000$$FG$$\n$$ID,2$$";
"Kernel\t:%08X-%08X\n", mem_boot_base - sizeof(CBinFile), bfh;
"Kernel\t:%08X-%08X\n", mem_boot_base - sizeof(CZXE), zxe;
"$$ID,-2$$$$BLACK$$High Memory\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;

View file

@ -1,6 +1,6 @@
#help_index "Compiler"
DefineListLoad("ST_BIN_FILE_TYPES", "END\0"
DefineListLoad("ST_ZXE_FILE_TYPES", "END\0"
" \0"
"REL_I0\0"
"IMM_U0\0"
@ -24,22 +24,22 @@ DefineListLoad("ST_BIN_FILE_TYPES", "END\0"
"ZEROED_DATA_HEAP\0"
"MAIN");
public Bool BinRep(U8 *filename)
{//Reports imports, exports, etc for a .BIN file
public Bool ZXERep(U8 *filename)
{//Reports imports, exports, etc for a .ZXE file
//See $LK,"Patch Table Generation",A="FF:::/Compiler/CMain.ZC,IET_ABS_ADDR"$ and $LK,"Load",A="MN:Load"$().
U8 *fbuf, *ptr, *sptr, *absname;
I64 i, j, size, etype;
Bool res = FALSE;
CBinFile *bf;
CZXE *zxe;
CHashExport *saved_hash_ptr = NULL;
fbuf = ExtDefault(filename, "BIN");
fbuf = ExtDefault(filename, "ZXE");
if (!(bf = FileRead(fbuf, &size)))
if (!(zxe = FileRead(fbuf, &size)))
goto br_done1;
if (bf->bin_signature != BIN_SIGNATURE_VAL)
if (zxe->signature != ZXE_SIGNATURE_VAL)
{
"Not a ZealC Binary File.\n";
"Not a ZealC Executable file.\n";
goto br_done2;
}
@ -52,18 +52,18 @@ public Bool BinRep(U8 *filename)
else
"NO MODULE NAME\n";
if (bf->org != INVALID_PTR)
" ORG:%X\n", bf->org;
if (zxe->org != INVALID_PTR)
" ORG:%X\n", zxe->org;
" MODULE_ALIGN:%X\n", 1 << bf->module_align_bits;
" MODULE_ALIGN:%X\n", 1 << zxe->module_align_bits;
ptr = bf(U8 *) + bf->patch_table_offset;
ptr = zxe(U8 *) + zxe->patch_table_offset;
while (etype = *ptr++)
{
i = *ptr(U32 *)++;
sptr = ptr;
ptr += StrLen(sptr) + 1;
"$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_BIN_FILE_TYPES", sptr, i;
"$$LTCYAN$$%16Z:$$GREEN$$%s$$FG$$:%X ", etype, "ST_ZXE_FILE_TYPES", sptr, i;
switch (etype)
{
case IET_REL_I0 ... IET_IMM_I64:
@ -98,7 +98,7 @@ public Bool BinRep(U8 *filename)
res = TRUE;
Free(absname);
br_done2:
Free(bf);
Free(zxe);
br_done1:
Free(fbuf);