272 lines
26 KiB
Plaintext
272 lines
26 KiB
Plaintext
|
<!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>BlkDevLockFwdingSet</span><span class=cF0>(</span><span class=cF9>CBlkDev</span><span class=cF0> *bd)
|
||
|
<a name="l2"></a>{ </span><span class=cF2>//If two blkdevs on same controller, use just one lock</span><span class=cF0>
|
||
|
<a name="l3"></a> </span><span class=cF9>CBlkDev</span><span class=cF0> *bd1;
|
||
|
<a name="l4"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l5"></a> </span><span class=cF1>switch</span><span class=cF0> (bd->type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l6"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_RAM</span><span class=cF0>:
|
||
|
<a name="l7"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l8"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_READ</span><span class=cF0>:
|
||
|
<a name="l9"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_WRITE</span><span class=cF0>:
|
||
|
<a name="l10"></a> bd->lock_fwding=</span><span class=cF5>Let2BlkDev</span><span class=cF0>(*bd->file_dsk_name);
|
||
|
<a name="l11"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l12"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATA</span><span class=cF0>:
|
||
|
<a name="l13"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATAPI</span><span class=cF0>:
|
||
|
<a name="l14"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>BLKDEVS_NUM</span><span class=cF0>;i++) {
|
||
|
<a name="l15"></a> bd1=&</span><span class=cFB>blkdev</span><span class=cF0>.blkdevs[i];
|
||
|
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (bd1->bd_signature==</span><span class=cF3>BD_SIGNATURE_VAL</span><span class=cF0> && bd!=bd1 &&
|
||
|
<a name="l17"></a> </span><span class=cF7>(</span><span class=cF0>bd1->type==</span><span class=cF3>BDT_ATAPI</span><span class=cF0> || bd1->type==</span><span class=cF3>BDT_ATA</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l18"></a> bd1->base0==bd->base0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l19"></a> bd->lock_fwding=bd1;
|
||
|
<a name="l20"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l21"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l22"></a> }
|
||
|
<a name="l23"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l24"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l25"></a>}
|
||
|
<a name="l26"></a>
|
||
|
<a name="l27"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>BlkDevAdd</span><span class=cF0>(</span><span class=cF9>CBlkDev</span><span class=cF0> *bd,</span><span class=cF9>I64</span><span class=cF0> prt_num=</span><span class=cF3>I64_MIN</span><span class=cF0>,
|
||
|
<a name="l28"></a> </span><span class=cF1>Bool</span><span class=cF0> whole_drv,</span><span class=cF1>Bool</span><span class=cF0> make_free)
|
||
|
<a name="l29"></a>{</span><span class=cF2>//It will mount just one partition of prt_num>=0.</span><span class=cF0>
|
||
|
<a name="l30"></a></span><span class=cF2>//When repartitioing whole drive, whole_drv=TRUE.</span><span class=cF0>
|
||
|
<a name="l31"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,ext_base,</span><span class=cF1>offset</span><span class=cF0>,res=0,num=0;
|
||
|
<a name="l32"></a> </span><span class=cF9>CDrv</span><span class=cF0> *dv;
|
||
|
<a name="l33"></a> </span><span class=cF9>CRedSeaBoot</span><span class=cF0> br;
|
||
|
<a name="l34"></a> </span><span class=cF9>CMasterBoot</span><span class=cF0> mbr;
|
||
|
<a name="l35"></a>
|
||
|
<a name="l36"></a> bd->bd_signature=</span><span class=cF3>BD_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (make_free)
|
||
|
<a name="l38"></a> dv=</span><span class=cF5>DrvMakeFreeSlot</span><span class=cF0>(bd->first_drv_let);
|
||
|
<a name="l39"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l40"></a> dv=</span><span class=cF5>DrvMakeFreeSlot</span><span class=cF0>(</span><span class=cF5>DrvNextFreeLet</span><span class=cF7>(</span><span class=cF0>bd->first_drv_let</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l41"></a> dv->bd=bd;
|
||
|
<a name="l42"></a> dv->drv_offset=bd->drv_offset;
|
||
|
<a name="l43"></a> dv->size=bd->max_blk+1-bd->drv_offset;
|
||
|
<a name="l44"></a> </span><span class=cF1>switch</span><span class=cF0> (bd->type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l45"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_RAM</span><span class=cF0>:
|
||
|
<a name="l46"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_READ</span><span class=cF0>:
|
||
|
<a name="l47"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_WRITE</span><span class=cF0>:
|
||
|
<a name="l48"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l49"></a> dv->prt_num=num;
|
||
|
<a name="l50"></a> dv->fs_type=</span><span class=cF3>FSt_REDSEA</span><span class=cF0>;
|
||
|
<a name="l51"></a></span><span class=cF2>//This is to force creation of a RAM</span><span class=cF0>
|
||
|
<a name="l52"></a> </span><span class=cF2>//drive during boot, so it is probably</span><span class=cF0>
|
||
|
<a name="l53"></a> </span><span class=cF2>//MAlloced to the same addr and can</span><span class=cF0>
|
||
|
<a name="l54"></a> </span><span class=cF2>//be assumed to be already formatted.</span><span class=cF0>
|
||
|
<a name="l55"></a> </span><span class=cF2>//If this line is removed, RAM Drives</span><span class=cF0>
|
||
|
<a name="l56"></a> </span><span class=cF2>//will be alloced on a just-in-time</span><span class=cF0>
|
||
|
<a name="l57"></a> </span><span class=cF2>//basis.</span><span class=cF0>
|
||
|
<a name="l58"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFD>BlkDevInit</span><span class=cF7>(</span><span class=cF0>bd</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l59"></a> res++;
|
||
|
<a name="l60"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l61"></a> dv->dv_signature=0;
|
||
|
<a name="l62"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l63"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATA</span><span class=cF0>:
|
||
|
<a name="l64"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>; </span><span class=cF2>//Temporarily validate</span><span class=cF0>
|
||
|
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFD>BlkDevInit</span><span class=cF7>(</span><span class=cF0>bd</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l66"></a> dv->dv_signature=0; </span><span class=cF2>//Revoke validation</span><span class=cF0>
|
||
|
<a name="l67"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l68"></a> dv->dv_signature=0; </span><span class=cF2>//Revoke validation</span><span class=cF0>
|
||
|
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (whole_drv) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l70"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l71"></a> dv->prt_num=num;
|
||
|
<a name="l72"></a> res++;
|
||
|
<a name="l73"></a> dv->fs_type=</span><span class=cF3>FSt_REDSEA</span><span class=cF0>;
|
||
|
<a name="l74"></a> dv->size=bd->max_blk+1-bd->drv_offset;
|
||
|
<a name="l75"></a></span><span class=cF2>//The following read is a test read.</span><span class=cF0>
|
||
|
<a name="l76"></a> </span><span class=cF2>//if it hangs, the drive is not supported.</span><span class=cF0>
|
||
|
<a name="l77"></a> </span><span class=cF5>ATAReadBlks</span><span class=cF0>(bd,&mbr,0,1);
|
||
|
<a name="l78"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l80"></a> </span><span class=cF1>offset</span><span class=cF0>=0;
|
||
|
<a name="l81"></a> ext_base=</span><span class=cF3>INVALID_CLUS</span><span class=cF0>;
|
||
|
<a name="l82"></a> </span><span class=cF1>while</span><span class=cF0> (prt_num<0 || num<=prt_num) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l83"></a> </span><span class=cF5>ATAReadBlks</span><span class=cF0>(bd,&mbr,</span><span class=cF1>offset</span><span class=cF0>,1);
|
||
|
<a name="l84"></a> </span><span class=cF1>if</span><span class=cF0> (mbr.signature!=0xAA55)
|
||
|
<a name="l85"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l86"></a> j=-1;
|
||
|
<a name="l87"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<4 && </span><span class=cF7>(</span><span class=cF0>prt_num<0 || num<=prt_num</span><span class=cF7>)</span><span class=cF0>;i++) {
|
||
|
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (mbr.p[i].type) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (make_free)
|
||
|
<a name="l90"></a> dv=</span><span class=cF5>DrvMakeFreeSlot</span><span class=cF0>(bd->first_drv_let+res);
|
||
|
<a name="l91"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l92"></a> dv=</span><span class=cF5>DrvMakeFreeSlot</span><span class=cF0>(</span><span class=cF5>DrvNextFreeLet</span><span class=cF7>(</span><span class=cF0>bd->first_drv_let+res</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l93"></a> dv->bd=bd;
|
||
|
<a name="l94"></a> dv->drv_offset=mbr.p[i].</span><span class=cF1>offset</span><span class=cF0>+</span><span class=cF1>offset</span><span class=cF0>;
|
||
|
<a name="l95"></a> dv->size =mbr.p[i].size;
|
||
|
<a name="l96"></a> </span><span class=cF1>switch</span><span class=cF0> (mbr.p[i].type) {
|
||
|
<a name="l97"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_REDSEA</span><span class=cF0>:
|
||
|
<a name="l98"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l99"></a> dv->prt_num=num;
|
||
|
<a name="l100"></a> res++;
|
||
|
<a name="l101"></a> dv->fs_type=</span><span class=cF3>FSt_REDSEA</span><span class=cF0>;
|
||
|
<a name="l102"></a> </span><span class=cFD>RedSeaInit</span><span class=cF0>(dv);
|
||
|
<a name="l103"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l104"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32a</span><span class=cF0>:
|
||
|
<a name="l105"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32b</span><span class=cF0>:
|
||
|
<a name="l106"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32c</span><span class=cF0>:
|
||
|
<a name="l107"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32d</span><span class=cF0>:
|
||
|
<a name="l108"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32e</span><span class=cF0>:
|
||
|
<a name="l109"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_FAT32f</span><span class=cF0>:
|
||
|
<a name="l110"></a> </span><span class=cF5>ATAReadBlks</span><span class=cF0>(bd,&br,dv->drv_offset,1);
|
||
|
<a name="l111"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l112"></a> dv->prt_num=num;
|
||
|
<a name="l113"></a> res++;
|
||
|
<a name="l114"></a> </span><span class=cF1>if</span><span class=cF0> (br.signature==</span><span class=cF3>MBR_PT_REDSEA</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l115"></a> dv->fs_type=</span><span class=cF3>FSt_REDSEA</span><span class=cF0>;
|
||
|
<a name="l116"></a> </span><span class=cFD>RedSeaInit</span><span class=cF0>(dv);
|
||
|
<a name="l117"></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="l118"></a> dv->fs_type=</span><span class=cF3>FSt_FAT32</span><span class=cF0>;
|
||
|
<a name="l119"></a> </span><span class=cFD>FAT32Init</span><span class=cF0>(dv);
|
||
|
<a name="l120"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l121"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l122"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>MBR_PT_NTFS</span><span class=cF0>:
|
||
|
<a name="l123"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l124"></a> dv->prt_num=num;
|
||
|
<a name="l125"></a> res++;
|
||
|
<a name="l126"></a> dv->fs_type=</span><span class=cF3>FSt_NTFS</span><span class=cF0>;
|
||
|
<a name="l127"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l128"></a> </span><span class=cF1>case</span><span class=cF0> 5:
|
||
|
<a name="l129"></a> </span><span class=cF1>case</span><span class=cF0> 15:
|
||
|
<a name="l130"></a> j=i;
|
||
|
<a name="l131"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l132"></a> </span><span class=cF1>default</span><span class=cF0>:
|
||
|
<a name="l133"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l134"></a> dv->prt_num=num;
|
||
|
<a name="l135"></a> res++;
|
||
|
<a name="l136"></a> dv->fs_type=</span><span class=cF3>FSt_UNKNOWN</span><span class=cF0>;
|
||
|
<a name="l137"></a> }
|
||
|
<a name="l138"></a> num++;
|
||
|
<a name="l139"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l140"></a> }
|
||
|
<a name="l141"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Let2BlkDevType</span><span class=cF7>(</span><span class=cF0>bd->first_drv_let+res</span><span class=cF7>)</span><span class=cF0>!=bd->type)
|
||
|
<a name="l142"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (j<0)
|
||
|
<a name="l144"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l145"></a> </span><span class=cF1>if</span><span class=cF0> (!mbr.p[j].</span><span class=cF1>offset</span><span class=cF0>)
|
||
|
<a name="l146"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (ext_base==</span><span class=cF3>INVALID_CLUS</span><span class=cF0>) {
|
||
|
<a name="l148"></a> </span><span class=cF1>offset</span><span class=cF0>=mbr.p[j].</span><span class=cF1>offset</span><span class=cF0>;
|
||
|
<a name="l149"></a> ext_base=</span><span class=cF1>offset</span><span class=cF0>;
|
||
|
<a name="l150"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l151"></a> </span><span class=cF1>offset</span><span class=cF0>=mbr.p[j].</span><span class=cF1>offset</span><span class=cF0>+ext_base;
|
||
|
<a name="l152"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l153"></a> }
|
||
|
<a name="l154"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l155"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATAPI</span><span class=cF0>:
|
||
|
<a name="l156"></a> dv->dv_signature=</span><span class=cF3>DRV_SIGNATURE_VAL</span><span class=cF0>;
|
||
|
<a name="l157"></a> dv->prt_num=num;
|
||
|
<a name="l158"></a> res++;
|
||
|
<a name="l159"></a> dv->fs_type=</span><span class=cF3>FSt_ISO9660</span><span class=cF0>; </span><span class=cF2>//Start with this</span><span class=cF0>
|
||
|
<a name="l160"></a> dv->size=0;
|
||
|
<a name="l161"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l162"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (res)
|
||
|
<a name="l164"></a> </span><span class=cFD>BlkDevLockFwdingSet</span><span class=cF0>(bd);
|
||
|
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l166"></a> </span><span class=cF5>BlkDevDel</span><span class=cF0>(bd);
|
||
|
<a name="l167"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l168"></a>}
|
||
|
<a name="l169"></a>
|
||
|
<a name="l170"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>DrvEnable</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> drv_let,</span><span class=cF1>Bool</span><span class=cF0> val)
|
||
|
<a name="l171"></a>{</span><span class=cF2>//Can unmount or remount, but not mount the first time.</span><span class=cF0>
|
||
|
<a name="l172"></a> </span><span class=cF9>CDrv</span><span class=cF0> *dv;
|
||
|
<a name="l173"></a> </span><span class=cF1>if</span><span class=cF0> (dv=</span><span class=cF5>Let2Drv</span><span class=cF7>(</span><span class=cF0>drv_let,</span><span class=cF3>FALSE</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l174"></a> </span><span class=cF1>return</span><span class=cF0> !</span><span class=cF5>LBEqu</span><span class=cF0>(&dv->fs_type,</span><span class=cF3>FStf_DISABLE</span><span class=cF0>,!val);
|
||
|
<a name="l175"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l176"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l177"></a>}
|
||
|
<a name="l178"></a>
|
||
|
<a name="l179"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cFD>SysGetI64</span><span class=cF0>()
|
||
|
<a name="l180"></a>{
|
||
|
<a name="l181"></a> </span><span class=cF1>U8</span><span class=cF0> st[</span><span class=cF3>STR_LEN</span><span class=cF0>];
|
||
|
<a name="l182"></a> </span><span class=cF5>GetS</span><span class=cF0>(st,</span><span class=cF3>STR_LEN</span><span class=cF0>,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l183"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Str2I64</span><span class=cF0>(st,16);
|
||
|
<a name="l184"></a>}
|
||
|
<a name="l185"></a>
|
||
|
<a name="l186"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cFD>GetBaseUnit</span><span class=cF0>(</span><span class=cF9>CBlkDev</span><span class=cF0> *bd)
|
||
|
<a name="l187"></a>{
|
||
|
<a name="l188"></a> </span><span class=cF9>I64</span><span class=cF0> ch;
|
||
|
<a name="l189"></a> </span><span class=cF1>Bool</span><span class=cF0> probe;
|
||
|
<a name="l190"></a> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (kernel_cfg->opts[CFG_DONT_PROBE])
|
||
|
<a name="l192"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"probe=FALSE;"</span><span class=cF0>);
|
||
|
<a name="l193"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l194"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"probe=TRUE;"</span><span class=cF0>);
|
||
|
<a name="l195"></a> </span><span class=cF7>}</span><span class=cF0>;
|
||
|
<a name="l196"></a> </span><span class=cF1>if</span><span class=cF0> (!probe || !</span><span class=cFD>BootDVDProbeAll</span><span class=cF7>(</span><span class=cF0>bd</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l197"></a> </span><span class=cF6>"\nDon't worry. This is not a product\n"</span><span class=cF0>
|
||
|
<a name="l198"></a> </span><span class=cF6>"registration.</span><span class=cF0> </span><span class=cF6>TempleOS just needs the\n"</span><span class=cF0>
|
||
|
<a name="l199"></a> </span><span class=cF6>"I/O port numbers for the CD/DVD.\n"</span><span class=cF0>
|
||
|
<a name="l200"></a> </span><span class=cF6>"\nRetry the ports above or check Windows\n"</span><span class=cF0>
|
||
|
<a name="l201"></a> </span><span class=cF6>"system information under I/O ports for\n"</span><span class=cF0>
|
||
|
<a name="l202"></a> </span><span class=cF6>"'IDE', 'ATA' or 'SATA'.\n"</span><span class=cF0>
|
||
|
<a name="l203"></a> </span><span class=cF6>"In Linux, use 'lspci -v' for ports.\n"</span><span class=cF0>
|
||
|
<a name="l204"></a> </span><span class=cF6>"\n\nEnter 4-digit hex I/O Port number.\n"</span><span class=cF0>
|
||
|
<a name="l205"></a> </span><span class=cF6>"CD/DVD I/O Port Base0: 0x"</span><span class=cF0>;
|
||
|
<a name="l206"></a> bd->base0=</span><span class=cFD>SysGetI64</span><span class=cF0>;
|
||
|
<a name="l207"></a> bd->base1=0;
|
||
|
<a name="l208"></a> bd->unit =0;
|
||
|
<a name="l209"></a> </span><span class=cF1>if</span><span class=cF0> (bd->base0) {
|
||
|
<a name="l210"></a> </span><span class=cF6>"\nUnit (0 or 1): "</span><span class=cF0>;
|
||
|
<a name="l211"></a> </span><span class=cF1>do</span><span class=cF0> ch=</span><span class=cF5>GetChar</span><span class=cF0>(,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l212"></a> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF6>'0'</span><span class=cF0><=ch<=</span><span class=cF6>'1'</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l213"></a> </span><span class=cF6>''</span><span class=cF0> ch;
|
||
|
<a name="l214"></a> bd->unit=ch-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l215"></a> </span><span class=cFB>blkdev</span><span class=cF0>.dvd_boot_is_good=</span><span class=cFD>BootDVDProbe</span><span class=cF0>(bd);
|
||
|
<a name="l216"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
||
|
<a name="l217"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l218"></a> </span><span class=cFB>blkdev</span><span class=cF0>.dvd_boot_is_good=</span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l219"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l220"></a> }
|
||
|
<a name="l221"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l222"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
||
|
<a name="l223"></a>}
|
||
|
<a name="l224"></a>
|
||
|
<a name="l225"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>BlkDevsInitAll</span><span class=cF0>()
|
||
|
<a name="l226"></a>{
|
||
|
<a name="l227"></a> </span><span class=cF9>CBlkDev</span><span class=cF0> *bd;
|
||
|
<a name="l228"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
||
|
<a name="l229"></a> </span><span class=cFB>blkdev</span><span class=cF0>.blkdevs=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CBlkDev</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF3>BLKDEVS_NUM</span><span class=cF0>);
|
||
|
<a name="l230"></a> </span><span class=cFB>blkdev</span><span class=cF0>.drvs=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDrv</span><span class=cF7>)</span><span class=cF0>*</span><span class=cF3>DRVS_NUM</span><span class=cF0>);
|
||
|
<a name="l231"></a> </span><span class=cF1>for</span><span class=cF0> (i=0;i<</span><span class=cF3>DRVS_NUM</span><span class=cF0>;i++)
|
||
|
<a name="l232"></a> </span><span class=cFB>blkdev</span><span class=cF0>.let_to_drv[i]=&</span><span class=cFB>blkdev</span><span class=cF0>.drvs[i];
|
||
|
<a name="l233"></a> #</span><span class=cF1>exe</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l234"></a> </span><span class=cF1>if</span><span class=cF0> (kernel_cfg->opts[CFG_MOUNT_IDE_AUTO])
|
||
|
<a name="l235"></a> </span><span class=cF5>StreamPrint</span><span class=cF0>(</span><span class=cF6>"MountIDEAuto;"</span><span class=cF0>);
|
||
|
<a name="l236"></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="l237"></a> </span><span class=cF5>StreamDoc</span><span class=cF0>(kernel_cfg->add_dev);
|
||
|
<a name="l238"></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="l239"></a> </span><span class=cF7>}</span><span class=cF0>;
|
||
|
<a name="l240"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|