add documentation into the source code

This commit is contained in:
Stefan Lankes 2013-11-08 22:55:29 +01:00
parent 4fd2b7f90c
commit 9ac39ba7ea
12 changed files with 3868 additions and 44 deletions

2289
Doxyfile Normal file

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/io.h
* @brief Functions related to processor IO
*
* This file contains inline functions for processor IO operations.
*/
#ifndef __ARCH_IO_H__
#define __ARCH_IO_H__
@ -32,32 +40,61 @@
extern "C" {
#endif
/** @brief Read a byte from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned char inportb(unsigned short _port) {
unsigned char rv;
asm volatile("inb %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Read a word (2 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned short inportw(unsigned short _port) {
unsigned short rv;
asm volatile("inw %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Read a double word (4 byte) from an IO port
*
* @param _port The port you want to read from
* @return The value which reads out from this port
*/
inline static unsigned int inportl(unsigned short _port) {
unsigned int rv;
asm volatile("inl %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
/** @brief Write a byte to an IO port
*
* @param _port The port you want to write to
* @param _data the 1 byte value you want to write
*/
inline static void outportb(unsigned short _port, unsigned char _data) {
asm volatile("outb %1, %0"::"dN"(_port), "a"(_data));
}
/** @brief Write a word (2 bytes) to an IO port
*
* @param _port The port you want to write to
* @param _data the 2 byte value you want to write
*/
inline static void outportw(unsigned short _port, unsigned short _data) {
asm volatile("outw %1, %0"::"dN"(_port), "a"(_data));
}
/** @brief Write a double word (4 bytes) to an IO port
*
* @param _port The port you want to write to
* @
inline static void outportl(unsigned short _port, unsigned int _data)
{
asm volatile("outl %1, %0"::"dN"(_port), "a"(_data));

View file

@ -25,16 +25,22 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/multiboot.h
* @brief Structures related to the Multiboot interface
*
* eduOS is able to use Multiboot (http://www.gnu.org/software/grub/manual/multiboot/),
* which specifies an interface between a boot loader and a operating system.\n
* \n
* This file contains several structures needed to match the interface.
*/
#ifndef __ARCH_MULTIBOOT_H__
#define __ARCH_MULTIBOOT_H__
#include <eduos/stddef.h>
/*
* eduOS is able to use Multiboot (http://www.gnu.org/software/grub/manual/multiboot/),
* which specifies an interface between a boot loader and a operating system
*/
typedef uint16_t multiboot_uint16_t;
typedef uint32_t multiboot_uint32_t;
typedef uint64_t multiboot_uint64_t;
@ -61,20 +67,20 @@ typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_t
struct multiboot_info
{
/* Multiboot info version number */
/** Multiboot info version number */
multiboot_uint32_t flags;
/* Available memory from BIOS */
/** Available memory from BIOS */
multiboot_uint32_t mem_lower;
multiboot_uint32_t mem_upper;
/* "root" partition */
/** "root" partition */
multiboot_uint32_t boot_device;
/* Kernel command line */
/** Kernel command line */
multiboot_uint32_t cmdline;
/* Boot-Module list */
/** Boot-Module list */
multiboot_uint32_t mods_count;
multiboot_uint32_t mods_addr;
@ -84,24 +90,24 @@ struct multiboot_info
multiboot_elf_section_header_table_t elf_sec;
} u;
/* Memory Mapping buffer */
/** Memory Mapping buffer */
multiboot_uint32_t mmap_length;
multiboot_uint32_t mmap_addr;
/* Drive Info buffer */
/** Drive Info buffer */
multiboot_uint32_t drives_length;
multiboot_uint32_t drives_addr;
/* ROM configuration table */
/** ROM configuration table */
multiboot_uint32_t config_table;
/* Boot Loader Name */
/** Boot Loader Name */
multiboot_uint32_t boot_loader_name;
/* APM table */
/** APM table */
multiboot_uint32_t apm_table;
/* Video */
/** Video */
multiboot_uint32_t vbe_control_info;
multiboot_uint32_t vbe_mode_info;
multiboot_uint16_t vbe_mode;
@ -125,14 +131,14 @@ typedef struct multiboot_mmap_entry multiboot_memory_map_t;
struct multiboot_mod_list
{
/* the memory used goes from bytes mod start to mod end-1 inclusive */
/** the memory used goes from bytes mod start to mod end-1 inclusive */
multiboot_uint32_t mod_start;
multiboot_uint32_t mod_end;
/* Module command line */
/** Module command line */
multiboot_uint32_t cmdline;
/* padding to take it to 16 bytes (must be zero) */
/** padding to take it to 16 bytes (must be zero) */
multiboot_uint32_t pad;
};
typedef struct multiboot_mod_list multiboot_module_t;

View file

@ -25,6 +25,14 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/processor.h
* @brief CPU-specific functions
*
* This file contains structures and functions related to CPU-specific assembler commands.
*/
#ifndef __ARCH_PROCESSOR_H__
#define __ARCH_PROCESSOR_H__
@ -34,6 +42,13 @@
extern "C" {
#endif
/** @brief Read out time stamp counter
*
* The rdtsc asm command puts a 64 bit time stamp value
* into EDX:EAX.
*
* @return The 64 bit time stamp value
*/
inline static uint64_t rdtsc(void)
{
uint64_t x;
@ -41,36 +56,38 @@ inline static uint64_t rdtsc(void)
return x;
}
/** @brief Flush cache
*
* The wbinvd asm instruction which stands for "Write back and invalidate"
* is used here
*/
inline static void flush_cache(void) {
asm volatile ("wbinvd" : : : "memory");
}
/** @brief Invalidate cache
*
* The invd asm instruction which invalidates cache without writing back
* is used here
*/
inline static void invalid_cache(void) {
asm volatile ("invd");
}
inline static int get_return_value(void) {
int ret;
asm volatile ("movl %%eax, %0" : "=r"(ret));
return ret;
}
/* Force strict CPU ordering */
#ifdef CONFIG_ROCKCREEK
inline static void mb(void) { asm volatile ("lock; addl $0,0(%%esp)" ::: "memory", "cc"); }
inline static void rmb(void) { asm volatile ("lock; addl $0,0(%%esp)" ::: "memory", "cc"); }
inline static void wmb(void) { asm volatile ("lock; addl $0,0(%%esp)" ::: "memory", "cc"); }
#else
/// Force strict CPU ordering, serializes load and store operations.
inline static void mb(void) { asm volatile("mfence" ::: "memory"); }
/// Force strict CPU ordering, serializes load operations.
inline static void rmb(void) { asm volatile("lfence" ::: "memory"); }
/// Force strict CPU ordering, serializes store operations.
inline static void wmb(void) { asm volatile("sfence" ::: "memory"); }
#endif
/// A one-instruction-do-nothing
#define NOP1 asm volatile ("nop")
/// A two-instruction-do-nothing
#define NOP2 asm volatile ("nop;nop")
/// A four-instruction-do-nothing
#define NOP4 asm volatile ("nop;nop;nop;nop")
/// A eight-instruction-do-nothing
#define NOP8 asm volatile ("nop;nop;nop;nop;nop;nop;nop;nop")
#ifdef __cplusplus

View file

@ -25,6 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file arch/x86/include/asm/vga.h
* @brief VGA output related code
*/
#ifndef __ARCH_VGA_H__
#define __ARCH_VGA_H__
@ -34,9 +40,24 @@
extern "C" {
#endif
/** @brief Initialize VGA output and clear the screen */
void vga_init(void);
/** @brief Simple string output on screen.
*
* If you want a new line you will have to "\\n".
*
* @return Length of output in bytes
*/
int vga_puts(const char *text);
/** @brief Simple character output on screen.
*
* @return The original input character casted to int
*/
int vga_putchar(unsigned char c);
/** @brief Clear the screen */
void vga_cls(void);
#ifdef __cplusplus

1
documentation/text/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.h

View file

@ -0,0 +1,20 @@
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath$doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</small></address>
<!--END !GENERATE_TREEVIEW-->
</body>
</html>

View file

@ -0,0 +1,54 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<link href="$relpath$tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath$jquery.js"></script>
<script type="text/javascript" src="$relpath$dynsections.js"></script>
$treeview
$search
$mathjax
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo">
<div id="ostrichlogo"><img src="../img/mike_ostrich.jpg" alt="Mike Ostrich, MetalSVM's official mascot" /></div>
<div id="lfbslogo"><img src="../img/lfbs_logo.gif" alt="Chair for Operating Systems" /></div>
<div id="rwthlogo"><img src="../img/rwth_logo.gif" alt="RWTH Aachen University" /></div>
</td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td style="padding-left: 0.5em;">
<div id="projectname">$projectname</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td style="padding-left: 0.5em;">
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<td>$searchbox</td>
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->

View file

@ -0,0 +1,187 @@
<doxygenlayout version="1.0">
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

File diff suppressed because it is too large Load diff

View file

@ -25,6 +25,12 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file include/eduos/stdio.h
* @brief Stringstream related functions. Mainly printf-stuff.
*/
#ifndef __STDIO_H__
#define __STDIO_H__
@ -36,27 +42,27 @@
extern "C" {
#endif
/*
/**
* Works like the ANSI C function puts
*/
int kputs(const char *);
/*
* Works like the ANSI c function putchar
/**
* Works like the ANSI C function putchar
*/
int kputchar(int);
/*
/**
* Works like the ANSI C function printf
*/
int kprintf(const char*, ...);
/*
/**
* Initialize the I/O functions
*/
int koutput_init(void);
/*
/**
* Scaled down version of printf(3)
*/
int kvprintf(char const *fmt, void (*func) (int, void *), void *arg, int radix, va_list ap);

View file

@ -25,6 +25,15 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @author Stefan Lankes
* @file include/eduos/stdlib.h
* @brief Kernel space malloc and free functions and conversion functions
*
* This file contains some memory alloc and free calls for the kernel
* and conversion functions.
*/
#ifndef __STDLIB_H__
#define __STDLIB_H__
@ -36,10 +45,6 @@
extern "C" {
#endif
void NORETURN abort(void);
void* kmalloc(size_t);
void kfree(void*, size_t);
#ifdef __cplusplus
}
#endif