⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bss.c

📁 ertfs文件系统里面既有完整ucos程序
💻 C
字号:
/*
 * BSS Data declarations 
 */


#include "pcdisk.h"

BOOLEAN resource_initialized;

/* BSS area used by the File System */
#define GLOBAL_INSTANCE

void bssdummy(void) {}


FINODE KS_FAR *inoroot;          /* Begining of inode pool */
DDRIVE  KS_FAR *mem_drives_structures;
BLKBUFF KS_FAR *mem_block_pool;
PC_FILE KS_FAR *mem_file_pool;
DROBJ   KS_FAR *mem_drobj_pool;
FINODE  KS_FAR *mem_finode_pool;
FINODE  KS_FAR *mem_finode_freelist;
DROBJ   KS_FAR *mem_drobj_freelist;
DDRIVE  KS_FAR *drno_to_dr_map[NDRIVES];

/* If it is cleaner to claim rtfs global data from the BSS instead of using 
    malloc we declare place holders in the BSS for the various sections. 
*/
DDRIVE  KS_FAR _mem_drives_structures[NDRIVES];
BLKBUFF  KS_FAR _mem_block_pool[NBLKBUFFS];
PC_FILE KS_FAR _mem_file_pool[NUSERFILES];
DROBJ   KS_FAR _mem_drobj_pool[NDROBJS];
FINODE  KS_FAR _mem_finode_pool[NFINODES];

/* Each mounted drive needs core to store either the whole FAT in core
    or to stor portions of it in core with swapping to disk. 
    These declarations preallocate buffers in the BSS for this purpose.
    see the routiune pc_memory_fat_blocks_alloc() in this file for 
    how these blocks are used.
*/

// Try to allign the buffers on dword boundaries for DMA operations
dword KS_FAR  ensure_fat_drives_dword_aligned;  // (word-align probably
                                                 //  sufficient)
BLOCK_ALLOC KS_FAR fat_drive_0[FAT_BUFFER_SIZE];         
#if (NDRIVES>1)
BLOCK_ALLOC KS_FAR fat_drive_1[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>2)
BLOCK_ALLOC KS_FAR fat_drive_2[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>3)
BLOCK_ALLOC KS_FAR fat_drive_3[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>4)
BLOCK_ALLOC KS_FAR fat_drive_4[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>5)
BLOCK_ALLOC KS_FAR fat_drive_5[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>6)
BLOCK_ALLOC KS_FAR fat_drive_6[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>7)
BLOCK_ALLOC KS_FAR fat_drive_7[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>8)
BLOCK_ALLOC KS_FAR fat_drive_8[FAT_BUFFER_SIZE];
#endif
#if (NDRIVES>9)
#error BLOCK_ALLOC KS_FAR fat_drive_9[FAT_BUFFER_SIZE];
#endif

/* BSS area used by the IDE driver */
/* The control structure - without too much difficulty we could go to
    multiple controllers */
#if (USE_ATA)
IDE_CONTROLLER controller_s[N_ATA_CONTROLLERS];
#endif

/* BSS area used by the block buffer pool system */
dword  useindex;
DDRIVE *scratch_pdrive;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -