doxygen fixes
authorJohn Hodge <[email protected]>
Fri, 5 Mar 2010 14:56:41 +0000 (22:56 +0800)
committerJohn Hodge <[email protected]>
Fri, 5 Mar 2010 14:56:41 +0000 (22:56 +0800)
19 files changed:
Kernel/Doxyfile
Kernel/Makefile.BuildNum
Kernel/arch/x86/include/mm_phys.h
Kernel/arch/x86/mm_phys.c
Kernel/bin/elf.h
Kernel/binary.c
Kernel/drv/fifo.c
Kernel/drv/vterm.c
Kernel/include/acess.h
Kernel/include/apidoc_mainpage.h
Kernel/include/binary.h
Kernel/include/binary_ext.h
Kernel/include/tpl_drv_common.h
Kernel/include/tpl_drv_terminal.h
Kernel/include/vfs_ext.h
Kernel/lib.c
Kernel/vfs/fs/fs_fat.h
Kernel/vfs/mount.c
Modules/IPStack/tcp.c

index acc5ed8..a474dd5 100644 (file)
@@ -593,7 +593,7 @@ RECURSIVE              = YES
 # excluded from the INPUT source files. This way you can easily exclude a 
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE                = 
+EXCLUDE                = arch/archdoc.h
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
 # directories that are symbolic links (a Unix filesystem feature) are excluded 
index 96320a6..e07c2ce 100644 (file)
@@ -1 +1 @@
-BUILD_NUM = 1508
+BUILD_NUM = 1510
index 51a9cd3..f72ebf6 100644 (file)
@@ -8,8 +8,8 @@
 // === FUNCTIONS ===
 extern tPAddr  MM_AllocPhys();
 extern tPAddr  MM_AllocPhysRange(int Pages, int MaxBits);
-extern void    MM_RefPhys(tPAddr Addr);
-extern void    MM_DerefPhys(tPAddr Addr);
+extern void    MM_RefPhys(tPAddr PAddr);
+extern void    MM_DerefPhys(tPAddr PAddr);
 extern int     MM_GetRefCount(tPAddr Addr);
 
 #endif
index 595a5e9..e4199e3 100644 (file)
@@ -17,8 +17,8 @@ extern void   gKernelEnd;
 // === PROTOTYPES ===
 tPAddr MM_AllocPhys();
 tPAddr MM_AllocPhysRange(int Pages, int MaxBits);
-void   MM_RefPhys(tPAddr Addr);
-void   MM_DerefPhys(tPAddr Addr);
+void   MM_RefPhys(tPAddr PAddr);
+void   MM_DerefPhys(tPAddr PAddr);
 
 // === GLOBALS ===
 Uint64 giPhysAlloc = 0;        // Number of allocated pages
@@ -305,46 +305,48 @@ tPAddr MM_AllocPhysRange(int Pages, int MaxBits)
 }
 
 /**
- * \fn void MM_RefPhys(tPAddr Addr)
+ * \fn void MM_RefPhys(tPAddr PAddr)
  */
-void MM_RefPhys(tPAddr Addr)
+void MM_RefPhys(tPAddr PAddr)
 {
        // Get page number
-       Addr >>= 12;
+       PAddr >>= 12;
        
        // We don't care about non-ram pages
-       if(Addr >= giPageCount) return;
+       if(PAddr >= giPageCount)        return;
        
        // Lock Structures
        LOCK( &giPhysAlloc );
        
        // Reference the page
        if(gaPageReferences)
-               gaPageReferences[ Addr ] ++;
+               gaPageReferences[ PAddr ] ++;
        
        // Mark as used
-       gaPageBitmap[ Addr / 32 ] |= 1 << (Addr&31);
+       gaPageBitmap[ PAddr / 32 ] |= 1 << (PAddr&31);
        
        // Mark used block
-       if(gaPageBitmap[ Addr / 32 ] == -1)     gaSuperBitmap[Addr/1024] |= 1 << ((Addr/32)&31);
+       if(gaPageBitmap[ PAddr / 32 ] == -1)
+               gaSuperBitmap[PAddr/1024] |= 1 << ((PAddr/32)&31);
        
        // Release Spinlock
        RELEASE( &giPhysAlloc );
 }
 
 /**
- * \fn void MM_DerefPhys(Uint32 Addr)
+ * \fn void MM_DerefPhys(tPAddr PAddr)
+ * \brief Dereferences a physical page
  */
