From bf7d1cd5635d41bd7c58bf99c61cdc670291c543 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 5 Mar 2010 22:56:41 +0800 Subject: [PATCH] doxygen fixes --- Kernel/Doxyfile | 2 +- Kernel/Makefile.BuildNum | 2 +- Kernel/arch/x86/include/mm_phys.h | 4 +- Kernel/arch/x86/mm_phys.c | 46 ++++++++++--------- Kernel/bin/elf.h | 38 ++++++++-------- Kernel/binary.c | 46 +++++++++---------- Kernel/drv/fifo.c | 3 +- Kernel/drv/vterm.c | 9 +++- Kernel/include/acess.h | 8 ++-- Kernel/include/apidoc_mainpage.h | 4 +- Kernel/include/binary.h | 18 ++++++++ Kernel/include/binary_ext.h | 2 +- Kernel/include/tpl_drv_common.h | 25 ++++++++++- Kernel/include/tpl_drv_terminal.h | 17 ++++++- Kernel/include/vfs_ext.h | 4 +- Kernel/lib.c | 6 +-- Kernel/vfs/fs/fs_fat.h | 75 +++++++++++++++++++++---------- Kernel/vfs/mount.c | 10 +++-- Modules/IPStack/tcp.c | 24 +++++++--- 19 files changed, 225 insertions(+), 118 deletions(-) diff --git a/Kernel/Doxyfile b/Kernel/Doxyfile index acc5ed87..a474dd56 100644 --- a/Kernel/Doxyfile +++ b/Kernel/Doxyfile @@ -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 diff --git a/Kernel/Makefile.BuildNum b/Kernel/Makefile.BuildNum index 96320a61..e07c2ce6 100644 --- a/Kernel/Makefile.BuildNum +++ b/Kernel/Makefile.BuildNum @@ -1 +1 @@ -BUILD_NUM = 1508 +BUILD_NUM = 1510 diff --git a/Kernel/arch/x86/include/mm_phys.h b/Kernel/arch/x86/include/mm_phys.h index 51a9cd30..f72ebf6a 100644 --- a/Kernel/arch/x86/include/mm_phys.h +++ b/Kernel/arch/x86/include/mm_phys.h @@ -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 diff --git a/Kernel/arch/x86/mm_phys.c b/Kernel/arch/x86/mm_phys.c index 595a5e97..e4199e31 100644 --- a/Kernel/arch/x86/mm_phys.c +++ b/Kernel/arch/x86/mm_phys.c @@ -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 diff --git a/Kernel/bin/elf.h b/Kernel/bin/elf.h index 07f5ec19..1ff21281 100644 --- a/Kernel/bin/elf.h +++ b/Kernel/bin/elf.h @@ -1,16 +1,15 @@ /** - Acess v1 - \file bin_elf.h - \brief ELF Exeutable Loader -*/ + * \file elf.h + * \brief ELF Exeutable Loader + */ #ifndef _BIN_ELF_H #define _BIN_ELF_H /** - \struct elf_header_s - \brief ELF File Header -*/ -struct sElf32_Ehdr { + * \brief ELF File Header + */ +struct sElf32_Ehdr +{ union { char ident[16]; //!< Identifier Bytes struct { @@ -36,17 +35,18 @@ struct sElf32_Ehdr { } __attribute__ ((packed)); /** - \name Executable Types - \{ -*/ -#define ET_NONE 0 //!< NULL Type -#define ET_REL 1 //!< Relocatable (Object) -#define ET_EXEC 2 //!< Executable -#define ET_DYN 3 //!< Dynamic Library -#define ET_CORE 4 //!< Core? -#define ET_LOPROC 0xFF00 //!< Low Impl Defined -#define ET_HIPROC 0xFFFF //!< High Impl Defined -//! \} + * \brief Executable Types + */ +enum eElf32_ExecTypes +{ + ET_NONE = 0, //!< NULL Type + ET_REL = 1, //!< Relocatable (Object) + ET_EXEC = 2, //!< Executable + ET_DYN = 3, //!< Dynamic Library + ET_CORE = 4, //!< Core? + ET_LOPROC = 0xFF00, //!< Low Impl Defined + ET_HIPROC = 0xFFFF //!< High Impl Defined +}; /** \name Section IDs diff --git a/Kernel/binary.c b/Kernel/binary.c index a98e1924..229031f7 100644 --- a/Kernel/binary.c +++ b/Kernel/binary.c @@ -43,7 +43,7 @@ tBinary *Binary_DoLoad(char *truePath); void Binary_Dereference(tBinary *Info); Uint Binary_Relocate(void *Base); Uint Binary_GetSymbolEx(char *Name, Uint *Value); -Uint Binary_FindSymbol(void *Base, char *Name, Uint *val); +Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val); // === GLOBALS === int glBinListLock = 0; @@ -245,17 +245,16 @@ Uint Binary_Load(char *file, Uint *entryPoint) } /** - \fn tBinary *Binary_GetInfo(char *truePath) - \brief Finds a matching binary entry - \param truePath File Identifier (True path name) -*/ -tBinary *Binary_GetInfo(char *truePath) + * \brief Finds a matching binary entry + * \param TruePath File Identifier (True path name) + */ +tBinary *Binary_GetInfo(char *TruePath) { tBinary *pBinary; pBinary = glLoadedBinaries; while(pBinary) { - if(strcmp(pBinary->TruePath, truePath) == 0) + if(strcmp(pBinary->TruePath, TruePath) == 0) return pBinary; pBinary = pBinary->Next; } @@ -548,22 +547,22 @@ void Binary_Dereference(tBinary *Info) } /** - \fn char *Binary_RegInterp(char *path) - \brief Registers an Interpreter - \param path Path to interpreter provided by executable -*/ -char *Binary_RegInterp(char *path) + * \fn char *Binary_RegInterp(char *Path) + * \brief Registers an Interpreter + * \param Path Path to interpreter provided by executable + */ +char *Binary_RegInterp(char *Path) { int i; // NULL Check Argument - if(path == NULL) return NULL; + if(Path == NULL) return NULL; // NULL Check the array if(gsaRegInterps == NULL) { giRegInterps = 1; gsaRegInterps = malloc( sizeof(char*) ); - gsaRegInterps[0] = malloc( strlen(path) ); - strcpy(gsaRegInterps[0], path); + gsaRegInterps[0] = malloc( strlen(Path) ); + strcpy(gsaRegInterps[0], Path); return gsaRegInterps[0]; } @@ -577,8 +576,8 @@ char *Binary_RegInterp(char *path) // Interpreter is not in list giRegInterps ++; gsaRegInterps = malloc( sizeof(char*)*giRegInterps ); - gsaRegInterps[i] = malloc( strlen(path) ); - strcpy(gsaRegInterps[i], path); + gsaRegInterps[i] = malloc( strlen(Path) ); + strcpy(gsaRegInterps[i], Path); return gsaRegInterps[i]; } @@ -586,11 +585,12 @@ char *Binary_RegInterp(char *path) // Kernel Binary Handling // ============ /** - * \fn void *Binary_LoadKernel(char *path) + * \fn void *Binary_LoadKernel(char *File) * \brief Load a binary into kernel space * \note This function shares much with #Binary_Load, but does it's own mapping + * \param File File to load into the kernel */ -void *Binary_LoadKernel(char *file) +void *Binary_LoadKernel(char *File) { char *sTruePath; tBinary *pBinary; @@ -805,13 +805,13 @@ Uint Binary_GetSymbolEx(char *Name, Uint *Value) } /** - * \fn Uint Binary_GetSymbolBin(void *Base, char *Name, Uint *val) + * \fn Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val) * \brief Get a symbol from the specified library * \param Base Base address * \param Name Name of symbol to find - * \param val Pointer to place final value + * \param Val Pointer to place final value */ -Uint Binary_FindSymbol(void *Base, char *Name, Uint *val) +Uint Binary_FindSymbol(void *Base, char *Name, Uint *Val) { Uint32 ident = *(Uint32*) Base; tBinaryType *bt = gRegBinTypes; @@ -819,7 +819,7 @@ Uint Binary_FindSymbol(void *Base, char *Name, Uint *val) for(; bt; bt = bt->Next) { if( (ident & bt->Mask) == (Uint)bt->Ident ) - return bt->GetSymbol(Base, Name, val); + return bt->GetSymbol(Base, Name, Val); } Warning("[BIN ] 0x%x is an unknown file type. (0x%x 0x%x 0x%x 0x%x)", diff --git a/Kernel/drv/fifo.c b/Kernel/drv/fifo.c index b028fcb4..7bb4ca37 100644 --- a/Kernel/drv/fifo.c +++ b/Kernel/drv/fifo.c @@ -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) { diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index 716a5531..7aebd28e 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -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) { diff --git a/Kernel/include/acess.h b/Kernel/include/acess.h index 65a4b6e0..2cd927b7 100644 --- a/Kernel/include/acess.h +++ b/Kernel/include/acess.h @@ -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 diff --git a/Kernel/include/apidoc_mainpage.h b/Kernel/include/apidoc_mainpage.h index f2da43a4..98a5e40a 100644 --- a/Kernel/include/apidoc_mainpage.h +++ b/Kernel/include/apidoc_mainpage.h @@ -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 diff --git a/Kernel/include/binary.h b/Kernel/include/binary.h index fe80f5b0..77ccdd74 100644 --- a/Kernel/include/binary.h +++ b/Kernel/include/binary.h @@ -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 diff --git a/Kernel/include/binary_ext.h b/Kernel/include/binary_ext.h index 8b8a6df2..67c6073d 100644 --- a/Kernel/include/binary_ext.h +++ b/Kernel/include/binary_ext.h @@ -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 diff --git a/Kernel/include/tpl_drv_common.h b/Kernel/include/tpl_drv_common.h index f281c0ee..632f3dcb 100644 --- a/Kernel/include/tpl_drv_common.h +++ b/Kernel/include/tpl_drv_common.h @@ -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: {\ diff --git a/Kernel/include/tpl_drv_terminal.h b/Kernel/include/tpl_drv_terminal.h index 21ba2909..ee50392b 100644 --- a/Kernel/include/tpl_drv_terminal.h +++ b/Kernel/include/tpl_drv_terminal.h @@ -103,6 +103,11 @@ enum eTplTerminal_Modes { */ TERM_MODE_FB, + /** + * \brief 32bpp 2D Accellerated mode + * Writes to the terminal file will be read as a command stream + * defined in ::eTplTerminal_2D_Commands + */ TERM_MODE_2DACCEL, /** @@ -119,17 +124,27 @@ enum eTplTerminal_Modes { NUM_TERM_MODES }; +/** + * \brief 2D Command IDs + * \todo Complete this structure + * + * Command IDs for when the terminal type is eTplTerminal_Modes.TERM_MODE_2DACCEL + */ enum eTplTerminal_2D_Commands { + /** + * \brief No Operation - Used for padding + */ TERM_2DCMD_NOP, /** * (Uint16 X, Y, W, H, Uint32 Data[]) + * \brief Blits a bitmap to the display * \param X,Y Coordinates of Top-Left corner * \param W,H Dimensions * \param Data 32-bpp pixel data */ - TERM_2DCMD_PUSH, + TERM_2DCMD_PUSH }; #endif diff --git a/Kernel/include/vfs_ext.h b/Kernel/include/vfs_ext.h index 816c4a04..2fd7fd37 100644 --- a/Kernel/include/vfs_ext.h +++ b/Kernel/include/vfs_ext.h @@ -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); diff --git a/Kernel/lib.c b/Kernel/lib.c index 967c03ac..bfae2a41 100644 --- a/Kernel/lib.c +++ b/Kernel/lib.c @@ -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) diff --git a/Kernel/vfs/fs/fs_fat.h b/Kernel/vfs/fs/fs_fat.h index 6b7dfe76..a4f7f7b7 100644 --- a/Kernel/vfs/fs/fs_fat.h +++ b/Kernel/vfs/fs/fs_fat.h @@ -3,13 +3,16 @@ * FAT12/16/32 Driver * vfs/fs/fs_fat.h */ +#ifndef _FS_FAT_H_ +#define _FS_FAT_H_ // === On Disk Structures === /** - \struct fat_bootsect_s - \brief Bootsector format -*/ -struct fat_bootsect_s { + * \struct fat_bootsect_s + * \brief Bootsector format + */ +struct fat_bootsect_s +{ Uint8 jmp[3]; //!< Jump Instruction char oemname[8]; //!< OEM Name. Typically MSDOS1.1 Uint16 bps; //!< Bytes per Sector. Assumed to be 512 @@ -58,7 +61,6 @@ struct fat_bootsect_s { */ struct fat_filetable_s { char name[11]; //!< 8.3 Name - //char ext[3]; //!< Extention Uint8 attrib; //!< File Attributes. Uint8 ntres; //!< Reserved for NT - Set to 0 Uint8 ctimems; //!< 10ths of a second ranging from 0-199 (2 seconds) @@ -87,29 +89,53 @@ struct fat_longfilename_s { Uint16 name3[2]; //!< Last 2 characters of name } __attribute__((packed)); -#define ATTR_READONLY 0x01 -#define ATTR_HIDDEN 0x02 -#define ATTR_SYSTEM 0x04 -#define ATTR_VOLUMEID 0x08 -#define ATTR_DIRECTORY 0x10 +/** + * \name File Attributes + * \brief Flag values for ::fat_filetable_s.attrib + * \{ + */ +#define ATTR_READONLY 0x01 //!< Read-only file +#define ATTR_HIDDEN 0x02 //!< Hidden File +#define ATTR_SYSTEM 0x04 //!< System File +#define ATTR_VOLUMEID 0x08 //!< Volume ID (Deprecated) +#define ATTR_DIRECTORY 0x10 //!< Directory +/** + * \brief File needs archiving + * \note User set flag, no significance to the FS driver + */ #define ATTR_ARCHIVE 0x20 +/** + * \brief Meta Attribute + * + * If ::fat_filetable_s.attrib equals ATTR_LFN the file is a LFN entry + */ #define ATTR_LFN (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUMEID) +/** + * \} + */ /** - \enum eFatType - \brief Internal Ids for FAT types -*/ -enum eFatType { -// FAT_NULL, //!< NULL Entry + * \brief Internal IDs for FAT types + */ +enum eFatType +{ FAT12, //!< FAT12 Volume FAT16, //!< FAT16 Volume FAT32, //!< FAT32 Volume -// FAT_LAST //!< LAST Entry. Unused }; -#define EOC_FAT12 0x0FFF -#define EOC_FAT16 0xFFFF -#define EOC_FAT32 0x0FFFFFF +/** + * \name End of Cluster marks + * \brief FAT values that indicate the end of a cluster chain in + * different versions. + * \{ + */ +#define EOC_FAT12 0x0FFF //!< FAT-12 Mark +#define EOC_FAT16 0xFFFF //!< FAT-16 Mark +#define EOC_FAT32 0x0FFFFFF //!< FAT-32 Mark +/** + * \} + */ typedef struct fat_bootsect_s fat_bootsect; typedef struct fat_filetable_s fat_filetable; @@ -117,10 +143,11 @@ typedef struct fat_longfilename_s fat_longfilename; // === Memory Structures === /** - \struct drv_fat_volinfo_s - \brief Representation of a volume in memory -*/ -struct drv_fat_volinfo_s { + * \struct drv_fat_volinfo_s + * \brief Representation of a volume in memory + */ +struct drv_fat_volinfo_s +{ int fileHandle; //!< File Handle int type; //!< FAT Type. See eFatType char name[12]; //!< Volume Name (With NULL Terminator) @@ -136,3 +163,5 @@ struct drv_fat_volinfo_s { }; typedef struct drv_fat_volinfo_s tFAT_VolInfo; + +#endif diff --git a/Kernel/vfs/mount.c b/Kernel/vfs/mount.c index 69a66238..090d0242 100644 --- a/Kernel/vfs/mount.c +++ b/Kernel/vfs/mount.c @@ -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() { diff --git a/Modules/IPStack/tcp.c b/Modules/IPStack/tcp.c index 135c9c80..fef9065b 100644 --- a/Modules/IPStack/tcp.c +++ b/Modules/IPStack/tcp.c @@ -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) { -- 2.20.1