1<html>
2
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="Microsoft FrontPage 5.0">
6<META http-equiv="Content-Style-Type" content="text/css">
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8<title>OSExec</title>
9</head>
10
11<body>
12
13<h1>OSExecl / OSExecv</h1>
14
15<h2>Syntax</h2>
16<dl><dd><pre class="construction">
17#include &lt;revolution/os.h&gt;
18
19void OSExecl(const char* dolfile, const char* arg0, .../*, (char*)NULL */);
20void OSExecv(const char* dolfile, char* const argv[]);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<th>dolfile</th>
27<td>Path name of the file to be executed. If a null string is specified, the default <CODE>dol</CODE> file (the one booted by IPL) is executed.</td>
28  </tr>
29  <tr>
30<th>arg0,...</th>
31<td>( A list of pointers to zero or more null-terminated strings that make up an argument list that can be used by the <CODE>dol</CODE> file to be executed (<code>OSExecl</code> function only). The list of arguments must be terminated by a NULL pointer.</td>
32  </tr>
33  <tr>
34<th>argv</th>
35<td>( An array of pointers to zero or more null-terminated strings that make up an argument list that can be used by new programs (<code>OSExecv</code> function only). The array of pointers must be terminated by a NULL pointer.</td>
36  </tr>
37</table>
38
39<h2>Return Values</h2>
40<p>None.</p>
41
42<h2>Description</h2>
43<P><code>OSExecl</code>/<code>OSExecv</code> execute a new <CODE>dol</CODE> file. If successful, the functions never return.</P>
44<P>The initial argument for these functions is the full pathname of the <CODE>dol</CODE> file to execute. If the null string is specified, the default <CODE>dol</CODE> file that the IPL boots is executed.</P>
45<P>If the specified <CODE>dol</CODE> file does not exist, an assertion error occurs when using the debug library. In this same case, the function returns immediately when using the release library.</P>
46<P>Arguments for <CODE>OSExecl</CODE> are in the order of <i><code>arg0, arg1, ..., argn</code></i>. Together they describe a list of pointers to zero or more null-terminated strings that represent the argument list available to the new <CODE>dol</CODE> file. The list of arguments must be terminated by a NULL pointer.</P>
47<P><code>OSExecv</code> provides an array of pointers to zero or more null-terminated strings that represent the argument list available to the new <CODE>dol</CODE> file. The array of pointers must be terminated by a NULL pointer.</P>
48
49<P>The controllers will not be recalibrated during an execution sequence.</P>
50<P>If the Game Disc cannot be read during an execution sequence for any reason (including no disc, retry error, fatal error, wrong error), <code>OSExecl</code>/<code>OSExecv</code> will return execution to the system menu. So if there is data not saved to the memory card, please make sure to save it before calling <code>OSExecl</code>/<code>OSExecv</code> (rather than passing the data using the save region feature).</P>
51<P>An <CODE>elf</CODE> file can be converted to a <CODE>dol</CODE> file using <code><a href="../../tools/makedol.html">makedol</a></code>.</P>
52
53<P><B>Note:</B> Data in memory is not guaranteed to remain unchanged after the <code>OSExecl</code> or <code>OSExecv</code> function is run. Use the <A href="OSSetSaveRegion.html"><CODE>OSSetSaveRegion</CODE></A> function to avoid data loss in a specified region.</P>
54
55<h2>See Also</h2>
56<P class="reference">
57<a href="OSSetSaveRegion.html">OSSetSaveRegion</a>,
58<a href="OSIsRestart.html">OSIsRestart</a>,
59<a href="../../tools/makedol.html">makedol</a>
60</p>
61
62<H2>Revision History</H2>
63<P>
642008/05/12 Revised the description of <CODE>OSSetSaveRegion</CODE>.<BR>2006/10/25 Revised explanation.<BR>2006/08/30 Re-released.<BR>2006/06/19 Temporarily deleted the release.<BR>2006/03/01 Initial version.
65</P>
66
67<hr><p>CONFIDENTIAL</p></body>
68</html>