-void MM_DerefPhys(tPAddr Addr)
+void MM_DerefPhys(tPAddr PAddr)
 {
        // Get page number
-       Addr >>= 12;
+       PAddr >>= 12;
        
        // We don't care about non-ram pages
-       if(Addr >= giPageCount) return;
+       if(PAddr >= giPageCount)        return;
        
        // Check if it is freed
-       if(gaPageReferences[ Addr ] == 0) {
+       if(gaPageReferences[ PAddr ] == 0) {
                Warning("MM_DerefPhys - Non-referenced memory dereferenced");
                return;
        }
@@ -352,19 +354,19 @@ void MM_DerefPhys(tPAddr Addr)
        // Lock Structures
        LOCK( &giPhysAlloc );
        
-       if( giLastPossibleFree < Addr )
-               giLastPossibleFree = Addr;
+       if( giLastPossibleFree < PAddr )
+               giLastPossibleFree = PAddr;
 
        // Dereference
-       gaPageReferences[ Addr ] --;
+       gaPageReferences[ PAddr ] --;
        
        // Mark as free in bitmaps
-       if( gaPageReferences[ Addr ] == 0 )
+       if( gaPageReferences[ PAddr ] == 0 )
        {
-               //LOG("Freed 0x%x by %p\n", Addr<<12, __builtin_return_address(0));
-               gaPageBitmap[ Addr / 32 ] &= ~(1 << (Addr&31));
-               if(gaPageReferences[ Addr ] == 0)
-                       gaSuperBitmap[ Addr >> 10 ] &= ~(1 << ((Addr >> 5)&31));
+               //LOG("Freed 0x%x by %p\n", PAddr<<12, __builtin_return_address(0));
+               gaPageBitmap[ PAddr / 32 ] &= ~(1 << (PAddr&31));
+               if(gaPageReferences[ PAddr ] == 0)
+                       gaSuperBitmap[ PAddr >> 10 ] &= ~(1 << ((PAddr >> 5)&31));
        }
        
        // Release spinlock
index 07f5ec1..1ff2128 100644 (file)
@@ -1,16 +1,15 @@
 /**\r
- Acess v1\r
- \file bin_elf.h\r
- \brief ELF Exeutable Loader\r
-*/\r
+ * \file elf.h\r
+ * \brief ELF Exeutable Loader\r
+ */\r
 #ifndef _BIN_ELF_H\r
 #define _BIN_ELF_H\r
 \r
 /**\r
- \struct elf_header_s\r
- \brief ELF File Header\r
-*/\r
-struct sElf32_Ehdr {\r
+ * \brief ELF File Header\r
+ */\r
+struct sElf32_Ehdr\r
+{\r
        union {\r
                char    ident[16];      //!< Identifier Bytes\r
                struct {\r
@@ -36,17 +35,18 @@ struct sElf32_Ehdr {
 } __attribute__ ((packed));\r
 \r
 /**\r
- \name Executable Types\r
- \{\r
-*/\r
-#define        ET_NONE         0       //!< NULL Type\r
-#define        ET_REL          1       //!< Relocatable (Object)\r
-#define ET_EXEC                2       //!< Executable\r
-#define ET_DYN         3       //!< Dynamic Library\r
-#define ET_CORE                4       //!< Core?\r
-#define ET_LOPROC      0xFF00  //!< Low Impl Defined\r
-#define ET_HIPROC      0xFFFF  //!< High Impl Defined\r
-//! \}\r
+ * \brief Executable Types\r
+ */\r
+enum eElf32_ExecTypes\r
+{\r
+       ET_NONE = 0,    //!< NULL Type\r
+       ET_REL  = 1,    //!< Relocatable (Object)\r
+       ET_EXEC = 2,    //!< Executable\r
+       ET_DYN  = 3,    //!< Dynamic Library\r
+       ET_CORE = 4,    //!< Core?\r
+       ET_LOPROC = 0xFF00,     //!< Low Impl Defined\r
+       ET_HIPROC = 0xFFFF      //!< High Impl Defined\r
+};\r
 \r
 /**\r
  \name Section IDs\r
index a98e192..229031f 100644 (file)
@@ -43,7 +43,7 @@ tBinary *Binary_DoLoad(char *truePath);
 void   Binary_Dereference(tBinary *Info);\r
 Uint   Binary_Relocate(void *Base);\r
 Uint   Binary_GetSymbolEx(char *Name, Uint *Value);\r
-Uint   Binary_FindSymbol(void *Base, char *Name, Uint *val);\r
+Uint   Binary_FindSymbol(void *Base, char *Name, Uint *Val);\r
 \r
 // === GLOBALS ===\r
  int   glBinListLock = 0;\r
@@ -245,17 +245,16 @@ Uint Binary_Load(char *file, Uint *entryPoint)
 }\r
 \r
 /**\r
- \fn tBinary *Binary_GetInfo(char *truePath)\r
- \brief Finds a matching binary entry\r
- \param truePath       File Identifier (True path name)\r
-*/\r
-tBinary *Binary_GetInfo(char *truePath)\r
+ * \brief Finds a matching binary entry\r
+ * \param TruePath     File Identifier (True path name)\r
+ */\r
+tBinary *Binary_GetInfo(char *TruePath)\r
 {\r
        tBinary *pBinary;\r
        pBinary = glLoadedBinaries;\r
        while(pBinary)\r
        {\r
-               if(strcmp(pBinary->TruePath, truePath) == 0)\r
+               if(strcmp(pBinary->TruePath, TruePath) == 0)\r
                        return pBinary;\r
                pBinary = pBinary->Next;\r
        }\r
@@ -548,22 +547,22 @@ void Binary_Dereference(tBinary *Info)
 }\r
 \r
 /**\r
\fn char *Binary_RegInterp(char *path)\r
- \brief Registers an Interpreter\r
\param path   Path to interpreter provided by executable\r
-*/\r
-char *Binary_RegInterp(char *path)\r
* \fn char *Binary_RegInterp(char *Path)\r
\brief Registers an Interpreter\r
* \param Path Path to interpreter provided by executable\r
+ */\r
+char *Binary_RegInterp(char *Path)\r
 {\r
         int    i;\r
        // NULL Check Argument\r
-       if(path == NULL)        return NULL;\r
+       if(Path == NULL)        return NULL;\r
        // NULL Check the array\r
        if(gsaRegInterps == NULL)\r
        {\r
                giRegInterps = 1;\r
                gsaRegInterps = malloc( sizeof(char*) );\r
-               gsaRegInterps[0] = malloc( strlen(path) );\r
-               strcpy(gsaRegInterps[0], path);\r
+               gsaRegInterps[0] = malloc( strlen(Path) );\r
+               strcpy(gsaRegInterps[0], Path);\r
                return gsaRegInterps[0];\r
        }\r
        \r
@@ -577,8 +576,8 @@ char *Binary_RegInterp(char *path)
        // Interpreter is not in list\r
        giRegInterps ++;\r
        gsaRegInterps = malloc( sizeof(char*)*giRegInterps );\r
-       gsaRegInterps[i] = malloc( strlen(path) );\r
-       strcpy(gsaRegInterps[i], path);\r
+       gsaRegInterps[i] = malloc( strlen(Path) );\r
+       strcpy(gsaRegInterps[i], Path);\r
        return gsaRegInterps[i];\r
 }\r
 \r
@@ -586,11 +585,12 @@ char *Binary_RegInterp(char *path)
 // Kernel Binary Handling\r
 // ============\r
 /**\r
- * \fn void *Binary_LoadKernel(char *path)\r
+ * \fn void *Binary_LoadKernel(char *File)\r
  * \brief Load a binary into kernel space\r
  * \note This function shares much with #Binary_Load, but does it's own mapping\r
+ * \param File File to load into the kernel\r
  */\r
-void *Binary_LoadKernel(char *file)\r
+void *Binary_LoadKernel(char *File)\r
 {\r
        char    *sTruePath;\r
        tBinary *pBinary;\r
@@ -805,13 +805,13 @@ Uint Binary_GetSymbolEx(char *Name, Uint *Value)
 }\r
 \r
 /**\r
- * \fn Uint Binary_GetSymbolBin(void *Base, char *Name, Uint *val)\r
+ * \fn Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val)\r
  * \brief Get a symbol from the specified library\r
  * \param Base Base address\r
  * \param Name Name of symbol to find\r
- * \param val  Pointer to place final value\r
+ * \param Val  Pointer to place final value\r
  */\r
-Uint Binary_FindSymbol(void *Base, char *Name, Uint *val)\r
+Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val)\r
 {\r
        Uint32  ident = *(Uint32*) Base;\r
        tBinaryType     *bt = gRegBinTypes;\r
@@ -819,7 +819,7 @@ Uint Binary_FindSymbol(void *Base, char *Name, Uint *val)
        for(; bt; bt = bt->Next)\r
        {\r
                if( (ident & bt->Mask) == (Uint)bt->Ident )\r
-                       return bt->GetSymbol(Base, Name, val);\r
+                       return bt->GetSymbol(Base, Name, Val);\r
        }\r
        \r
        Warning("[BIN ] 0x%x is an unknown file type. (0x%x 0x%x 0x%x 0x%x)",\r
index b028fcb..7bb4ca3 100644 (file)
@@ -132,7 +132,8 @@ int FIFO_MkNod(tVFS_Node *Node, char *Name, Uint Flags)
 }
 
 /**
- * \fn void FIFO_Close(vfs_node *Node)
+ * \fn void FIFO_Close(tVFS_Node *Node)
+ * \brief Close a FIFO end
  */
 void FIFO_Close(tVFS_Node *Node)
 {
index 716a553..7aebd28 100644 (file)
@@ -19,8 +19,8 @@
 #define MAX_INPUT_CHARS32      64
 #define MAX_INPUT_CHARS8       (MAX_INPUT_CHARS32*4)
 #define VT_SCROLLBACK  1       // 2 Screens of text
-//#define DEFAULT_OUTPUT       "VGA"
-#define DEFAULT_OUTPUT "BochsGA"
+#define DEFAULT_OUTPUT "VGA"
+//#define DEFAULT_OUTPUT       "BochsGA"
 #define DEFAULT_INPUT  "PS2Keyboard"
 #define        DEFAULT_WIDTH   80
 #define        DEFAULT_HEIGHT  25
@@ -484,6 +484,11 @@ void VT_SetTerminal(int ID)
 /**
  * \fn void VT_KBCallBack(Uint32 Codepoint)
  * \brief Called on keyboard interrupt
+ * \param Codepoint    Pseudo-UTF32 character
+ * 
+ * Handles a key press and sends the key code to the user's buffer.
+ * If the code creates a kernel-magic sequence, it is not passed to the
+ * user and is handled in-kernel.
  */
 void VT_KBCallBack(Uint32 Codepoint)
 {
index 65a4b6e..2cd927b 100644 (file)
@@ -179,11 +179,11 @@ extern void       MM_Deallocate(tVAddr VAddr);
  */
 extern int     MM_Map(tVAddr VAddr, tPAddr PAddr);
 /**
- * \brief Get the physical address of \a VAddr
- * \param VAddr        Address of the page to get the physical address of
- * \return Physical page mapped at \a VAddr
+ * \brief Get the physical address of \a Addr
+ * \param Addr Address of the page to get the physical address of
+ * \return Physical page mapped at \a Addr
  */
-extern tPAddr  MM_GetPhysAddr(tVAddr VAddr);
+extern tPAddr  MM_GetPhysAddr(tVAddr Addr);
 /**
  * \brief Checks is a memory range is user accessable
  * \param VAddr        Base address to check
index f2da43a..98a5e40 100644 (file)
@@ -2,9 +2,7 @@
  * \file apidoc_mainpage.h
  * \brief API Documentation Home Page
  * \author John Hodge (thePowersGang)
- */
-
-/**
+ * 
  * \mainpage Acess 2 Kernel API Documentation
  * 
  * \section intro Introduction
index fe80f5b..77ccdd7 100644 (file)
@@ -7,6 +7,13 @@
 #define _BINARY_H
 
 // === TYPES ===
+/**
+ * \brief Representation of a page in a binary file
+ * 
+ * Tells the binary loader where the page data resides on disk and where
+ * to load it to (relative to the binary base). Once the data is read,
+ * the \a Physical field contains the physical address of the page.
+ */
 typedef struct sBinaryPage
 {
        /**
@@ -157,6 +164,17 @@ typedef struct sBinaryType
  */
 extern char    *Binary_RegInterp(char *Path);
 
+/**
+ * \brief Registers a binary type with the kernel's loader
+ * \param Type Pointer to the loader's type structure
+ * \return Boolean success
+ * \note The structure \a Type must be persistant (usually it will be a
+ *       constant global variable)
+ * 
+ * This function tells the binary loader about a new file type, and gives
+ * it the functions to read the type into a ::tBinary structure, relocate
+ * it and to find the value of symbols defined within the binary.
+ */
 extern  int    Binary_RegisterType(tBinaryType *Type);
 
 #endif
index 8b8a6df..67c6073 100644 (file)
@@ -12,6 +12,6 @@ extern void   *Binary_LoadKernel(char *Path);
 extern Uint    Binary_Relocate(void *Mem);
 extern void    Binary_Unload(void *Base);
 extern int     Binary_GetSymbol(char *Name, Uint *Dest);
-extern Uint    Binary_FindSymbol(void *Base, char *Name, Uint *Dest);
+extern Uint    Binary_FindSymbol(void *Base, char *Name, Uint *Val);
 
 #endif
index f281c0e..632f3dc 100644 (file)
@@ -78,10 +78,31 @@ enum eTplDrv_IOCtl {
        DRV_IOCTL_LOOKUP
 };
 
-//! \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls
-//! These are the official lookup names of the core calls
+/**
+ * \brief eTplDrv_IOCtl.DRV_IOCTL_LOOKUP names for the core IOCtls
+ * These are the official lookup names of the core calls
+ */
 #define        DRV_IOCTLNAMES  "type", "ident", "version", "lookup"
 
+/**
+ * \brief Helper macro for the base IOCtl calls
+ * \param _type        Type number from eTplDrv_Type to return
+ * \param _ident       String of max 32-characters that identifies this driver
+ * \param _version     Driver's 8.8.8 BCD version number
+ * \param _ioctls      Pointer to the IOCtls string array
+ * \warning If you have DEBUG enabled in the calling file, this function
+ *          will do LEAVE()s before returning, so make sure that the
+ *          IOCtl function is ENTER()ed when using debug with this macro
+ * 
+ * Usage: (Id is the IOCtl call ID)
+ * \code
+ * switch(Id)
+ * {
+ * BASE_IOCTLS(DRV_TYPE_MISC, "Ident", 0x100, csaIOCtls)
+ * // Your IOCtls go here, starting at index 4
+ * }
+ * \endcode
+ */
 #define BASE_IOCTLS(_type, _ident, _version, _ioctls)  \
        case DRV_IOCTL_TYPE:    LEAVE('i', (_type));    return (_type);\
        case DRV_IOCTL_IDENT: {\
index 21ba290..ee50392 100644 (file)
@@ -103,6 +103,11 @@ enum eTplTerminal_Modes {
         */\r
        TERM_MODE_FB,\r
        \r
+       /**\r
+        * \brief 32bpp 2D Accellerated mode\r
+        * Writes to the terminal file will be read as a command stream\r
+        * defined in ::eTplTerminal_2D_Commands\r
+        */\r
        TERM_MODE_2DACCEL,\r
        \r
        /**\r
@@ -119,17 +124,27 @@ enum eTplTerminal_Modes {
        NUM_TERM_MODES\r
 };\r
 \r
+/**\r
+ * \brief 2D Command IDs\r
+ * \todo Complete this structure\r
+ * \r
+ * Command IDs for when the terminal type is eTplTerminal_Modes.TERM_MODE_2DACCEL\r
+ */\r
 enum eTplTerminal_2D_Commands\r
 {\r
+       /**\r
+        * \brief No Operation - Used for padding\r
+        */\r
        TERM_2DCMD_NOP,\r
        \r
        /**\r
         * (Uint16 X, Y, W, H, Uint32 Data[])\r
+        * \brief Blits a bitmap to the display\r
         * \param X,Y   Coordinates of Top-Left corner\r
         * \param W,H   Dimensions\r
         * \param Data  32-bpp pixel data\r
         */\r
-       TERM_2DCMD_PUSH,\r
+       TERM_2DCMD_PUSH\r
 };\r
 \r
 #endif\r
index 816c4a0..2fd7fd3 100644 (file)
@@ -7,7 +7,7 @@
 #define _VFS_EXT_H
 
 // === CONSTANTS ===
-//! maximum size of a Memory Path generated by VFS_GetMemPath
+//! Maximum size of a Memory Path generated by VFS_GetMemPath
 #define        VFS_MEMPATH_SIZE        (3 + (BITS/8)*2)
 /**
  * \name Flags for VFS_Open
@@ -165,7 +165,7 @@ extern int  VFS_ChRoot(char *New);
  * \brief Change the location of the current file pointer
  * \param FD   File handle returned by ::VFS_Open
  * \param Offset       Offset within the file to go to
- * \param Whence       A direction from ::eVFS_SeekDirs
+ * \param Direction    A direction from ::eVFS_SeekDirs
  * \return Boolean success
  */
 extern int     VFS_Seek(int FD, Sint64 Offset, int Direction);
index 967c03a..bfae2a4 100644 (file)
@@ -262,7 +262,7 @@ int tolower(int c)
 }
 
 /**
- * \fn int strucmp(char *Str1, char *Str2)
+ * \fn int strucmp(const char *Str1, const char *Str2)
  * \brief Compare \a Str1 and \a Str2 case-insensitively
  */
 int strucmp(const char *Str1, const char *Str2)
@@ -309,7 +309,7 @@ Uint strlen(const char *__str)
 }
 
 /**
- * \fn char *strcpy(const char *__str1, const char *__str2)
+ * \fn char *strcpy(char *__str1, const char *__str2)
  * \brief Copy a string to a new location
  */
 char *strcpy(char *__str1, const char *__str2)
@@ -321,7 +321,7 @@ char *strcpy(char *__str1, const char *__str2)
 }
 
 /**
- * \fn char *strcpy(const char *__str1, const char *__str2)
+ * \fn char *strncpy(char *__str1, const char *__str2, size_t max)
  * \brief Copy a string to a new location
  */
 char *strncpy(char *__str1, const char *__str2, size_t max)
index 6b7dfe7..a4f7f7b 100644 (file)
@@ -3,13 +3,16 @@
  * FAT12/16/32 Driver\r
  * vfs/fs/fs_fat.h\r
  */\r
+#ifndef _FS_FAT_H_\r
+#define _FS_FAT_H_\r
 \r
 // === On Disk Structures ===\r
 /**\r
- \struct fat_bootsect_s\r
- \brief Bootsector format\r
-*/\r
-struct fat_bootsect_s {\r
+ * \struct fat_bootsect_s\r
+ * \brief Bootsector format\r
+ */\r
+struct fat_bootsect_s\r
+{\r
        Uint8   jmp[3]; //!< Jump Instruction\r
        char    oemname[8];     //!< OEM Name. Typically MSDOS1.1\r
        Uint16  bps;    //!< Bytes per Sector. Assumed to be 512\r
@@ -58,7 +61,6 @@ struct fat_bootsect_s {
 */\r
 struct fat_filetable_s {\r
        char    name[11];       //!< 8.3 Name\r
-       //char  ext[3]; //!< Extention\r
        Uint8   attrib; //!< File Attributes.\r
        Uint8   ntres;  //!< Reserved for NT - Set to 0\r
        Uint8   ctimems;        //!< 10ths of a second ranging from 0-199 (2 seconds)\r
@@ -87,29 +89,53 @@ struct fat_longfilename_s {
        Uint16  name3[2];       //!< Last 2 characters of name\r
 } __attribute__((packed));\r
 \r
-#define ATTR_READONLY  0x01\r
-#define ATTR_HIDDEN            0x02\r
-#define ATTR_SYSTEM            0x04\r
-#define ATTR_VOLUMEID  0x08\r
-#define ATTR_DIRECTORY 0x10\r
+/**\r
+ * \name File Attributes\r
+ * \brief Flag values for ::fat_filetable_s.attrib\r
+ * \{\r
+ */\r
+#define ATTR_READONLY  0x01    //!< Read-only file\r
+#define ATTR_HIDDEN            0x02    //!< Hidden File\r
+#define ATTR_SYSTEM            0x04    //!< System File\r
+#define ATTR_VOLUMEID  0x08    //!< Volume ID (Deprecated)\r
+#define ATTR_DIRECTORY 0x10    //!< Directory\r
+/**\r
+ * \brief File needs archiving\r
+ * \note User set flag, no significance to the FS driver\r
+ */\r
 #define ATTR_ARCHIVE   0x20\r
+/**\r
+ * \brief Meta Attribute \r
+ * \r
+ * If ::fat_filetable_s.attrib equals ATTR_LFN the file is a LFN entry\r
+ */\r
 #define        ATTR_LFN                (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUMEID)\r
+/**\r
+ * \}\r
+ */\r
 \r
 /**\r
- \enum eFatType\r
- \brief Internal Ids for FAT types\r
-*/\r
-enum eFatType {\r
-//     FAT_NULL,       //!< NULL Entry\r
+ * \brief Internal IDs for FAT types\r
+ */\r
+enum eFatType\r
+{\r
        FAT12,  //!< FAT12 Volume\r
        FAT16,  //!< FAT16 Volume\r
        FAT32,  //!< FAT32 Volume\r
-//     FAT_LAST        //!< LAST Entry. Unused\r
 };\r
 \r
-#define        EOC_FAT12       0x0FFF\r
-#define        EOC_FAT16       0xFFFF\r
-#define        EOC_FAT32       0x0FFFFFF\r
+/**\r
+ * \name End of Cluster marks\r
+ * \brief FAT values that indicate the end of a cluster chain in\r
+ *        different versions.\r
+ * \{\r
+ */\r
+#define        EOC_FAT12       0x0FFF  //!< FAT-12 Mark\r
+#define        EOC_FAT16       0xFFFF  //!< FAT-16 Mark\r
+#define        EOC_FAT32       0x0FFFFFF       //!< FAT-32 Mark\r
+/**\r
+ * \}\r
+ */\r
 \r
 typedef struct fat_bootsect_s fat_bootsect;\r
 typedef struct fat_filetable_s fat_filetable;\r
@@ -117,10 +143,11 @@ typedef struct fat_longfilename_s fat_longfilename;
 \r
 // === Memory Structures ===\r
 /**\r
- \struct drv_fat_volinfo_s\r
- \brief Representation of a volume in memory\r
-*/\r
-struct drv_fat_volinfo_s {\r
+ * \struct drv_fat_volinfo_s\r
+ * \brief Representation of a volume in memory\r
+ */\r
+struct drv_fat_volinfo_s\r
+{\r
         int    fileHandle;     //!< File Handle\r
         int    type;   //!< FAT Type. See eFatType\r
        char    name[12];       //!< Volume Name (With NULL Terminator)\r
@@ -136,3 +163,5 @@ struct drv_fat_volinfo_s {
 };\r
 \r
 typedef struct drv_fat_volinfo_s tFAT_VolInfo;\r
+\r
+#endif\r
index 69a6623..090d024 100644 (file)
@@ -11,7 +11,7 @@ extern int    giVFS_MountFileID;
 extern char    *gsVFS_MountFile;
 
 // === PROTOTYPES ===
- int   VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *ArgString);
+ int   VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options);
 void   VFS_UpdateMountFile();
 
 // === GLOBALS ===
@@ -21,13 +21,16 @@ tVFS_Mount  *gVFS_RootMount = NULL;
 
 // === CODE ===
 /**
- * \fn int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
  * \brief Mount a device
  * \param Device       Device string to mount
  * \param MountPoint   Destination for the mount
  * \param Filesystem   Filesystem to use for the mount
  * \param Options              Options to be passed to the filesystem
  * \return -1 on Invalid FS, -2 on No Mem, 0 on success
+ * 
+ * Mounts the filesystem on \a Device at \a MountPoint using the driver
+ * \a Filesystem. The options in the string \a Options is passed to the
+ * driver's mount.
  */
 int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
 {
@@ -101,8 +104,9 @@ int VFS_Mount(char *Device, char *MountPoint, char *Filesystem, char *Options)
 }
 
 /**
- * \fn void VFS_UpdateMountFile()
  * \brief Updates the mount file buffer
+ * 
+ * Updates the ProcFS mounts file buffer to match the current mounts list.
  */
 void VFS_UpdateMountFile()
 {
index 135c9c8..fef9065 100644 (file)
@@ -48,8 +48,9 @@ Uint32        gaTCP_PortBitmap[0x800];
 
 // === CODE ===
 /**
- * \fn void TCP_Initialise()
  * \brief Initialise the TCP Layer
+ * 
+ * Registers the client and server files and the GetPacket callback
  */
 void TCP_Initialise()
 {
@@ -60,6 +61,7 @@ void TCP_Initialise()
 
 /**
  * \brief Open a connection to another host using TCP
+ * \param Conn Connection structure
  */
 void TCP_StartConnection(tTCPConnection *Conn)
 {
@@ -74,7 +76,7 @@ void TCP_StartConnection(tTCPConnection *Conn)
        hdr.WindowSize = 0;     // TODO
        hdr.Checksum = 0;       // TODO
        hdr.UrgentPointer = 0;
-       // SEND PACKET
+       
        TCP_SendPacket( Conn, sizeof(tTCPHeader), &hdr );
        return ;
 }
@@ -83,7 +85,7 @@ void TCP_StartConnection(tTCPConnection *Conn)
  * \brief Sends a packet from the specified connection, calculating the checksums
  * \param Conn Connection
  * \param Length       Length of data
- * \param Data Packet data
+ * \param Data Packet data (cast as a TCP Header)
  */
 void TCP_SendPacket( tTCPConnection *Conn, size_t Length, tTCPHeader *Data )
 {
@@ -107,8 +109,11 @@ void TCP_SendPacket( tTCPConnection *Conn, size_t Length, tTCPHeader *Data )
 }
 
 /**
- * \fn void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer)
  * \brief Handles a packet from the IP Layer
+ * \param Interface    Interface the packet arrived from
+ * \param Address      Pointer to the addres structure
+ * \param Length       Size of packet in bytes
+ * \param Buffer       Packet data
  */
 void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer)
 {
@@ -204,7 +209,6 @@ void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffe
                        }
                        
                        conn->NextSequenceRcv = ntohl( hdr->SequenceNumber ) + 1;
-                       // + (Length-(hdr->DataOffset>>4)*4);
                        conn->NextSequenceSend = rand();
                        
                        // Create node
@@ -271,6 +275,9 @@ void TCP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffe
 
 /**
  * \brief Handles a packet sent to a specific connection
+ * \param Connection   TCP Connection pointer
+ * \param Header       TCP Packet pointer
+ * \param Length       Length of the packet
  */
 void TCP_INT_HandleConnectionPacket(tTCPConnection *Connection, tTCPHeader *Header, int Length)
 {      
@@ -350,6 +357,8 @@ void TCP_INT_HandleConnectionPacket(tTCPConnection *Connection, tTCPHeader *Head
 
 /**
  * \brief Appends a packet to the recieved list
+ * \param Connection   Connection structure
+ * \param Pkt  Packet structure on heap
  */
 void TCP_INT_AppendRecieved(tTCPConnection *Connection, tTCPStoredPacket *Pkt)
 {
@@ -369,6 +378,11 @@ void TCP_INT_AppendRecieved(tTCPConnection *Connection, tTCPStoredPacket *Pkt)
 
 /**
  * \brief Updates the connections recieved list from the future list
+ * \param Connection   Connection structure
+ * 
+ * Updates the recieved packets list with packets from the future (out 
+ * of order) packets list that are now able to be added in direct
+ * sequence.
  */
 void TCP_INT_UpdateRecievedFromFuture(tTCPConnection *Connection)
 {

UCC git Repository :: git.ucc.asn.au