12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- {
- title: 'Serving from ROM',
- crumbs: [
- { "Developer's Guide": '../developers/' },
- ],
- }
- <h1>Serving Pages from ROM</h1>
- <p>To enable GoAhead to be used on embedded systems without file systems, GoAhead supports the compilation of
- web pages and configuration files into C code that can be stored in Read-Only-Memory (ROM) and fetched by
- GoAhead to respond to relevant requests.</p>
- <p>GoAhead has a virtual file system interface that allows the run-time switching between serving web pages
- on a disk-based file system and a compiled ROM based store of web pages.
- This ROM facility may also be used to enhance security by preventing the modification of web documents,
- or in performance critical situations were the serving of web pages from memory may be an effective
- optimization.</p>
- <h2>Configuring GoAhead</h2>
- <p>To build GoAhead with support for ROM based file systems, you need to run configure with the <em>--rom</em>
- option. For example:</p>
- <pre class="ui code segment">./configure --rom</pre>
- <p>With the --rom option, configure will set the ME_ROM compiler definition to <em>1</em> and will enable
- the ROM file system.</p>
-
- <h2>Compiling Web Pages</h2>
- <p>The GoAhead <b>webcomp</b> program is used to compile web documents, configuration files, and any other
- files that you would like to be compiled into C code. The webcomp program will parse the files and convert
- them into C data structures which can then be compiled by your C/C++ compiler and linked into your
- application. For example:</p>
- <pre class="ui code segment">find *.txt web -print >fileList webcomp filelist >rom.c</pre>
- <p>This will create a list of all the web files and then convert these files into C structures in the file
- rom.c.</p>
- <p>The <b>webcomp</b> program takes one options:</p>
- <table title="Switches" class="ui table width">
- <thead>
- <tr>
- <th>Switch</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>--strip</td>
- <td>Specifies a prefix to strip from each of the compiled file names.</td>
- </tr>
- </tbody>
- </table>
|