Screen resolution portion added to Kernel config

removed staff mode
This commit is contained in:
xmm15 2020-02-19 20:08:38 -06:00
parent 8fe695955a
commit 8e572c4e67
14 changed files with 278 additions and 255 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
//Make Your own Distro by #include-ing this file.
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n\n\n"
#define STD_DISTRO_DVD_CONFIG "TB\nScale2Mem(2048,0x40000)\nT\n\n1024\n768\n\n\n"
U0 MakeMyISO(U8 *_out_iso_filename)
{//Does everything with current drive.
@ -15,7 +15,7 @@ U0 MakeMyISO(U8 *_out_iso_filename)
DirMake("/Distro");
In(STD_DISTRO_DVD_CONFIG);
BootDVDIns;
 BootDVDIns;
Copy("/*","/Distro");
Del("/Distro/" KERNEL_BIN_C);

View File

@ -1,8 +1,8 @@
In("CC\n\n1\n\n\n\n");
In("CC\n\n1\n\n5\n\n\n");
BootHDIns;
"\n\nSuccessful?";
if(YorN)
{
 Once("#include\"DoDistro\";;if(DriveIsWritable){Del(\"~/Registry.CC\");OutU16(0x4004, 0x3400);}");
Once("#include\"DoDistro\";;if(DriveIsWritable){Del(\"~/Registry.CC\");OutU16(0x4004, 0x3400);}");
Reboot;
}

13
src/Home/MakeHome.CC Executable file
View File

@ -0,0 +1,13 @@
Cd(__DIR__);;
//If these are not present in /Home, it uses the version in the root dir. You
//can make your own, modified, version of these files in your /Home directory.
#include "~/HomeLocalize"
#include "/Zenith/Boot/MakeBoot"
#include "/Zenith/Utils/MakeUtils"
#include "~/HomeWrappers"
MapFileLoad("::/Kernel/Kernel");
MapFileLoad("::/Compiler/Compiler");
#include "~/HomeKeyPlugIns"
#include "~/HomeSys"
Cd("..");;

Binary file not shown.

View File

@ -1,48 +1,42 @@
//This is run in a $LK,"#exe",A="FF:::/Kernel/Kernel.PRJ,KConfig"${}.
U8 *kernel_config_options="MemInit\0HeapInit\0VarInit\0StaffMode\0"
"HomeDir\0NoMP\0TextMode\0DontProbe\0MountIDEAuto\0DebugDistro\0Help\0";
U8 *kernel_config_options="MemInit\0HeapInit\0VarInit\0HomeDir\0NoMP\0DontProbe\0MountIDEAuto\0DebugDistro\0Help";
#define CONFIG_MEM_INIT 0
#define CONFIG_HEAP_INIT 1
#define CONFIG_HEAP_INIT 1
#define CONFIG_VAR_INIT 2
#define CONFIG_STAFF_MODE 3
#define CONFIG_HOME_DIR 4
#define CONFIG_NO_MP 5
#define CONFIG_TEXT_MODE 6
#define CONFIG_DONT_PROBE 7
#define CONFIG_MOUNT_IDE_AUTO 8
#define CONFIG_DEBUG_DISTRO 9
#define CONFIG_OPTIONS_NUM 10
#define CONFIG_HOME_DIR 3
#define CONFIG_NO_MP 4
#define CONFIG_DONT_PROBE 5
#define CONFIG_MOUNT_IDE_AUTO 6
#define CONFIG_DEBUG_DISTRO 7
#define CONFIG_OPTIONS_NUM 8
#define CONFIG_HELP 10
#define CONFIG_HELP 8
class CKConfig
{
U8 *disk_cache_size_exp;
CDoc *add_dev;
U8 *debug_distro_file,*debug_distro_start;
U8 *debug_distro_file, *debug_distro_start;
U8 *home_dir;
U16 screen_width, screen_height;
Bool opts[CONFIG_OPTIONS_NUM];
U8 mem_init_val,heap_init_val,var_init_val,
boot_drive_let,mount_ide_auto_hd_let,mount_ide_auto_cd_let;
U8 mem_init_val, heap_init_val, var_init_val, boot_drive_let, mount_ide_auto_hd_let, mount_ide_auto_cd_let;
};
CDoc *KConfigAddDev(CKConfig *c)
{
I64 ch;
CDoc *doc=DocNew;
"\n\nIn anticipation of the drives you will\n"
"define shortly, enter the drive letter\n"
"of the drive with the account directory.\n"
"\n($$PURPLE$$<ENTER>$$FG$$ for cur drv) Boot Drive:";
"\n\nIn anticipation of the drives you will define shortly, enter the drive letter\n"
"of the drive with your Home directory. ($$PURPLE$$<ENTER>$$FG$$ for cur drv) Boot Drive:";
ch=Letter2Letter(GetChar);
if ('A'<=ch<='Z')
c->boot_drive_let=ch;
if ('A' <= ch <= 'Z')
c->boot_drive_let = ch;
else
c->boot_drive_let=Drive2Letter(Fs->cur_dv);
"\n\n$$BK,1$$$$PURPLE$$Mount drives so they will be present when "
"you boot.$$FG$$$$BK,0$$\n";
c->boot_drive_let = Drive2Letter(Fs->cur_dv);
"\n\n$$BK,1$$$$PURPLE$$Mount drives so they will be present when you boot.$$FG$$$$BK,0$$\n";
Mount2(c->boot_drive_let,doc,FALSE);
return doc;
}
@ -70,7 +64,6 @@ U0 KConfigOptions(CKConfig *c)
"$$PURPLE$$VarInit$$FG$$ Initializes glbl var memory to a val.\n"
"$$PURPLE$$HomeDir$$FG$$ Set home dir.\n"
"$$PURPLE$$NoMP$$FG$$ No multicore.\n"
"$$PURPLE$$TextMode$$FG$$ Text Mode (requires hard reboot).\n"
"$$PURPLE$$DontProbe$$FG$$ Just prompt CD/DVD ports, don't probe.\n"
"$$PURPLE$$MountIDEAuto$$FG$$ Auto Mount IDE drives to 'C' and 'T'.\n"
"$$PURPLE$$DebugDistro$$FG$$ Include RAM Drive in Kernel.BIN.\n"
@ -150,15 +143,30 @@ U0 KConfigOptions(CKConfig *c)
CKConfig *KConfigNew()
{
I64 resolution_num;
CKConfig *c=CAlloc(sizeof(CKConfig));
c->add_dev=KConfigAddDev(c);
c->home_dir=StrNew("::/Home");
c->disk_cache_size_exp=GetStr(
"Disk Cache Size in Bytes,\n"
"gets rounded-up funny,\n"
"($$PURPLE$$<ENTER>$$FG$$ will use default.):",
"Scale2Mem(0x80000,0x8000000)");
c->add_dev = KConfigAddDev(c);
c->home_dir = StrNew("::/Home");
VideoRep(FALSE);
resolution_num = GetI64("Enter list number of desired resolution,"
"or desired width. ($$PURPLE$$<ENTER>$$FG$$ for auto maximum): ",,1);
if(resolution_num <= VBE_MODES_NUM)
{
c->screen_width = sys_vbe_modes[resolution_num - 1].width;
c->screen_height = sys_vbe_modes[resolution_num - 1].height;
}
else
{
c->screen_width = resolution_num;
c->screen_height = GetI64("Enter Height: ",,0);
}
c->disk_cache_size_exp = GetStr("Disk Cache Size in Bytes, gets rounded-up funny,\n"
"($$PURPLE$$<ENTER>$$FG$$ will use default.):",
"Scale2Mem(0x80000,0x8000000)");
KConfigOptions(c);
return c;
}

View File

@ -60,8 +60,12 @@ TEMP_VBE_MODE: DU8 sizeof(CVBEMode) DUP(0);
MAX_VBE_MODE: DU8 sizeof(CVBEModeShort) DUP(0);
MAX_SCREEN_HEIGHT: DU16 0;
SCREEN_WIDTH: DU16 1024;
SCREEN_HEIGHT: DU16 768;
#exe
{StreamPrint(
"SCREEN_WIDTH: DU16 %d;"
"SCREEN_HEIGHT: DU16 %d;",
kernel_config->screen_width, kernel_config->screen_height);
};
//************************************
CORE0_16BIT_INIT::
//EAX is $LK,"SYS_BOOT_SRC",A="FF:::/Kernel/KStart16.CC,[SYS_BOOT_SRC]"$. (Val passed from boot blk, $LK,"BootHD",A="FF:::/Zenith/Boot/BootHD.CC,BOOT_SRC_HARDDRIVE"$, $LK,"BootDVD",A="FF:::/Zenith/Boot/BootDVD.CC,BOOT_SRC_DVD"$, & $LK,"BootRAM",A="FF:::/Zenith/Boot/BootRAM.CC,BOOT_SRC_RAM"$.)
@ -211,7 +215,7 @@ GET_IP: POP BX
INT 0x10
CMP AX, 0x004F
JNE @@10

BTS U32 [SYS_RUN_LEVEL],RLf_VESA
@@10:

View File

@ -12,7 +12,7 @@ MEM_1GIG_NUM:: DU64 0;
MEM_512GIG_NUM:: DU64 0;
MEM_PML2:: DU64 0;
MEM_PML3:: DU64 0;
MEM_PML4:: DU64 0;
MEM_PML4:: DU64 0;
#exe {
StreamPrint(
@ -21,12 +21,10 @@ MEM_PML3:: DU64 0;
"SYS_HEAP_INIT_FLAG:: DU8 %d;"
"SYS_HEAP_INIT_VAL:: DU8 %d;"
"SYS_VAR_INIT_FLAG:: DU8 %d;"
"SYS_VAR_INIT_VAL:: DU8 %d;"
"SYS_STAFF_MODE_FLAG:: DU8 %d;",
"SYS_VAR_INIT_VAL:: DU8 %d;",
kernel_config->opts[CONFIG_MEM_INIT], kernel_config->mem_init_val,
kernel_config->opts[CONFIG_HEAP_INIT],kernel_config->heap_init_val,
kernel_config->opts[CONFIG_VAR_INIT], kernel_config->var_init_val,
kernel_config->opts[CONFIG_STAFF_MODE]);
kernel_config->opts[CONFIG_VAR_INIT], kernel_config->var_init_val);
};
SYS_HEAP_DEBUG_FLAG:: DU8 _CONFIG_HEAP_DEBUG;

View File

@ -4,9 +4,6 @@ U0 Exit()
LBts(&Fs->task_flags,TASKf_KILL_AFTER_DEBUG);
G;
} else {
if (sys_staff_mode_flag)
ZenithLog("%p:%p:%p:%p:%p:%p\n",Caller(0),Caller(1),Caller(2),Caller(3),
Caller(4),Caller(5),Caller(6),Caller(7));
if (!Gs->num && !IsDebugMode)
SingleUser(OFF);
Fs->rflags=GetRFlags;
@ -225,7 +222,7 @@ I64 TaskInit(CTask *task,I64 stack_size)
task->title_src =TTS_CONST;
task->win_left =1;
task->win_right =text.cols-2;
task->win_top =text.rows / 5 + 3;
task->win_top =text.rows / 5 + 3;
task->win_bottom =text.rows-2;
if (blkdev.home_dir) {//Beware Zenith $LK,"TaskInit",A="FF:::/Kernel/KStart64.CC,TaskInit"$. I guess ok until $LK,"DiskChange",A="FF:::/Kernel/KMain.CC,DiskChange"$().

File diff suppressed because one or more lines are too long

View File

@ -164,7 +164,6 @@ _extern SYS_HEAP_INIT_FLAG U8 sys_heap_init_flag;
_extern SYS_HEAP_INIT_VAL U8 sys_heap_init_val;
_extern SYS_MEM_INIT_FLAG U8 sys_mem_init_flag;
_extern SYS_MEM_INIT_VAL U8 sys_mem_init_val;
_extern SYS_STAFF_MODE_FLAG U8 sys_staff_mode_flag;
_extern SYS_VAR_INIT_FLAG U8 sys_var_init_flag;
_extern SYS_VAR_INIT_VAL U8 sys_var_init_val;

View File

@ -35,7 +35,7 @@ U0 VMInstallDrive(CTask *task,U8 drv_let,
XTalkWait(task,"C\np%d\n",ata_drive->num);
if (atapi_drive)
XTalkWait(task,"Tp%d\n",atapi_drive->num);
XTalkWait(task,"\n\n\n"); //Exit Drives,Disk Cache,Options
XTalkWait(task,"\n1024\n768\n\n\n"); //Exit Drives, set Screen Resolution, skip Disk Cache and Options
}
U0 VMInstallWiz()
@ -73,7 +73,7 @@ U0 RegularInstallWiz()
I64 unit,drv_let;
U8 *st,*base0,*base1;
CATARep *head=NULL,*tmpha;
I64 ch,num_hints;
I64 ch,num_hints,res_num;
CTask *task;
"\nIt's normal for this to freeze for a moment or two.\n";
@ -149,9 +149,10 @@ U0 RegularInstallWiz()
Format(drv_let,,FALSE,FSt_REDSEA);
}
InstallDrive(drv_let);
XTalkWait(task,"BootHDIns('%C');\n\nB\n0x20000\n"
"C\ns%s\n%s\n%C\n\n\n", //Exit Drives,Disk Cache,Options
drv_let,base0,base1,'0'+unit);
XTalkWait(task,"BootHDIns('%C');\n\nB\n0x20000\nC\ns%s\n%s\n%C\n",drv_let,base0,base1,'0'+unit);
VideoRep;
res_num = GetI64("Enter desired list num ($$PURPLE$$<ENTER>$$FG$$ for max res): ",,1);
 XTalkWait(task, "%d\n\n\n", res_num); //skip through Disk Cache, Options
"$$RED$$Install Master Boot loader?$$FG$$";
if (YorN) {
'\n';

Binary file not shown.