270 lines
29 KiB
HTML
Executable File
270 lines
29 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="generator" content="TempleOS V5.03">
|
|
<meta name="viewport" content="width=device-width">
|
|
<link rel="stylesheet" href="/style/templeos.css">
|
|
<script src="/script/templeos.js"></script>
|
|
<style type="text/css">
|
|
.cF0{color:#000000;background-color:#ffffff;}
|
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
|
.cF8{color:#555555;background-color:#ffffff;}
|
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre id="content">
|
|
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>SysGlblsInit</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>CRAXRBCRCXRDX</span><span class=cF0> ee;
|
|
<a name="l5"></a>
|
|
<a name="l6"></a> </span><span class=cF5>CPUId</span><span class=cF0>(0x1,&ee);
|
|
<a name="l7"></a> </span><span class=cFB>sys_cache_line_width</span><span class=cF0>=ee.rbx.u8[1]*8;
|
|
<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>QueInit</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>.dft_iso_filename =</span><span class=cF5>AStrNew</span><span class=cF0>(</span><span class=cF3>DFT_ISO_FILENAME</span><span class=cF0>);
|
|
<a name="l13"></a> </span><span class=cFB>blkdev</span><span class=cF0>.dft_iso_c_filename =</span><span class=cF5>AStrNew</span><span class=cF0>(</span><span class=cF3>DFT_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>AStrNew</span><span class=cF0>(</span><span class=cF6>"~/Tmp.DD.Z"</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> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l17"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_cfg->mount_ide_auto_hd_let)
|
|
<a name="l18"></a> kernel_cfg->mount_ide_auto_hd_let=</span><span class=cF6>'C'</span><span class=cF0>;
|
|
<a name="l19"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_cfg->mount_ide_auto_cd_let)
|
|
<a name="l20"></a> kernel_cfg->mount_ide_auto_cd_let=</span><span class=cF6>'T'</span><span class=cF0>;
|
|
<a name="l21"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.first_hd_drv_let=%d;"</span><span class=cF0>,
|
|
<a name="l22"></a> kernel_cfg->mount_ide_auto_hd_let);
|
|
<a name="l23"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.first_dvd_drv_let=%d;"</span><span class=cF0>,
|
|
<a name="l24"></a> kernel_cfg->mount_ide_auto_cd_let);
|
|
<a name="l25"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l26"></a>
|
|
<a name="l27"></a> </span><span class=cF5>DbgMode</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>);
|
|
<a name="l28"></a> </span><span class=cFB>rev_bits_table</span><span class=cF0>=</span><span class=cF5>CAlloc</span><span class=cF0>(256);
|
|
<a name="l29"></a> </span><span class=cFB>set_bits_table</span><span class=cF0>=</span><span class=cF5>CAlloc</span><span class=cF0>(256);
|
|
<a name="l30"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<256;i++)
|
|
<a name="l31"></a> </span><span class=cF1>for</span><span class=cF0> (j=0;j<8;j++) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l32"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&i,7-j</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF5>LBts</span><span class=cF0>(</span><span class=cFB>rev_bits_table</span><span class=cF0>+i,j);
|
|
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&i,j</span><span class=cF7>)</span><span class=cF0>) </span><span class=cFB>set_bits_table</span><span class=cF0>[i]++;
|
|
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l35"></a>
|
|
<a name="l36"></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="l37"></a> </span><span class=cFB>fp_getstr2</span><span class=cF0>=&</span><span class=cFD>SysGetStr2</span><span class=cF0>;
|
|
<a name="l38"></a> </span><span class=cFD>KeyDevInit</span><span class=cF0>;
|
|
<a name="l39"></a>
|
|
<a name="l40"></a> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l41"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"blkdev.boot_drv_let='%C';"</span><span class=cF0>,kernel_cfg->boot_drv_let);
|
|
<a name="l42"></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="l43"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"DskCacheInit(%s);"</span><span class=cF0>,kernel_cfg->dsk_cache_size_exp);
|
|
<a name="l44"></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="l45"></a> </span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l46"></a>
|
|
<a name="l47"></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=cF0>308+308+1</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l48"></a> </span><span class=cF1>for</span><span class=cF0> (i=-308;i<309;i++)
|
|
<a name="l49"></a> </span><span class=cFD>pow10_I64</span><span class=cF0>[i+309]=</span><span class=cF5>Pow10</span><span class=cF0>(i);
|
|
<a name="l50"></a>
|
|
<a name="l51"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&</span><span class=cFB>scrncast</span><span class=cF0>.snd_head);
|
|
<a name="l52"></a> </span><span class=cFB>scrncast</span><span class=cF0>.t0_now=</span><span class=cF5>Now</span><span class=cF0>;
|
|
<a name="l53"></a> </span><span class=cFB>scrncast</span><span class=cF0>.t0_tS=</span><span class=cF5>tS</span><span class=cF0>;
|
|
<a name="l54"></a> </span><span class=cFB>scrncast</span><span class=cF0>.ona=</span><span class=cFB>scrncast</span><span class=cF0>.snd_head.ona=0;
|
|
<a name="l55"></a>
|
|
<a name="l56"></a> </span><span class=cF5>ProgressBarsRst</span><span class=cF0>;
|
|
<a name="l57"></a>
|
|
<a name="l58"></a> </span><span class=cF5>QueInit</span><span class=cF0>(&</span><span class=cFB>dev</span><span class=cF0>.pci_head);
|
|
<a name="l59"></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="l60"></a>
|
|
<a name="l61"></a> </span><span class=cFB>dbg</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="l62"></a> </span><span class=cFB>dbg</span><span class=cF0>.int_fault_code=</span><span class=cFD>IntFaultHndlrsNew</span><span class=cF0>;
|
|
<a name="l63"></a>}
|
|
<a name="l64"></a>
|
|
<a name="l65"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>SysGrInit</span><span class=cF0>()
|
|
<a name="l66"></a>{
|
|
<a name="l67"></a> </span><span class=cFB>text</span><span class=cF0>.font=</span><span class=cFD>sys_font_std</span><span class=cF0>;
|
|
<a name="l68"></a> </span><span class=cFB>text</span><span class=cF0>.aux_font=</span><span class=cFD>sys_font_cyrillic</span><span class=cF0>;
|
|
<a name="l69"></a> </span><span class=cFB>text</span><span class=cF0>.vga_alias =</span><span class=cFB>dev</span><span class=cF0>.uncached_alias+</span><span class=cF3>VGAM_GRAPHICS</span><span class=cF0>;
|
|
<a name="l70"></a> </span><span class=cFB>text</span><span class=cF0>.vga_text_alias =</span><span class=cFB>dev</span><span class=cF0>.uncached_alias+</span><span class=cF3>VGAM_TEXT</span><span class=cF0>;
|
|
<a name="l71"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_VGA</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0> </span><span class=cF2>//if text mode</span><span class=cF0>
|
|
<a name="l72"></a> </span><span class=cFB>text</span><span class=cF0>.cols=80;
|
|
<a name="l73"></a> </span><span class=cFB>text</span><span class=cF0>.rows=25;
|
|
<a name="l74"></a> </span><span class=cF5>MemSet</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.vga_text_alias,0,</span><span class=cFB>text</span><span class=cF0>.rows*</span><span class=cFB>text</span><span class=cF0>.cols<<1);
|
|
<a name="l75"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[2] (</span><span class=cF9>I64</span><span class=cF0>)=</span><span class=cF6>'........'</span><span class=cF0>;
|
|
<a name="l76"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[10](</span><span class=cF9>U32</span><span class=cF0>)=</span><span class=cF6>'....'</span><span class=cF0>;
|
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0> </span><span class=cF2>//if 640x480 16 color</span><span class=cF0>
|
|
<a name="l78"></a> </span><span class=cFB>text</span><span class=cF0>.cols=</span><span class=cF3>GR_WIDTH</span><span class=cF0>/</span><span class=cF3>FONT_WIDTH</span><span class=cF0>;
|
|
<a name="l79"></a> </span><span class=cFB>text</span><span class=cF0>.rows=</span><span class=cF3>GR_HEIGHT</span><span class=cF0>/</span><span class=cF3>FONT_HEIGHT</span><span class=cF0>;
|
|
<a name="l80"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_IDX</span><span class=cF0>,</span><span class=cF3>VGAR_MAP_MASK</span><span class=cF0>);
|
|
<a name="l81"></a> </span><span class=cF5>OutU8</span><span class=cF0>(</span><span class=cF3>VGAP_DATA</span><span class=cF0>,0x0F);
|
|
<a name="l82"></a> </span><span class=cF5>MemSet</span><span class=cF0>(</span><span class=cFB>text</span><span class=cF0>.vga_alias,0,</span><span class=cF3>GR_WIDTH</span><span class=cF0>*</span><span class=cF3>GR_HEIGHT</span><span class=cF0>>>3);
|
|
<a name="l83"></a> </span><span class=cFB>text</span><span class=cF0>.raw_scrn_image=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF3>GR_WIDTH</span><span class=cF0>*</span><span class=cF3>GR_HEIGHT</span><span class=cF0>/8);
|
|
<a name="l84"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[2] (</span><span class=cF9>I64</span><span class=cF0>)=0x0908070605040302;
|
|
<a name="l85"></a> </span><span class=cFB>text</span><span class=cF0>.border_chars[10](</span><span class=cF9>U32</span><span class=cF0>)=0x0D0C0B0A;
|
|
<a name="l86"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l87"></a>}
|
|
<a name="l88"></a>
|
|
<a name="l89"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>TimersInit</span><span class=cF0>()
|
|
<a name="l90"></a>{
|
|
<a name="l91"></a> </span><span class=cF9>I64</span><span class=cF0> i,*_q;
|
|
<a name="l92"></a> </span><span class=cF9>U32</span><span class=cF0> *_d;
|
|
<a name="l93"></a>
|
|
<a name="l94"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x43,0x34);
|
|
<a name="l95"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x40,</span><span class=cF3>SYS_TIMER0_PERIOD</span><span class=cF0>);
|
|
<a name="l96"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x40,</span><span class=cF3>SYS_TIMER0_PERIOD</span><span class=cF0>>>8);
|
|
<a name="l97"></a>
|
|
<a name="l98"></a> </span><span class=cF2>//High Precision Event Timer</span><span class=cF0>
|
|
<a name="l99"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PCIReadU16</span><span class=cF7>(</span><span class=cF0>0,31,0,0</span><span class=cF7>)</span><span class=cF0>==0x8086) </span><span class=cF7>{</span><span class=cF2>//Intel?</span><span class=cF0>
|
|
<a name="l100"></a></span><span class=cF2>//D31 F0, cfg 0xF0=RCBA of PCI-LPC Bridge</span><span class=cF0>
|
|
<a name="l101"></a> _d=</span><span class=cF5>PCIReadU32</span><span class=cF0>(0,31,0,0xF0)(</span><span class=cF1>U8</span><span class=cF0> *)&~0x3FFF+0x3404; </span><span class=cF2>//HPET cfg</span><span class=cF0>
|
|
<a name="l102"></a></span><span class=cF2>//7</span><span class=cF0> </span><span class=cF2>enable</span><span class=cF0>
|
|
<a name="l103"></a> </span><span class=cF2>//1:0 HPET is at 0xFED00000,0xFED01000, 0xFED02000 or 0xFED03000.</span><span class=cF0>
|
|
<a name="l104"></a> *_d=*_d&3|0x80;
|
|
<a name="l105"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l106"></a>
|
|
<a name="l107"></a> _q=</span><span class=cFB>dev</span><span class=cF0>.uncached_alias+</span><span class=cF3>HPET_GCAP_ID</span><span class=cF0>;
|
|
<a name="l108"></a> i=*_q; </span><span class=cF2>//i.u32[1]= period in femtoS (10e-15)</span><span class=cF0>
|
|
<a name="l109"></a> </span><span class=cF1>if</span><span class=cF0> (100000<i.u32[1]<1000000000) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l110"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_freq =1000000000000000/i.u32[1];
|
|
<a name="l111"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_kHz_freq=1000000000000/i.u32[1];
|
|
<a name="l112"></a> _q=</span><span class=cFB>dev</span><span class=cF0>.uncached_alias+</span><span class=cF3>HPET_GEN_CONF</span><span class=cF0>;
|
|
<a name="l113"></a> *_q|=1; </span><span class=cF2>//Enable counting</span><span class=cF0>
|
|
<a name="l114"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_initial=</span><span class=cF5>HPET</span><span class=cF0>;
|
|
<a name="l115"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l116"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_freq=0;
|
|
<a name="l117"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_kHz_freq=0;
|
|
<a name="l118"></a> </span><span class=cFB>cnts</span><span class=cF0>.HPET_initial=0;
|
|
<a name="l119"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l120"></a>}
|
|
<a name="l121"></a>
|
|
<a name="l122"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Reboot</span><span class=cF0>()
|
|
<a name="l123"></a>{</span><span class=cF2>//Hardware reset.</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF1>CLI</span><span class=cF0>
|
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>mp_cnt</span><span class=cF0>>1)
|
|
<a name="l126"></a> </span><span class=cF5>MPHalt</span><span class=cF0>;
|
|
<a name="l127"></a> *0x472(</span><span class=cF9>U16</span><span class=cF0> *)=0;
|
|
<a name="l128"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x70,0x8F);
|
|
<a name="l129"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x71,0x00);
|
|
<a name="l130"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x70,0x00);
|
|
<a name="l131"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x92,</span><span class=cF5>InU8</span><span class=cF7>(</span><span class=cF0>0x92</span><span class=cF7>)</span><span class=cF0>|1);
|
|
<a name="l132"></a> </span><span class=cF5>SysHlt</span><span class=cF0>;
|
|
<a name="l133"></a>}
|
|
<a name="l134"></a>
|
|
<a name="l135"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>KMain</span><span class=cF0>()
|
|
<a name="l136"></a>{</span><span class=cF2>//Continued from </span><a href="/Wb/Kernel/KStart64.HC.HTML#l40"><span class=cF4>KStart64.HC</span></a><span class=cF0>
|
|
<a name="l137"></a> </span><span class=cF9>CBlkDev</span><span class=cF0> *bd;
|
|
<a name="l138"></a> </span><span class=cF5>OutU8</span><span class=cF0>(0x61,</span><span class=cF5>InU8</span><span class=cF7>(</span><span class=cF0>0x61</span><span class=cF7>)</span><span class=cF0>&~3); </span><span class=cF2>//Snd;</span><span class=cF0>
|
|
<a name="l139"></a> </span><span class=cFB>adam_task</span><span class=cF0>=</span><span class=cF5>Fs</span><span class=cF0>;
|
|
<a name="l140"></a> </span><span class=cFD>BlkPoolsInit</span><span class=cF0>;
|
|
<a name="l141"></a> </span><span class=cFD>SysGlblsInit</span><span class=cF0>;
|
|
<a name="l142"></a> </span><span class=cFD>Mem32DevInit</span><span class=cF0>;
|
|
<a name="l143"></a> </span><span class=cFD>UncachedAliasAlloc</span><span class=cF0>;
|
|
<a name="l144"></a> </span><span class=cFD>LoadKernel</span><span class=cF0>;
|
|
<a name="l145"></a> </span><span class=cFD>SysGrInit</span><span class=cF0>;
|
|
<a name="l146"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(</span><span class=cF5>Fs</span><span class=cF0>->task_name,</span><span class=cF6>"Adam Task CPU00"</span><span class=cF0>);
|
|
<a name="l147"></a> </span><span class=cF5>StrCpy</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="l148"></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="l149"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_right=</span><span class=cFB>text</span><span class=cF0>.cols-2;
|
|
<a name="l150"></a> </span><span class=cF5>Fs</span><span class=cF0>->win_top++;
|
|
<a name="l151"></a> </span><span class=cF5>TaskDerivedValsUpdate</span><span class=cF0>;
|
|
<a name="l152"></a>
|
|
<a name="l153"></a> </span><span class=cFD>SysDefinesLoad</span><span class=cF0>;
|
|
<a name="l154"></a> </span><span class=cFD>Core0Init</span><span class=cF0>;
|
|
<a name="l155"></a> </span><span class=cFD>IntInit1</span><span class=cF0>;
|
|
<a name="l156"></a>
|
|
<a name="l157"></a> </span><span class=cF2>//Before this point use </span><a href="/Wb/Kernel/KMisc.HC.HTML#l179"><span class=cF4>Snd</span></a><span class=cF2>() and </span><a href="/Wb/Kernel/KMisc.HC.HTML#l136"><span class=cF4>Busy</span></a><span class=cF2>()</span><span class=cF0>
|
|
<a name="l158"></a> </span><span class=cF2>//to debug. After this point, use </span><a href="/Wb/Kernel/KDbg.HC.HTML#l217"><span class=cF4>RawPrint</span></a><span class=cF2>()</span><span class=cF0>
|
|
<a name="l159"></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="l160"></a> </span><span class=cF6>"TempleOS V%5.3f\t%D %T\n\n"</span><span class=cF0>,
|
|
<a name="l161"></a> </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="l162"></a>
|
|
<a name="l163"></a> </span><span class=cFD>TimersInit</span><span class=cF0>;
|
|
<a name="l164"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>BIOSTotalMem</span><span class=cF0><</span><span class=cF5>ToI64</span><span class=cF7>(</span><span class=cF0>0.95*</span><span class=cF3>MEM_MIN_MEG</span><span class=cF0>*0x100000</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l165"></a> </span><span class=cF5>RawPrint</span><span class=cF0>(4000,</span><span class=cF6>"!!! Requires 512Meg of RAM Memory !!!"</span><span class=cF0>);
|
|
<a name="l166"></a>
|
|
<a name="l167"></a> </span><span class=cFD>IntsInit</span><span class=cF0>;
|
|
<a name="l168"></a> </span><span class=cF6>"Enable IRQ's\n"</span><span class=cF0>;
|
|
<a name="l169"></a> </span><span class=cF5>SetRFlags</span><span class=cF0>(</span><span class=cF3>RFLAGG_NORMAL</span><span class=cF0>);
|
|
<a name="l170"></a> </span><span class=cF5>Busy</span><span class=cF0>(2000);
|
|
<a name="l171"></a> </span><span class=cFD>IntInit2</span><span class=cF0>;
|
|
<a name="l172"></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="l173"></a>
|
|
<a name="l174"></a> </span><span class=cF5>TimeCal</span><span class=cF0>;
|
|
<a name="l175"></a> </span><span class=cFD>BlkDevsInitAll</span><span class=cF0>;
|
|
<a name="l176"></a> </span><span class=cF6>"DskChg(':');\n"</span><span class=cF0>;
|
|
<a name="l177"></a> </span><span class=cF5>DskChg</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>);
|
|
<a name="l178"></a> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l179"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"HomeSet(\"%s\");\n"</span><span class=cF0>
|
|
<a name="l180"></a> </span><span class=cF6>"blkdev.ins_base0=%d;blkdev.ins_base1=%d;blkdev.ins_unit =%d;\n"</span><span class=cF0>,
|
|
<a name="l181"></a> kernel_cfg->home_dir,
|
|
<a name="l182"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_base0,</span><span class=cFB>blkdev</span><span class=cF0>.ins_base1,</span><span class=cFB>blkdev</span><span class=cF0>.ins_unit);
|
|
<a name="l183"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l184"></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_drv[*</span><span class=cFB>blkdev</span><span class=cF0>.home_dir-</span><span class=cF6>'A'</span><span class=cF0>];
|
|
<a name="l185"></a> </span><span class=cF5>DrvRep</span><span class=cF0>;
|
|
<a name="l186"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>blkdev</span><span class=cF0>.dvd_boot_is_good) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l187"></a> bd=</span><span class=cF5>Let2BlkDev</span><span class=cF0>(</span><span class=cF6>':'</span><span class=cF0>);
|
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (bd->type==</span><span class=cF3>BDT_ATAPI</span><span class=cF0>) {
|
|
<a name="l189"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_base0=bd->base0;
|
|
<a name="l190"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_base1=bd->base1;
|
|
<a name="l191"></a> </span><span class=cFB>blkdev</span><span class=cF0>.ins_unit =bd->unit;
|
|
<a name="l192"></a> }
|
|
<a name="l193"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l194"></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="l195"></a>
|
|
<a name="l196"></a> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l197"></a> </span><span class=cF1>if</span><span class=cF0> (!kernel_cfg->opts[CFG_NO_MP])
|
|
<a name="l198"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"\"MultiCore Start\\n\\n\";"</span><span class=cF0>
|
|
<a name="l199"></a> </span><span class=cF6>"Core0StartMP;"</span><span class=cF0>
|
|
<a name="l200"></a> </span><span class=cF6>"LBts(&sys_run_level,RLf_MP);"</span><span class=cF0>);
|
|
<a name="l201"></a> </span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l202"></a>
|
|
<a name="l203"></a> </span><span class=cF5>KbdMsInit</span><span class=cF0>;
|
|
<a name="l204"></a> </span><span class=cF5>MsInit</span><span class=cF0>;
|
|
<a name="l205"></a> </span><span class=cF5>KbdInit</span><span class=cF0>;
|
|
<a name="l206"></a> </span><span class=cF5>Spawn</span><span class=cF0>(&</span><span class=cF5>MsHardDrvrInstall</span><span class=cF0>);
|
|
<a name="l207"></a>
|
|
<a name="l208"></a> </span><span class=cF6>"Loading Compiler\n"</span><span class=cF0>;
|
|
<a name="l209"></a> </span><span class=cF5>Cd</span><span class=cF0>(</span><span class=cF6>"/Compiler"</span><span class=cF0>);
|
|
<a name="l210"></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="l211"></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="l212"></a>
|
|
<a name="l213"></a> </span><span class=cF5>DbgMode</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l214"></a> </span><span class=cFB>cnts</span><span class=cF0>.time_stamp_freq_initial=</span><span class=cF5>TimeCal</span><span class=cF0>;
|
|
<a name="l215"></a> </span><span class=cF5>Cd</span><span class=cF0>(</span><span class=cF6>"/"</span><span class=cF0>);
|
|
<a name="l216"></a> </span><span class=cF1>try</span><span class=cF0> </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="/Wb/StartOS.HC.HTML#l1"><span class=cF4>/StartOS.HC</span></a><span class=cF0>
|
|
<a name="l217"></a> </span><span class=cF1>catch</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l218"></a> </span><span class=cF5>Raw</span><span class=cF0>(</span><span class=cF3>ON</span><span class=cF0>);
|
|
<a name="l219"></a> </span><span class=cF5>Silent</span><span class=cF0>(</span><span class=cF3>OFF</span><span class=cF0>);
|
|
<a name="l220"></a> </span><span class=cF5>GetOutOfDollar</span><span class=cF0>;
|
|
<a name="l221"></a> </span><span class=cF5>PutExcept</span><span class=cF0>;
|
|
<a name="l222"></a> </span><span class=cF5>Dbg</span><span class=cF0>;
|
|
<a name="l223"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l224"></a>
|
|
<a name="l225"></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_ADAM_SERVER</span><span class=cF0>);
|
|
<a name="l226"></a> </span><span class=cF5>SrvTaskCont</span><span class=cF0>; </span><span class=cF2>//Never to return</span><span class=cF0>
|
|
<a name="l227"></a>}
|
|
<a name="l228"></a>
|
|
<a name="l229"></a></span><span class=cF1>asm</span><span class=cF0> { </span><span class=cF1>ALIGN</span><span class=cF0> 16,</span><span class=cF3>OC_NOP</span><span class=cF0>
|
|
<a name="l230"></a></span><span class=cFD>SYS_KERNEL_END</span><span class=cF0>::
|
|
<a name="l231"></a>#</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l232"></a> </span><span class=cF1>if</span><span class=cF0> (kernel_cfg->opts[CFG_DBG_DISTRO])
|
|
<a name="l233"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"DU8 0x%X-(SYS_KERNEL_END-SYS_KERNEL+"</span><span class=cF0>
|
|
<a name="l234"></a> </span><span class=cF6>"BOOT_RAM_BASE+sizeof(CBinFile)) DUP (0);"</span><span class=cF0>
|
|
<a name="l235"></a> </span><span class=cF6>"BINFILE \"%s\";"</span><span class=cF0>,kernel_cfg->dbg_distro_start,
|
|
<a name="l236"></a> kernel_cfg->dbg_distro_file);
|
|
<a name="l237"></a></span><span class=cF7>}</span><span class=cF0>;
|
|
<a name="l238"></a>}
|
|
</span></pre></body>
|
|
</html>
|