mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 00:06:35 +00:00
293 lines
33 KiB
HTML
Executable file
293 lines
33 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.07">
|
|
<style type="text/css">
|
|
body {background-color:#1f1f1f;}
|
|
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
|
|
.cF1{color:#4f84a6;background-color:#1f1f1f;}
|
|
.cF2{color:#73a255;background-color:#1f1f1f;}
|
|
.cF3{color:#297582;background-color:#1f1f1f;}
|
|
.cF4{color:#b34f4b;background-color:#1f1f1f;}
|
|
.cF5{color:#8a52c3;background-color:#1f1f1f;}
|
|
.cF6{color:#b7822f;background-color:#1f1f1f;}
|
|
.cF7{color:#444444;background-color:#1f1f1f;}
|
|
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
|
|
.cF9{color:#94bfde;background-color:#1f1f1f;}
|
|
.cFA{color:#a1ce97;background-color:#1f1f1f;}
|
|
.cFB{color:#6db4be;background-color:#1f1f1f;}
|
|
.cFC{color:#e88e88;background-color:#1f1f1f;}
|
|
.cFD{color:#ca94e8;background-color:#1f1f1f;}
|
|
.cFE{color:#d4b475;background-color:#1f1f1f;}
|
|
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>SysGlobalsInit</span><span class=cF0>()
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> </span><span class=cF9>I64</span><span class=cF0> i, j;
|
|
<a name="l4"></a> </span><span class=cF9>CRAXRBXRCXRDX</span><span class=cF0> regs;
|
|
<a name="l5"></a>
|
|
<a name="l6"></a> </span><span class=cF5>CPUId</span><span class=cF0>(</span><span class=cFE>0x1</span><span class=cF0>, &regs);
|
|
<a name="l7"></a> </span><span class=cFB>sys_cache_line_width</span><span class=cF0> = regs.rbx.u8[</span><span class=cFE>1</span><span class=cF0>] * </span><span class=cFE>8</span><span class=cF0>;
|
|
<a name="l8"></a>
|
|
<a name="l9"></a> </span><span class=cFB>sys_focus_task</span><span class=cF0> = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l10"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(&</span><span class=cFB>sys_macro_head</span><span class=cF0>);
|
|
<a name="l11"></a>
|
|
<a name="l12"></a> </span><span class=cFB>blkdev</span><span class=cF0>.default_iso_filename = </span><span class=cF5>SysStrNew</span><span class=cF0>(</span><span class=cF3>DEFAULT_ISO_FILENAME</span><span class=cF0>);
|
|
<a name="l13"></a> </span><span class=cFB>blkdev</span><span class=cF0>.default_iso_c_filename = </span><span class=cF5>SysStrNew</span><span class=cF0>(</span><span class=cF3>DEFAULT_ISO_C_FILENAME</span><span class=cF0>);
|
|
<a name="l14"></a> </span><span class=cFB>blkdev</span><span class=cF0>.tmp_filename = </span><span class=cF5>SysStrNew</span><span class=cF0>(</span><span class=cF6>"~/Tmp.DD"</span><span class=cF0>);
|
|
<a name="l15"></a> </span><span class=cFB>blkdev</span><span class=cF0>.dvd_boot_is_good = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l16"></a>
|
|
<a name="l17"></a> #</span><span class=cF1>exe</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_config->mount_ide_auto_hd_let)
|
|
<a name="l20"></a> kernel_config->mount_ide_auto_hd_let = </span><span class=cF6>'C'</span><span class=cF0>;
|
|
<a name="l21"></a>
|
|
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_config->mount_ide_auto_cd_let)
|
|
<a name="l23"></a> kernel_config->mount_ide_auto_cd_let = </span><span class=cF6>'T'</span><span class=cF0>;
|
|
<a name="l24"></a>
|
|
<a name="l25"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.first_hd_drive_let = %d;"</span><span class=cF0>, kernel_config->mount_ide_auto_hd_let);
|
|
<a name="l26"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.first_dvd_drive_let = %d;"</span><span class=cF0>, kernel_config->mount_ide_auto_cd_let);
|
|
<a name="l27"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l28"></a>
|
|
<a name="l29"></a> </span><span class=cF5>DebugMode</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>);
|
|
<a name="l30"></a>
|
|
<a name="l31"></a> </span><span class=cFB>rev_bits_table</span><span class=cF0> = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cFE>256</span><span class=cF0>);
|
|
<a name="l32"></a>
|
|
<a name="l33"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFE>256</span><span class=cF0>; i++)
|
|
<a name="l34"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j < </span><span class=cFE>8</span><span class=cF0>; j++)
|
|
<a name="l35"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&i, </span><span class=cFE>7</span><span class=cF0> - j</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l36"></a> </span><span class=cF5>Bts</span><span class=cF0>(</span><span class=cFB>rev_bits_table</span><span class=cF0> + i, j);
|
|
<a name="l37"></a>
|
|
<a name="l38"></a> </span><span class=cFB>ext</span><span class=cF0> = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF3>EXT_EXTS_NUM</span><span class=cF0> * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l39"></a> </span><span class=cFB>fp_getstr2</span><span class=cF0> = &</span><span class=cFD>SysGetStr2</span><span class=cF0>;
|
|
<a name="l40"></a> </span><span class=cFD>KeyDevInit</span><span class=cF0>;
|
|
<a name="l41"></a>
|
|
<a name="l42"></a> #</span><span class=cF1>exe</span><span class=cF0>
|
|
<a name="l43"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l44"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.boot_drive_let = '%C';"</span><span class=cF0>, kernel_config->boot_drive_let);
|
|
<a name="l45"></a>
|
|
<a name="l46"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"#exe{ Option(OPTf_WARN_PAREN, OFF); }"</span><span class=cF0>);
|
|
<a name="l47"></a>
|
|
<a name="l48"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"DiskCacheInit(%s);"</span><span class=cF0>, kernel_config->disk_cache_size_exp);
|
|
<a name="l49"></a>
|
|
<a name="l50"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"#exe{ Option(OPTf_WARN_PAREN, ON); }"</span><span class=cF0>);
|
|
<a name="l51"></a> </span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l52"></a>
|
|
<a name="l53"></a> </span><span class=cFD>pow10_I64</span><span class=cF0> = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF1>F64</span><span class=cF7>)</span><span class=cF0> * </span><span class=cF7>(</span><span class=cFE>308</span><span class=cF0> + </span><span class=cFE>308</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l54"></a> </span><span class=cF1>for</span><span class=cF0> (i = -</span><span class=cFE>308</span><span class=cF0>; i < </span><span class=cFE>309</span><span class=cF0>; i++)
|
|
<a name="l55"></a> </span><span class=cFD>pow10_I64</span><span class=cF0>[i + </span><span class=cFE>309</span><span class=cF0>] = </span><span class=cF5>Pow10</span><span class=cF0>(i);
|
|
<a name="l56"></a>
|
|
<a name="l57"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(&</span><span class=cFB>screencast</span><span class=cF0>.sound_head);
|
|
<a name="l58"></a> </span><span class=cFB>screencast</span><span class=cF0>.t0_now = </span><span class=cF5>Now</span><span class=cF0>;
|
|
<a name="l59"></a> </span><span class=cFB>screencast</span><span class=cF0>.t0_tS = </span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l60"></a> </span><span class=cFB>screencast</span><span class=cF0>.ona = </span><span class=cFB>screencast</span><span class=cF0>.sound_head.ona = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l61"></a>
|
|
<a name="l62"></a> </span><span class=cF5>ProgressBarsReset</span><span class=cF0>;
|
|
<a name="l63"></a>
|
|
<a name="l64"></a> </span><span class=cF5>QueueInit</span><span class=cF0>(&</span><span class=cFB>dev</span><span class=cF0>.pci_head);
|
|
<a name="l65"></a> </span><span class=cFB>dev</span><span class=cF0>.mem64_ptr = </span><span class=cFB>mem_mapped_space</span><span class=cF0>;
|
|
<a name="l66"></a>
|
|
<a name="l67"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>sys_boot_src</span><span class=cF0>.u8[</span><span class=cFE>0</span><span class=cF0>] != </span><span class=cF3>BOOT_SRC_RAM</span><span class=cF0>)
|
|
<a name="l68"></a> </span><span class=cF7>{</span><span class=cF2>//framebuffer pointer is already linear</span><span class=cF0>
|
|
<a name="l69"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(&</span><span class=cFB>sys_vbe_info</span><span class=cF0>.video_modes);
|
|
<a name="l70"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(&</span><span class=cFB>sys_vbe_info</span><span class=cF0>.oem);
|
|
<a name="l71"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(&</span><span class=cFB>sys_vbe_info</span><span class=cF0>.vendor);
|
|
<a name="l72"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(&</span><span class=cFB>sys_vbe_info</span><span class=cF0>.product_name);
|
|
<a name="l73"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(&</span><span class=cFB>sys_vbe_info</span><span class=cF0>.product_revision);
|
|
<a name="l74"></a> </span><span class=cF5>Seg2Linear</span><span class=cF0>(</span><span class=cFD>SYS_FONT_PTR</span><span class=cF0>);
|
|
<a name="l75"></a> </span><span class=cFB>sys_vbe_info</span><span class=cF0>.software_revision = </span><span class=cFD>Bcd2Binary</span><span class=cF0>(</span><span class=cFB>sys_vbe_info</span><span class=cF0>.software_revision);
|
|
<a name="l76"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l77"></a>
|
|
<a name="l78"></a> </span><span class=cFB>debug</span><span class=cF0>.fun_seg_cache = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF3>FUN_SEG_CACHE_SIZE</span><span class=cF0> * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CFunSegCache</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l79"></a> </span><span class=cFB>debug</span><span class=cF0>.int_fault_code = </span><span class=cFD>IntFaultHandlersNew</span><span class=cF0>;
|
|
<a name="l80"></a>}
|
|
<a name="l81"></a>
|
|
<a name="l82"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>SysGrInit</span><span class=cF0>()
|
|
<a name="l83"></a>{
|
|
<a name="l84"></a> </span><span class=cF9>I64</span><span class=cF0> i, j;
|
|
<a name="l85"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cFE>256</span><span class=cF0> * </span><span class=cFE>8</span><span class=cF0>); </span><span class=cF2>//256 U64s</span><span class=cF0>
|
|
<a name="l86"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.aux_font, *</span><span class=cFD>SYS_FONT_PTR</span><span class=cF7>(</span><span class=cF9>U32</span><span class=cF7>)</span><span class=cF0>, </span><span class=cFE>256</span><span class=cF0> * </span><span class=cFE>8</span><span class=cF0>);
|
|
<a name="l87"></a>
|
|
<a name="l88"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cFE>0</span><span class=cF0>; i < </span><span class=cFE>256</span><span class=cF0>; i++)
|
|
<a name="l89"></a> </span><span class=cF1>for</span><span class=cF0> (j = </span><span class=cFE>0</span><span class=cF0>; j < </span><span class=cFE>8</span><span class=cF0>; j++)
|
|
<a name="l90"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font[i].u8[j] = </span><span class=cFB>rev_bits_table</span><span class=cF0>[</span><span class=cFB>text</span><span class=cF0>.aux_font[i].u8[j]];
|
|
<a name="l91"></a>
|
|
<a name="l92"></a> </span><span class=cFB>text</span><span class=cF0>.font = </span><span class=cFD>sys_font_std</span><span class=cF0>;
|
|
<a name="l93"></a>
|
|
<a name="l94"></a> </span><span class=cF2>//patch some chars</span><span class=cF0>
|
|
<a name="l95"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font[</span><span class=cFE>10</span><span class=cF0>] = </span><span class=cFB>text</span><span class=cF0>.font[</span><span class=cFE>10</span><span class=cF0>]; </span><span class=cF2>//"Return" symbol </span><span class=cF0>
|
|
<a name="l96"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font[</span><span class=cFE>255</span><span class=cF0>] = </span><span class=cFB>text</span><span class=cF0>.font[</span><span class=cFE>255</span><span class=cF0>]; </span><span class=cF2>//Block symbol .</span><span class=cF0>
|
|
<a name="l97"></a>
|
|
<a name="l98"></a> </span><span class=cF1>for</span><span class=cF0> (i = </span><span class=cF6>'.'</span><span class=cF0>; i < </span><span class=cF6>'.'</span><span class=cF0>; i++)
|
|
<a name="l99"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font[i] = </span><span class=cFB>text</span><span class=cF0>.font[i];
|
|
<a name="l100"></a>
|
|
<a name="l101"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[</span><span class=cFE>2</span><span class=cF0>] (</span><span class=cF9>I64</span><span class=cF0>) = </span><span class=cF6>'........'</span><span class=cF0>;
|
|
<a name="l102"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[</span><span class=cFE>10</span><span class=cF0>](</span><span class=cF9>U32</span><span class=cF0>) = </span><span class=cF6>'....'</span><span class=cF0>;
|
|
<a name="l103"></a>
|
|
<a name="l104"></a> </span><span class=cFB>text</span><span class=cF0>.cols = </span><span class=cFB>sys_vbe_mode</span><span class=cF0>.width / </span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l105"></a> </span><span class=cFB>text</span><span class=cF0>.rows = </span><span class=cFB>sys_vbe_mode</span><span class=cF0>.height / </span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l106"></a>
|
|
<a name="l107"></a> </span><span class=cFB>text</span><span class=cF0>.screen_size = </span><span class=cFB>sys_vbe_mode</span><span class=cF0>.width * </span><span class=cFB>sys_vbe_mode</span><span class=cF0>.height;
|
|
<a name="l108"></a> </span><span class=cFB>text</span><span class=cF0>.buffer_size = </span><span class=cFB>text</span><span class=cF0>.screen_size * </span><span class=cFE>4</span><span class=cF0>; </span><span class=cF2>//buffer for 32-bit, but only 16 colors now.</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cFB>text</span><span class=cF0>.raw_screen = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.buffer_size);
|
|
<a name="l110"></a> </span><span class=cFB>text</span><span class=cF0>.fb_alias = </span><span class=cFB>sys_vbe_mode</span><span class=cF0>.framebuffer;
|
|
<a name="l111"></a>
|
|
<a name="l112"></a> </span><span class=cF5>MemSetU32</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.fb_alias, </span><span class=cF3>BLACK32</span><span class=cF0>, </span><span class=cFB>text</span><span class=cF0>.screen_size);
|
|
<a name="l113"></a> </span><span class=cFB>text</span><span class=cF0>.vga_alias = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.rows * </span><span class=cFB>text</span><span class=cF0>.cols * </span><span class=cFE>8</span><span class=cF0>);
|
|
<a name="l114"></a>}
|
|
<a name="l115"></a>
|
|
<a name="l116"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>TimerInit</span><span class=cF0>()
|
|
<a name="l117"></a>{</span><span class=cF2>//See </span><a href="https://zeal-operating-system.github.io/ZealOS/Doc/PIT.DD.html#l1"><span class=cF4>::/Doc/PIT.DD</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l118"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>PIT_CMD</span><span class=cF0>, </span><span class=cF3>PIT_CMDF_CHANNEL0</span><span class=cF0> | </span><span class=cF3>PIT_CMDF_OPMODE_RATE_GEN</span><span class=cF0> | </span><span class=cF3>PIT_CMDF_ACCESS_WORD</span><span class=cF0>);
|
|
<a name="l119"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>PIT_0</span><span class=cF0>, </span><span class=cF3>SYS_TIMER0_PERIOD</span><span class=cF0>);
|
|
<a name="l120"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>PIT_0</span><span class=cF0>, </span><span class=cF3>SYS_TIMER0_PERIOD</span><span class=cF0> >> </span><span class=cFE>8</span><span class=cF0>);
|
|
<a name="l121"></a>}
|
|
<a name="l122"></a>
|
|
<a name="l123"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Reboot</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> format_ramdisks=</span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l124"></a>{</span><span class=cF2>//Hardware reset.</span><span class=cF0>
|
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (format_ramdisks)
|
|
<a name="l126"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DriveIsWritable</span><span class=cF7>(</span><span class=cF6>'A'</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l128"></a> </span><span class=cF5>Format</span><span class=cF0>(</span><span class=cF6>'A'</span><span class=cF0>,, </span><span class=cF3>FALSE</span><span class=cF0>, </span><span class=cF3>FSt_REDSEA</span><span class=cF0>);
|
|
<a name="l129"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DriveIsWritable</span><span class=cF7>(</span><span class=cF6>'B'</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l130"></a> </span><span class=cF5>Format</span><span class=cF0>(</span><span class=cF6>'B'</span><span class=cF0>,, </span><span class=cF3>FALSE</span><span class=cF0>, </span><span class=cF3>FSt_REDSEA</span><span class=cF0>);
|
|
<a name="l131"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
|
<a name="l133"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mp_count</span><span class=cF0> > </span><span class=cFE>1</span><span class=cF0>)
|
|
<a name="l134"></a> </span><span class=cF5>MPHalt</span><span class=cF0>;
|
|
<a name="l135"></a> *</span><span class=cFE>0x472</span><span class=cF0>(</span><span class=cF9>U16</span><span class=cF0> *) = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l136"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cFE>0x70</span><span class=cF0>, </span><span class=cFE>0x8F</span><span class=cF0>);
|
|
<a name="l137"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cFE>0x71</span><span class=cF0>, </span><span class=cFE>0x00</span><span class=cF0>);
|
|
<a name="l138"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cFE>0x70</span><span class=cF0>, </span><span class=cFE>0x00</span><span class=cF0>);
|
|
<a name="l139"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cFE>0x92</span><span class=cF0>, </span><span class=cF5>InU8</span><span class=cF7>(</span><span class=cFE>0x92</span><span class=cF7>)</span><span class=cF0> | </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l140"></a> </span><span class=cF5>SysHlt</span><span class=cF0>;
|
|
<a name="l141"></a>}
|
|
<a name="l142"></a>
|
|
<a name="l143"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>KMain</span><span class=cF0>()
|
|
<a name="l144"></a>{</span><span class=cF2>//Continued from </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KStart64.ZC.html#l50"><span class=cF4>KStart64.ZC</span></a><span class=cF0>
|
|
<a name="l145"></a> </span><span class=cF9>CBlkDev</span><span class=cF0> *bd;
|
|
<a name="l146"></a>
|
|
<a name="l147"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>PCSPKR</span><span class=cF0>, </span><span class=cF5>InU8</span><span class=cF7>(</span><span class=cF3>PCSPKR</span><span class=cF7>)</span><span class=cF0> & ~</span><span class=cFE>3</span><span class=cF0>); </span><span class=cF2>//Sound;</span><span class=cF0>
|
|
<a name="l148"></a> </span><span class=cFB>sys_task</span><span class=cF0> = </span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l149"></a> </span><span class=cFD>BlkPoolsInit</span><span class=cF0>;
|
|
<a name="l150"></a> </span><span class=cFD>SysGlobalsInit</span><span class=cF0>;
|
|
<a name="l151"></a> </span><span class=cFD>Mem32DevInit</span><span class=cF0>;
|
|
<a name="l152"></a> </span><span class=cFD>UncachedAliasAlloc</span><span class=cF0>;
|
|
<a name="l153"></a> </span><span class=cFD>LoadKernel</span><span class=cF0>;
|
|
<a name="l154"></a> </span><span class=cFD>SysGrInit</span><span class=cF0>;
|
|
<a name="l155"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->task_name, </span><span class=cF6>"System Task CPU00"</span><span class=cF0>);
|
|
<a name="l156"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->task_title, </span><span class=cF5>Fs</span><span class=cF0>->task_name);
|
|
<a name="l157"></a> </span><span class=cF5>Fs</span><span class=cF0>->title_src = </span><span class=cF3>TTS_TASK_NAME</span><span class=cF0>;
|
|
<a name="l158"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_right = </span><span class=cFB>text</span><span class=cF0>.cols - </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l159"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_top++;
|
|
<a name="l160"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>;
|
|
<a name="l161"></a>
|
|
<a name="l162"></a> </span><span class=cFD>SysDefinesLoad</span><span class=cF0>;
|
|
<a name="l163"></a> </span><span class=cFD>Core0Init</span><span class=cF0>;
|
|
<a name="l164"></a> </span><span class=cFD>IntInit1</span><span class=cF0>;
|
|
<a name="l165"></a>
|
|
<a name="l166"></a> </span><span class=cF2>//Before this point use </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.ZC.html#l129"><span class=cF4>Sound</span></a><span class=cF2>() and </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.ZC.html#l88"><span class=cF4>Busy</span></a><span class=cF2>()</span><span class=cF0>
|
|
<a name="l167"></a> </span><span class=cF2>//to debug. After this point, use </span><a href="https://zeal-operating-system.github.io/ZealOS/Kernel/KDebug.ZC.html#l244"><span class=cF4>RawPrint</span></a><span class=cF2>()</span><span class=cF0>
|
|
<a name="l168"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_RAW</span><span class=cF0>);
|
|
<a name="l169"></a> </span><span class=cF6>"\nZealOS V%0.2f\t%D %T\n"</span><span class=cF0>, </span><span class=cFB>sys_os_version</span><span class=cF0>, </span><span class=cFB>sys_compile_time</span><span class=cF0>, </span><span class=cFB>sys_compile_time</span><span class=cF0>;
|
|
<a name="l170"></a> </span><span class=cF6>"_________________________________\n\n"</span><span class=cF0>;
|
|
<a name="l171"></a>
|
|
<a name="l172"></a> </span><span class=cF6>"TimerInit;\n"</span><span class=cF0>;
|
|
<a name="l173"></a> </span><span class=cFD>TimerInit</span><span class=cF0>;
|
|
<a name="l174"></a>
|
|
<a name="l175"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>MemBIOSTotal</span><span class=cF0> < </span><span class=cF5>ToI64</span><span class=cF0> </span><span class=cF7>(</span><span class=cFE>0</span><span class=cF0>.</span><span class=cFE>95</span><span class=cF0> * </span><span class=cF3>MEM_MIN_MEG</span><span class=cF0> * </span><span class=cFE>0x100000</span><span class=cF7>)</span><span class=cF0> )
|
|
<a name="l176"></a> </span><span class=cF5>RawPrint</span><span class=cF0>(</span><span class=cFE>4000</span><span class=cF0>, </span><span class=cF6>"!!! Requires 256Meg of RAM Memory !!!"</span><span class=cF0>);
|
|
<a name="l177"></a>
|
|
<a name="l178"></a> </span><span class=cF6>"IntPICInit;\n"</span><span class=cF0>;
|
|
<a name="l179"></a> </span><span class=cFD>IntPICInit</span><span class=cF0>;
|
|
<a name="l180"></a> </span><span class=cF5>RFlagsSet</span><span class=cF0>(</span><span class=cF3>RFLAGG_NORMAL</span><span class=cF0>);
|
|
<a name="l181"></a> </span><span class=cF5>Busy</span><span class=cF0>(</span><span class=cFE>2000</span><span class=cF0>);
|
|
<a name="l182"></a> </span><span class=cF6>"IntInit2;\n"</span><span class=cF0>;
|
|
<a name="l183"></a> </span><span class=cFD>IntInit2</span><span class=cF0>;
|
|
<a name="l184"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_INTERRUPTS</span><span class=cF0>);
|
|
<a name="l185"></a>
|
|
<a name="l186"></a> </span><span class=cF6>"TimeCal;\n"</span><span class=cF0>;
|
|
<a name="l187"></a> </span><span class=cF5>TimeCal</span><span class=cF0>;
|
|
<a name="l188"></a>
|
|
<a name="l189"></a> </span><span class=cF6>"BlkDevsInitAll;\n"</span><span class=cF0>;
|
|
<a name="l190"></a> </span><span class=cFD>BlkDevsInitAll</span><span class=cF0>;
|
|
<a name="l191"></a> </span><span class=cF6>"\nDiskChange(':');\n"</span><span class=cF0>;
|
|
<a name="l192"></a> </span><span class=cF5>DiskChange</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>);
|
|
<a name="l193"></a>
|
|
<a name="l194"></a> #</span><span class=cF1>exe</span><span class=cF0>
|
|
<a name="l195"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l196"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"HomeSet(\"%s\");\n"</span><span class=cF0>
|
|
<a name="l197"></a> </span><span class=cF6>"blkdev.ins_port = %d;"</span><span class=cF0>,
|
|
<a name="l198"></a> kernel_config->home_dir,
|
|
<a name="l199"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_port);
|
|
<a name="l200"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l201"></a>
|
|
<a name="l202"></a> </span><span class=cF5>Gs</span><span class=cF0>->idle_task->cur_dv = </span><span class=cFB>blkdev</span><span class=cF0>.let_to_drive[*</span><span class=cFB>blkdev</span><span class=cF0>.home_dir - </span><span class=cF6>'A'</span><span class=cF0>];
|
|
<a name="l203"></a> </span><span class=cF5>DriveRep</span><span class=cF0>;
|
|
<a name="l204"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>blkdev</span><span class=cF0>.dvd_boot_is_good)
|
|
<a name="l205"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l206"></a> bd = </span><span class=cF5>Letter2BlkDev</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>);
|
|
<a name="l207"></a> </span><span class=cF1>if</span><span class=cF0> (bd->type == </span><span class=cF3>BDT_ATAPI</span><span class=cF0>)
|
|
<a name="l208"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_port = bd->port_num;
|
|
<a name="l209"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l210"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_BLKDEV</span><span class=cF0>);
|
|
<a name="l211"></a>
|
|
<a name="l212"></a> #</span><span class=cF1>exe</span><span class=cF0>
|
|
<a name="l213"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l214"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_config->opts[CONFIG_NO_MP])
|
|
<a name="l215"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"\"\\nCore0StartMP;\\n\\n\";"</span><span class=cF0>
|
|
<a name="l216"></a> </span><span class=cF6>"Core0StartMP;"</span><span class=cF0>
|
|
<a name="l217"></a> </span><span class=cF6>"LBts(&sys_run_level, RLf_MP);"</span><span class=cF0>);
|
|
<a name="l218"></a> </span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l219"></a>
|
|
<a name="l220"></a> </span><span class=cF6>"KbdMouseInit;\n"</span><span class=cF0>;
|
|
<a name="l221"></a> </span><span class=cF5>KbdMouseInit</span><span class=cF0>;
|
|
<a name="l222"></a> </span><span class=cF6>"MouseInit;\n"</span><span class=cF0>;
|
|
<a name="l223"></a> </span><span class=cF5>MouseInit</span><span class=cF0>;
|
|
<a name="l224"></a> </span><span class=cF6>"KbdInit;\n"</span><span class=cF0>;
|
|
<a name="l225"></a> </span><span class=cF5>KbdInit</span><span class=cF0>;
|
|
<a name="l226"></a> </span><span class=cF6>"Spawn(&MouseHardDriverInstall);\n\n"</span><span class=cF0>;
|
|
<a name="l227"></a> </span><span class=cF5>Spawn</span><span class=cF0>(&</span><span class=cF5>MouseHardDriverInstall</span><span class=cF0>);
|
|
<a name="l228"></a>
|
|
<a name="l229"></a> </span><span class=cF6>"Load(\"Compiler\");\n"</span><span class=cF0>;
|
|
<a name="l230"></a> </span><span class=cF5>Cd</span><span class=cF0>(</span><span class=cF6>"/Compiler"</span><span class=cF0>);
|
|
<a name="l231"></a> </span><span class=cF5>Load</span><span class=cF0>(</span><span class=cF6>"Compiler"</span><span class=cF0>, </span><span class=cF3>LDF_SILENT</span><span class=cF0>);
|
|
<a name="l232"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_COMPILER</span><span class=cF0>);
|
|
<a name="l233"></a>
|
|
<a name="l234"></a> </span><span class=cF5>DebugMode</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l235"></a> </span><span class=cFB>counts</span><span class=cF0>.time_stamp_freq_initial = </span><span class=cF5>TimeCal</span><span class=cF0>;
|
|
<a name="l236"></a> </span><span class=cF5>Cd</span><span class=cF0>(</span><span class=cF6>"/"</span><span class=cF0>);
|
|
<a name="l237"></a> </span><span class=cF1>try</span><span class=cF0>
|
|
<a name="l238"></a> </span><span class=cF5>ExeFile</span><span class=cF0>(</span><span class=cF6>"StartOS"</span><span class=cF0>); </span><span class=cF2>//Continues </span><a href="https://zeal-operating-system.github.io/ZealOS/StartOS.ZC.html#l1"><span class=cF4>/StartOS.ZC</span></a><span class=cF0>
|
|
<a name="l239"></a> </span><span class=cF1>catch</span><span class=cF0>
|
|
<a name="l240"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l241"></a> </span><span class=cF5>Raw</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>);
|
|
<a name="l242"></a> </span><span class=cF5>Silent</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l243"></a> </span><span class=cF5>GetOutOfDollar</span><span class=cF0>;
|
|
<a name="l244"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l245"></a> </span><span class=cF5>Debug</span><span class=cF0>;
|
|
<a name="l246"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l247"></a>
|
|
<a name="l248"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>, </span><span class=cF3>RLf_SYSTEM_SERVER</span><span class=cF0>);
|
|
<a name="l249"></a> </span><span class=cF5>ServerTaskCont</span><span class=cF0>; </span><span class=cF2>//Never to return</span><span class=cF0>
|
|
<a name="l250"></a>}
|
|
<a name="l251"></a>
|
|
<a name="l252"></a></span><span class=cF1>asm</span><span class=cF0>
|
|
<a name="l253"></a>{
|
|
<a name="l254"></a>
|
|
<a name="l255"></a> </span><span class=cF1>ALIGN</span><span class=cF0> </span><span class=cFE>16</span><span class=cF0>, </span><span class=cF3>OC_NOP</span><span class=cF0>
|
|
<a name="l256"></a></span><span class=cFD>SYS_KERNEL_END</span><span class=cF0>::
|
|
<a name="l257"></a>#</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l258"></a> </span><span class=cF1>if</span><span class=cF0> (kernel_config->opts[CONFIG_DEBUG_DISTRO])
|
|
<a name="l259"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"DU8 0x%X - (SYS_KERNEL_END-SYS_KERNEL + BOOT_RAM_BASE + sizeof(CBinFile)) DUP (0);"</span><span class=cF0>
|
|
<a name="l260"></a> </span><span class=cF6>"BINFILE \"%s\";"</span><span class=cF0>,
|
|
<a name="l261"></a> kernel_config->debug_distro_start, kernel_config->debug_distro_file);
|
|
<a name="l262"></a></span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l263"></a>
|
|
<a name="l264"></a>}
|
|
</span></pre></body>
|
|
</html>
|