📄 common_var.c
字号:
#include "general.h"
#include "fat_cache.h"
#include "msdos_dir_entry.h"
#include "hd_info_struct.h"
#include "buffer_head.h"
#include "hd_request_struct.h"
#include "m_inode.h"
#include "file.h"
#include "super_block.h"
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
unsigned char root_path_table[NR_SUPER][256] = { "A:", "B:",
"C:", "D:", "E:", "F:", "G:", "H:",
"I:", "J:", "K:", "L:", "M:", "N:",
"O:", "P:", "Q:", "R:", "S:", "T:",
"U:", "V:", "W:", "X:", "Y:", "Z:"
};
unsigned char root_pathlength_table[NR_SUPER] = { 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2
};
unsigned char pwd_path_table[NR_SUPER][256] = { "A:", "B:",
"C:", "D:", "E:", "F:", "G:", "H:",
"I:", "J:", "K:", "L:", "M:", "N:",
"O:", "P:", "Q:", "R:", "S:", "T:",
"U:", "V:", "W:", "X:", "Y:", "Z:"
};
unsigned char pwd_pathlength_table[NR_SUPER] = { 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2
};
unsigned char current_root_path[256] = "C:";
unsigned char current_root_pathlength = 2;
unsigned char current_pwd_path[256] = "C:";
unsigned char current_pwd_pathlength = 2;
unsigned char current_path[256];
unsigned char current_pathlength;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
int month_days[12] = { 31, 28, 31, 30,
31, 30, 31, 31,
30, 31, 30, 31 };
unsigned long current_datetime_sec;
unsigned long current_datetime_min;
unsigned long current_datetime_hour;
unsigned long current_datetime_mday;
unsigned long current_datetime_mon;
unsigned long current_datetime_year;
unsigned long current_datetime_100Y;
int leapyear_flag;
int current_monthdays;
unsigned long sys_datetime, sys_datetime_s, sys_datetime_ms;
unsigned long file_datetime;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
int nr_buffers;
struct buffer_head * volatile start_buffer;
struct buffer_head * volatile end_buffer;
struct buffer_head * volatile sys_buffer;
struct buffer_head * volatile current_buffer;
struct buffer_head * hash_table[NR_HASH];
struct buffer_head * volatile free_list;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
struct hd_info_struct hd_info[] = {HD_TYPE};
struct hd_request_struct hd_request[NR_REQUEST];
struct hd_request_struct * volatile current_req = hd_request;
struct hd_request_struct * volatile start_request_h = NULL , * volatile end_request_h = NULL;
struct hd_request_struct * volatile start_request_h0 = NULL , * volatile end_request_h0 = NULL;
struct hd_request_struct * volatile start_request_f = NULL , * volatile end_request_f = NULL;
struct hd_request_struct * volatile start_request_f0 = NULL , * volatile end_request_f0 = NULL;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
int volatile data_index = 0;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
unsigned char reply_buffer[8];
int reply_length;
unsigned char volatile floppy_temp_track;
unsigned char volatile floppy_temp_head;
unsigned char volatile floppy_temp_sector;
int volatile floppy_temp_rwflag;
unsigned char volatile floppy_current_track;
unsigned char volatile floppy_current_head;
unsigned char volatile floppy_current_sector;
int volatile floppy_state = 0;
int volatile floppy_errors = 0;
int volatile floppy_rwerrors = 0;
int volatile floppy_timerval = 0;
int volatile floppy_finishedflag = 0;
int volatile floppy_workstate = 0;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
int current_fatno = 2;
struct fat_cache * fat_cache, cache[FAT_CACHE];
struct msdos_dir_entry current_dir_entry;
unsigned char current_name[MSDOS_NAME_LEN + 1];
int current_namelen;
int current_dir_type;
int root_dir_flag;
int current_sector,current_sector0;
unsigned char sys_dir_name0[MSDOS_NAME_LEN + 1] = ". ";
unsigned char sys_dir_name1[MSDOS_NAME_LEN + 1] = ".. ";
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
long partition_sector;
struct super_block the_super_block[NR_SUPER];
long nr_super_blocks;
long sys_blocksize;
struct m_inode * current_root;
struct m_inode * current_pwd;
long current_driver;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
struct file dir_file;
struct file file_table[NR_FILE];
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
struct m_inode inode_table[NR_INODE];
int last_allocated_inode = 0;
/////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////!!!!!
unsigned long * exec_stackptr;
unsigned char * exec_argptr;
///////////////////////////////////////////////////////////////////////////////!!!!!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -