Adds kernel docs.

This commit is contained in:
wilkie
2013-03-14 01:31:54 -04:00
commit 8c109b96af
78 changed files with 1800 additions and 0 deletions

25
kernel/core/error.html Normal file
View File

@@ -0,0 +1,25 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.error</title>
</head><body>
<h1>kernel.core.error</h1>
<!-- Generated by Ddoc from ../kernel/core/error.d -->
<br><br>
<dl><dt><big>enum <u>ErrorVal</u>;
</big></dt>
<dd>The kernel error value.<br><br>
<dl><dt><big><u>Success</u></big></dt>
<dd>Upon success.<br><br>
</dd>
<dt><big><u>Fail</u></big></dt>
<dd>Upon failure.<br><br>
</dd>
</dl>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>

29
kernel/core/kmain.html Normal file
View File

@@ -0,0 +1,29 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.kmain</title>
</head><body>
<h1>kernel.core.kmain</h1>
<!-- Generated by Ddoc from ../kernel/core/kmain.d -->
<br><br>
<dl><dt><big>void <u>kmain</u>(int <i>bootLoaderID</i>, void* <i>data</i>);
</big></dt>
<dd>The main function for the kernel.
This will receive <i>data</i> from the boot loader.
<br><br>
<b>Params:</b><br>
<table><tr><td>int <i>bootLoaderID</i></td>
<td>the unique identifier for a boot loader.</td></tr>
<tr><td>void* <i>data</i></td>
<td>a structure given by the boot loader.</td></tr>
</table><br>
</dd>
<dt><big>void <u>apEntry</u>();
</big></dt>
<dd>The entry point for a secondary core.<br><br>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>

69
kernel/core/kprintf.html Normal file
View File

@@ -0,0 +1,69 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.kprintf</title>
</head><body>
<h1>kernel.core.kprintf</h1>
<!-- Generated by Ddoc from ../kernel/core/kprintf.d -->
<br><br>
<dl><dt><big>template <u>kprintf</u>(char[] Format)</big></dt>
<dd>This template will generate code for printing and will do
all parsing of the format string at compile time
<br><br>
<b>USAGE:</b><br>
<u>kprintf</u>!("format string {specifier} ... ")(args...);
<br><br>
<b>Examples:</b><br>
<u>kprintf</u>!("Integer: {}")(10);
<u>kprintf</u>!("{!cls}Cleared the screen.")();
<u>kprintf</u>!("{!pos:2,3}At position (2,3)")();
<u>kprintf</u>!("{!fg:LightBlue!bg:Gray}{}")(25);
<u>kprintf</u>!("{!fg:Red}redness")();
<u>kprintf</u>!("{x} Hex!")(145);
<u>kprintf</u>!("Curly Brace: {{")();
<br><br>
<b>COMMANDS:</b><br>
!cls - Clears the screen.
!fg - Sets the foreground color, see the Color enum
in kernel/dev/console.d.
!bg - Sets the background color, same as above.
!pos - Moves the cursor to the x and y given, see example above.
<br><br>
<b>SPECIFIERS:</b><br>
{x} - Prints the hex value.
{u} - Treats as unsigned.
{} - Prints common form.
<br><br>
WHY IS IT COOL?
- Compile time parsing of format strings
- Type checking at compile time as well
- That means it can tell you that you are dumb before you execute.
- No need to specify type information.
<br><br>
- So we can do this and not care about the
output of the function:
<br><br>
auto blah = someFunction();
<u>kprintf</u>!("Some Arbitrary Info: {}")(blah);
<br><br>
WOWWY WOW WOW!<br><br>
</dd>
<dt><big>template <u>kprintfln</u>(char[] Format)</big></dt>
<dd>This template will generate code like kprintf but will also
print a newline afterward.
<br><br>
<b>USAGE:</b><br>
See kprintf.<br><br>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>

42
kernel/core/log.html Normal file
View File

