templeos-info/public/Wb/Adam/ABlkDev/Mount.HC.HTML

191 lines
23 KiB
Plaintext
Raw Normal View History

2024-03-24 21:24:44 +00:00
<!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=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>&quot;Install;File/Cmd Line (Typically);Cmd Line (Typically);&quot;</span><span class=cF0>
<a name="l2"></a></span><span class=cF1>U8</span><span class=cF0> </span><span class=cF5>Mount2</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> boot_drv_let,</span><span class=cF9>CDoc</span><span class=cF0> *_doc,</span><span class=cF1>Bool</span><span class=cF0> _caller_is_prtdsk)
<a name="l3"></a>{</span><span class=cF2>//If _doc, called by </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF2> else called by </span><a href="/Wb/Adam/ABlkDev/Mount.HC.HTML#l138"><span class=cF4>Mount</span></a><span class=cF2>().</span><span class=cF0>
<a name="l4"></a> </span><span class=cF9>I64</span><span class=cF0> cnt,total=0,num_hints,drv_let,type,unit,prt_num;
<a name="l5"></a> </span><span class=cF1>U8</span><span class=cF0> blks_buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],addr_buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],base0_buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],base1_buf[</span><span class=cF3>STR_LEN</span><span class=cF0>],
<a name="l6"></a> *filename=</span><span class=cF3>NULL</span><span class=cF0>,*filename2=</span><span class=cF3>NULL</span><span class=cF0>,res=0;
<a name="l7"></a> </span><span class=cF9>CATARep</span><span class=cF0> *head=</span><span class=cF3>NULL</span><span class=cF0>,*tmpha;
<a name="l8"></a> </span><span class=cF1>Bool</span><span class=cF0> whole_drv,make_free;
<a name="l9"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc;
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (boot_drv_let)
<a name="l11"></a> boot_drv_let=</span><span class=cF5>Let2Let</span><span class=cF0>(boot_drv_let);
<a name="l12"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l13"></a> cnt=0;
<a name="l14"></a> </span><span class=cF1>if</span><span class=cF0> (!_doc)
<a name="l15"></a> </span><span class=cF5>DrvRep</span><span class=cF0>;
<a name="l16"></a> </span><span class=cF6>&quot;\n****** Mount Drives ******\n&quot;</span><span class=cF0>
<a name="l17"></a> </span><span class=cF6>&quot;$GREEN$A$FG$-$GREEN$B$FG$ are RAM drives.\n&quot;</span><span class=cF0>
<a name="l18"></a> </span><span class=cF6>&quot;$GREEN$C$FG$-$GREEN$L$FG$ are ATA hard drives.\n&quot;</span><span class=cF0>
<a name="l19"></a> </span><span class=cF6>&quot;$GREEN$M$FG$-$GREEN$P$FG$ are ISO file read drives.\n&quot;</span><span class=cF0>
<a name="l20"></a> </span><span class=cF6>&quot;$GREEN$Q$FG$-$GREEN$S$FG$ are ISO file write drives.\n&quot;</span><span class=cF0>
<a name="l21"></a> </span><span class=cF6>&quot;$GREEN$T$FG$-$GREEN$Z$FG$ are ATAPI CD/DVD drives.\n&quot;</span><span class=cF0>
<a name="l22"></a> </span><span class=cF6>&quot;\nDrive Letter ($PURPLE$&lt;ENTER&gt;$FG$ to exit):&quot;</span><span class=cF0>;
<a name="l23"></a> drv_let=</span><span class=cF5>Let2Let</span><span class=cF0>(</span><span class=cF5>GetChar</span><span class=cF0>);
<a name="l24"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l25"></a> </span><span class=cF1>if</span><span class=cF0> (type=</span><span class=cF5>Let2BlkDevType</span><span class=cF7>(</span><span class=cF0>drv_let</span><span class=cF7>)</span><span class=cF0>) {
<a name="l26"></a> whole_drv=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (_doc) </span><span class=cF7>{</span><span class=cF0> </span><span class=cF2>//Called by </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF0>
<a name="l28"></a> doc=_doc;
<a name="l29"></a> make_free=</span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l30"></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>//Called by </span><a href="/Wb/Adam/ABlkDev/Mount.HC.HTML#l138"><span class=cF4>Mount</span></a><span class=cF2>()</span><span class=cF0>
<a name="l31"></a> doc=</span><span class=cF5>DocNew</span><span class=cF0>;
<a name="l32"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;CBlkDev *bd;\n&quot;</span><span class=cF0>);
<a name="l33"></a> make_free=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l35"></a> unit=0;
<a name="l36"></a> prt_num=</span><span class=cF3>I64_MIN</span><span class=cF0>;
<a name="l37"></a> </span><span class=cF1>switch</span><span class=cF0> (type) </span><span class=cF7>{</span><span class=cF0>
<a name="l38"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_RAM</span><span class=cF0>:
<a name="l39"></a> </span><span class=cF6>&quot;Addr of RAM disk ($PURPLE$&lt;ENTER&gt;$FG$ to MAlloc):&quot;</span><span class=cF0>;
<a name="l40"></a> </span><span class=cF5>GetS</span><span class=cF0>(addr_buf,</span><span class=cF3>STR_LEN</span><span class=cF0>);
<a name="l41"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_WRITE</span><span class=cF0>:
<a name="l42"></a> </span><span class=cF6>&quot;Blks of 512 bytes:&quot;</span><span class=cF0>;
<a name="l43"></a> </span><span class=cF5>GetS</span><span class=cF0>(blks_buf,</span><span class=cF3>STR_LEN</span><span class=cF0>);
<a name="l44"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l45"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_READ</span><span class=cF0>:
<a name="l46"></a> filename=</span><span class=cF5>GetStr</span><span class=cF0>(</span><span class=cF6>&quot;File Name:&quot;</span><span class=cF0>);
<a name="l47"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l48"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATA</span><span class=cF0>:
<a name="l49"></a> prt_num=</span><span class=cF5>GetI64</span><span class=cF0>(</span><span class=cF6>&quot;Partition Num (Default=All):&quot;</span><span class=cF0>,prt_num);
<a name="l50"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATAPI</span><span class=cF0>:
<a name="l51"></a> num_hints=</span><span class=cF5>ATARep</span><span class=cF0>(,,&amp;head);
<a name="l52"></a> </span><span class=cF1>if</span><span class=cF0> (type==</span><span class=cF3>BDT_ATAPI</span><span class=cF0> &amp;&amp; boot_drv_let)
<a name="l53"></a> </span><span class=cF6>&quot;&lt;ENTER&gt; to use booted CD/DVD\n&quot;</span><span class=cF0>; </span><span class=cF2>//Only </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF0>
<a name="l54"></a> </span><span class=cF1>do</span><span class=cF0> {
<a name="l55"></a> </span><span class=cF1>if</span><span class=cF0> (num_hints)
<a name="l56"></a> </span><span class=cF6>&quot;Enter dev number or\nport with $PURPLE$0x$FG$ prefix.\n&quot;</span><span class=cF0>
<a name="l57"></a> </span><span class=cF6>&quot;I/O Port Base0:\n&quot;</span><span class=cF0>;
<a name="l58"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l59"></a> </span><span class=cF6>&quot;Include $PURPLE$0x$FG$ prefix.\nI/O Port Base0:\n&quot;</span><span class=cF0>;
<a name="l60"></a> </span><span class=cF5>GetS</span><span class=cF0>(base0_buf,</span><span class=cF3>STR_LEN</span><span class=cF0>);
<a name="l61"></a> } </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>base0_buf</span><span class=cF7>)</span><span class=cF0> &amp;&amp; </span><span class=cF7>(</span><span class=cF0>type!=</span><span class=cF3>BDT_ATAPI</span><span class=cF0> || !boot_drv_let</span><span class=cF7>)</span><span class=cF0>);
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (1&lt;=</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>base0_buf</span><span class=cF7>)</span><span class=cF0>&lt;=num_hints) {
<a name="l63"></a> tmpha=</span><span class=cF5>ATARepFind</span><span class=cF0>(head,</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>base0_buf</span><span class=cF7>)</span><span class=cF0>);
<a name="l64"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(base0_buf,</span><span class=cF6>&quot;0x%X&quot;</span><span class=cF0>,tmpha-&gt;base0);
<a name="l65"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(base1_buf,</span><span class=cF6>&quot;0x%X&quot;</span><span class=cF0>,tmpha-&gt;base1);
<a name="l66"></a> unit=tmpha-&gt;unit;
<a name="l67"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (type!=</span><span class=cF3>BDT_ATAPI</span><span class=cF0> || *base0_buf) {
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (type==</span><span class=cF3>BDT_ATAPI</span><span class=cF0>)
<a name="l69"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(base1_buf,</span><span class=cF6>&quot;0&quot;</span><span class=cF0>);
<a name="l70"></a> </span><span class=cF1>else</span><span class=cF0>
<a name="l71"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l72"></a> </span><span class=cF6>&quot;I/O Port Base1:\n&quot;</span><span class=cF0>;
<a name="l73"></a> </span><span class=cF5>GetS</span><span class=cF0>(base1_buf,</span><span class=cF3>STR_LEN</span><span class=cF0>);
<a name="l74"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF5>Str2I64</span><span class=cF7>(</span><span class=cF0>base1_buf</span><span class=cF7>)</span><span class=cF0>);
<a name="l75"></a> </span><span class=cF1>do</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l76"></a> </span><span class=cF6>&quot;\t$PURPLE$0$FG$=Master\n\t$PURPLE$1$FG$=Slave\nUnit:&quot;</span><span class=cF0>;
<a name="l77"></a> unit=</span><span class=cF5>GetChar</span><span class=cF0>-</span><span class=cF6>'0'</span><span class=cF0>;
<a name="l78"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>0&lt;=unit&lt;=1</span><span class=cF7>)</span><span class=cF0>);
<a name="l79"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
<a name="l80"></a> }
<a name="l81"></a> </span><span class=cF5>LinkedLstDel</span><span class=cF0>(head);
<a name="l82"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l83"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l84"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd=BlkDevNextFreeSlot(\'%C\',%d);bd-&gt;unit=%d;\n&quot;</span><span class=cF0>,
<a name="l85"></a> drv_let,type,unit);
<a name="l86"></a> </span><span class=cF1>switch</span><span class=cF0> (type) </span><span class=cF7>{</span><span class=cF0>
<a name="l87"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_RAM</span><span class=cF0>:
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (!*addr_buf) </span><span class=cF5>StrCpy</span><span class=cF0>(addr_buf,</span><span class=cF6>&quot;0&quot;</span><span class=cF0>);
<a name="l89"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;RAM_dsk=%s;\n&quot;</span><span class=cF0>,addr_buf);
<a name="l90"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_WRITE</span><span class=cF0>:
<a name="l91"></a> </span><span class=cF1>if</span><span class=cF0> (!*blks_buf) </span><span class=cF5>StrCpy</span><span class=cF0>(blks_buf,</span><span class=cF6>&quot;0&quot;</span><span class=cF0>);
<a name="l92"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;max_blk=(%s)-1;\n&quot;</span><span class=cF0>,blks_buf);
<a name="l93"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;drv_offset=19&lt;&lt;2+&quot;</span><span class=cF0>
<a name="l94"></a> </span><span class=cF6>&quot;(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n&quot;</span><span class=cF0>);
<a name="l95"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l96"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ISO_FILE_READ</span><span class=cF0>:
<a name="l97"></a> filename2=</span><span class=cF5>FileNameAbs</span><span class=cF0>(filename);
<a name="l98"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;file_dsk_name=AStrNew(\&quot;%s\&quot;);\n&quot;</span><span class=cF0>,filename2);
<a name="l99"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;drv_offset=19&lt;&lt;2+&quot;</span><span class=cF0>
<a name="l100"></a> </span><span class=cF6>&quot;(DVD_BLK_SIZE*2+DVD_BOOT_LOADER_SIZE)/BLK_SIZE;\n&quot;</span><span class=cF0>);
<a name="l101"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l102"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATA</span><span class=cF0>:
<a name="l103"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>BDT_ATAPI</span><span class=cF0>:
<a name="l104"></a> </span><span class=cF1>if</span><span class=cF0> (type==</span><span class=cF3>BDT_ATAPI</span><span class=cF0> &amp;&amp; !*base0_buf) {
<a name="l105"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;GetBaseUnit(bd);\n&quot;</span><span class=cF0>); </span><span class=cF2>//Only </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF0>
<a name="l106"></a> </span><span class=cF1>if</span><span class=cF0> (drv_let==boot_drv_let)
<a name="l107"></a> make_free=</span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l108"></a> } </span><span class=cF1>else</span><span class=cF0>
<a name="l109"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;bd-&gt;base0=%s;bd-&gt;base1=%s;\n&quot;</span><span class=cF0>,base0_buf,base1_buf);
<a name="l110"></a> </span><span class=cF1>if</span><span class=cF0> (type==</span><span class=cF3>BDT_ATA</span><span class=cF0> &amp;&amp; _caller_is_prtdsk) {
<a name="l111"></a> </span><span class=cF6>&quot;\nReformat WHOLE drive!&quot;</span><span class=cF0>;
<a name="l112"></a> whole_drv=</span><span class=cF5>YorN</span><span class=cF0>;
<a name="l113"></a> }
<a name="l114"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l115"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l116"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>&quot;BlkDevAdd(bd,%d,%d,%d);\n&quot;</span><span class=cF0>,prt_num,whole_drv,make_free);
<a name="l117"></a> </span><span class=cF1>if</span><span class=cF0> (_doc) </span><span class=cF2>//Called by </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF0>
<a name="l118"></a> cnt++;
<a name="l119"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0> </span><span class=cF2>//Called by </span><a href="/Wb/Adam/ABlkDev/Mount.HC.HTML#l138"><span class=cF4>Mount</span></a><span class=cF2>()</span><span class=cF0>
<a name="l120"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>cnt=</span><span class=cF5>ExeDoc</span><span class=cF0>(doc)</span><span class=cF7>)</span><span class=cF0> &amp;&amp; whole_drv) {
<a name="l121"></a> </span><span class=cF1>if</span><span class=cF0> (_caller_is_prtdsk) </span><span class=cF7>{</span><span class=cF0>
<a name="l122"></a> res=drv_let;
<a name="l123"></a> </span><span class=cF5>DskPrt</span><span class=cF0>(drv_let,1.0); </span><span class=cF2>//First mount whole drive.</span><span class=cF0>
<a name="l124"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
<a name="l125"></a> </span><span class=cF5>DskPrt</span><span class=cF0>(drv_let);
<a name="l126"></a> }
<a name="l127"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
<a name="l128"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l129"></a> }
<a name="l130"></a> total+=cnt;
<a name="l131"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>while</span><span class=cF0> (cnt &amp;&amp; !_caller_is_prtdsk ||
<a name="l132"></a> !total &amp;&amp; _doc); </span><span class=cF2>//At least 1 if Called by </span><a href="/Wb/Kernel/KCfg.HC.HTML#l1"><span class=cF4>::/Kernel/KCfg.HC</span></a><span class=cF0>
<a name="l133"></a> </span><span class=cF5>Free</span><span class=cF0>(filename);
<a name="l134"></a> </span><span class=cF5>Free</span><span class=cF0>(filename2);
<a name="l135"></a> </span><span class=cF1>return</span><span class=cF0> res;
<a name="l136"></a>}
<a name="l137"></a>
<a name="l138"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF5>Mount</span><span class=cF0>(</span><span class=cF1>Bool</span><span class=cF0> caller_is_prtdsk=</span><span class=cF3>FALSE</span><span class=cF0>)
<a name="l139"></a>{</span><span class=cF2>//Mount drives. Called from </span><a href="/Wb/Adam/ABlkDev/DskPrt.HC.HTML#l43"><span class=cF4>DskPrt(Mount)</span></a><span class=cF2>.</span><span class=cF0>
<a name="l140"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>Mount2</span><span class=cF0>(0,</span><span class=cF3>NULL</span><span class=cF0>,caller_is_prtdsk);
<a name="l141"></a>}
<a name="l142"></a>
<a name="l143"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Unmount</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> drv_let=0)
<a name="l144"></a>{</span><span class=cF2>//Unmount drive(s).</span><span class=cF0>
<a name="l145"></a> </span><span class=cF5>BlkDevDel</span><span class=cF0>(</span><span class=cF5>Let2BlkDev</span><span class=cF7>(</span><span class=cF0>drv_let</span><span class=cF7>)</span><span class=cF0>);
<a name="l146"></a>}
<a name="l147"></a>
<a name="l148"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> </span><span class=cF5>MountFile</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *filename)
<a name="l149"></a>{</span><span class=cF2>//Mount ISO.C file.</span><span class=cF0>
<a name="l150"></a> </span><span class=cF1>U8</span><span class=cF0> *filename2=</span><span class=cF5>ExtDft</span><span class=cF0>(filename,</span><span class=cF6>&quot;ISO.C&quot;</span><span class=cF0>),*filename3=</span><span class=cF5>FileNameAbs</span><span class=cF0>(filename2);
<a name="l151"></a> </span><span class=cF9>CDrv</span><span class=cF0> *dv=</span><span class=cF5>DrvMakeFreeSlot</span><span class=cF0>(</span><span class=cF5>DrvNextFreeLet</span><span class=cF7>(</span><span class=cF6>'M'</span><span class=cF7>)</span><span class=cF0>); </span><span class=cF2>//First </span><a href="/Wb/Kernel/KernelA.HH.HTML#l2604"><span class=cF4>BDT_ISO_FILE_READ</span></a><span class=cF0>
<a name="l152"></a> </span><span class=cF9>CBlkDev</span><span class=cF0> *bd=</span><span class=cF5>BlkDevNextFreeSlot</span><span class=cF0>(dv-&gt;drv_let,</span><span class=cF3>BDT_ISO_FILE_READ</span><span class=cF0>);
<a name="l153"></a> bd-&gt;drv_offset=19&lt;&lt;2+(</span><span class=cF3>DVD_BLK_SIZE</span><span class=cF0>*2+</span><span class=cF3>DVD_BOOT_LOADER_SIZE</span><span class=cF0>)/</span><span class=cF3>BLK_SIZE</span><span class=cF0>;
<a name="l154"></a> bd-&gt;file_dsk_name=</span><span class=cF5>AStrNew</span><span class=cF0>(filename3);
<a name="l155"></a> </span><span class=cF5>BlkDevAdd</span><span class=cF0>(bd,,</span><span class=cF3>TRUE</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
<a name="l156"></a> </span><span class=cF5>Free</span><span class=cF0>(filename3);
<a name="l157"></a> </span><span class=cF5>Free</span><span class=cF0>(filename2);
<a name="l158"></a> </span><span class=cF1>return</span><span class=cF0> dv-&gt;drv_let;
<a name="l159"></a>}
</span></pre></body>
</html>