@@ -0,0 +1,42 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.log</title>
</head><body>
<h1>kernel.core.log</h1>
<!-- Generated by Ddoc from ../kernel/core/log.d -->
<br><br>
<dl><dt><big>struct <u>Log</u>;
</big></dt>
<dd>This structure implements the logging for the kernel.
<br><br>
<b>USAGE:</b><br>
<pre class="d_code"> <font color=green>// DoAThing returns an ErrorVal
</font>
<u>Log</u>.print(<font color=red>"Doing a thing"</font>);
<u>Log</u>.result(DoAThing());
<font color=green>// Will Print:
</font> <font color=green>// Doing a thing ........................ [ OK ]
</font> <font color=green>// or
</font> <font color=green>// Doing a thing ........................ [FAIL]
</font></pre>
<br><br>
<dl><dt><big>static ErrorVal <u>print</u>(char[] <i>message</i>);
</big></dt>
<dd>This function prints a <i>message</i> and an error
to a log line on the screen.<br><br>
</dd>
<dt><big>static ErrorVal <u>result</u>(ErrorVal <i>e</i>);
</big></dt>
<dd>This function records the <u>result</u> for the last line in the log and
then pops it off the stack.<br><br>
</dd>
</dl>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>

58
kernel/core/syscall.html Normal file
View File

@@ -0,0 +1,58 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.syscall</title>
</head><body>
<h1>kernel.core.syscall</h1>
<!-- Generated by Ddoc from ../kernel/core/syscall.d -->
<br><br>
<dl><dt><big>class <u>SyscallImplementations</u>;
</big></dt>
<dd>This structure houses the implementations of system calls.
Do not call these directly.<br><br>
<dl><dt><big>static SyscallError <u>create</u>(out ubyte[] <i>ret</i>, CreateArgs* <i>params</i>);
</big></dt>
<dd>Create a memory segment.
<br><br>
<b>Implements:</b><br>
ubyte[] location = <u>create</u>(ubyte* location, ulong size, int mode);<br><br>
</dd>
<dt><big>static SyscallError <u>makeDeviceGib</u>(out bool <i>ret</i>, MakeDeviceGibArgs* <i>params</i>);
</big></dt>
<dd>Creates a segment for a device.
<br><br>
<b>Implements:</b><br>
bool success = <u>makeDeviceGib</u>(ubyte* gib, PhysicalAddress physAddr, ulong regionLength);<br><br>
</dd>
<dt><big>static SyscallError <u>map</u>(MapArgs* <i>params</i>);
</big></dt>
<dd>Maps an existing section of memory to a new location.
<br><br>
<b>Implements:</b><br>
void <u>map</u>(AddressSpace dest, ubyte[] location, ubyte* destination, AccessMode mode);<br><br>
</dd>
<dt><big>static SyscallError <u>createAddressSpace</u>(out AddressSpace <i>ret</i>, CreateAddressSpaceArgs* <i>params</i>);
</big></dt>
<dd>Create an address space for a process.
<br><br>
<b>Implements:</b><br>
AddressSpace space = <u>createAddressSpace</u>();<br><br>
</dd>
<dt><big>static SyscallError <u>yield</u>(YieldArgs* <i>params</i>);
</big></dt>
<dd>Yield the cpu to the given address space.
<br><br>
<b>Implements:</b><br>
void <u>yield</u>(AddressSpace dest, ulong idx);<br><br>
</dd>
</dl>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>

109
kernel/core/util.html Normal file
View File

@@ -0,0 +1,109 @@
<html><head>
<META http-equiv="content-type" content="text/html; charset=utf-8">
<title>kernel.core.util</title>
</head><body>
<h1>kernel.core.util</h1>
<!-- Generated by Ddoc from ../kernel/core/util.d -->
<br><br>
<dl><dt><big>template <u>FieldNames</u>(S,int idx = 0)</big></dt>
<dd>Given a struct type, gives a tuple of strings of the names of fields in the struct.<br><br>
</dd>
<dt><big>template <u>isCharType</u>(T)</big></dt>
<dd>Sees if a type is char, wchar, or dchar.<br><br>
</dd>
<dt><big>template <u>isIntType</u>(T)</big></dt>
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
</dd>
<dt><big>template <u>isUnsignedIntType</u>(T)</big></dt>
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
</dd>
<dt><big>template <u>isSignedIntType</u>(T)</big></dt>
<dd>Sees if a type is a signed or unsigned byte, short, int, or long.<br><br>
</dd>
<dt><big>template <u>isFloatType</u>(T)</big></dt>
<dd>Sees if a type is float, double, or real.<br><br>
</dd>
<dt><big>template <u>isArrayType</u>(T)</big></dt>
<dd>Sees if a type is an array.<br><br>
</dd>
<dt><big>template <u>isAAType</u>(T)</big></dt>
<dd>Sees if a type is an associative array.<br><br>
</dd>
<dt><big>template <u>isPointerType</u>(T)</big></dt>
<dd>Sees if a type is a pointer.<br><br>
</dd>
<dt><big>template <u>realType</u>(T)</big></dt>
<dd>Get to the bottom of any chain of typedefs! Returns the first non-typedef'ed type.<br><br>
</dd>
<dt><big>template <u>IsLower</u>(char c)</big></dt>
<dd>See if a character is a lowercase character.<br><br>
</dd>
<dt><big>template <u>IsUpper</u>(char c)</big></dt>
<dd>See if a character is an uppercase character.<br><br>
</dd>
<dt><big>template <u>ToLower</u>(char c)<br>template <u>ToLower</u>(char[] s)</big></dt>
<dd>Convert a character or string to lowercase.<br><br>
</dd>
<dt><big>template <u>ToUpper</u>(char c)<br>template <u>ToUpper</u>(char[] s)</big></dt>
<dd>Convert a character or string to uppercase.<br><br>
</dd>
<dt><big>template <u>Capitalize</u>(char[] s)</big></dt>
<dd><u>Capitalize</u> a word so that the first letter is capital.<br><br>
</dd>
<dt><big>template <u>Map</u>(alias Templ,List...)</big></dt>
<dd>Compile-time map. Takes a template "function" which should take a single argument
of the type of the elements of the list of values that follows. Resolves to a tuple.<br><br>
</dd>
<dt><big>template <u>Reduce</u>(alias Templ,List...)</big></dt>
<dd>Compile-time reduce. Takes a template "function" that should take two arguments of the type
of the elements of the list of values that follows. The list must be at least one element
long. Resolves to a single value of the type that the template function returns.<br><br>
</dd>
<dt><big>template <u>Range</u>(uint min,uint max)<br>template <u>Range</u>(uint max)</big></dt>
<dd>Compile-time range. Given lower and upper bound, yields a tuple of integers in the
range [min, max).<br><br>
</dd>
<dt><big>template <u>Cat</u>(T...)</big></dt>
<dd>Compile time metafunction meant to be used with Reduce. Concatenates its first two
arguments and resolves to the result of that concatentation.<br><br>
</dd>
<dt><big>char[] <u>itoa</u>(char[] <i>buf</i>, char <i>base</i>, long <i>d</i>);
</big></dt>
<dd>This function converts an integer to a string, depending on the <i>base</i> passed in.
<br><br>
<b>Params:</b><br>
<table><tr><td>char[] <i>buf</i></td>
<td>The function will save the translated string into this character array.</td></tr>
<tr><td>char <i>base</i></td>
<td>The <i>base</i> of the integer value. If "<i>d</i>," it will be assumed to be decimal. If "x," the integer
will be hexadecimal.</td></tr>
<tr><td>long <i>d</i></td>
<td>The integer to translate.</td></tr>
</table><br>
<b>Returns:</b><br>
The translated string in a character array.<br><br>
</dd>
</dl>
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/1.0/ddoc.html">Ddoc</a>. </small>
</body></html>