file_system.c

来自「虚地址空间基于文件OS内核源代码和文件」· C语言 代码 · 共 46 行

C
46
字号
#include"../include/os.h"

extern void enter_file_system(void );
extern int idle_device(struct file_system_call_parameter *par);

static void init_file_system_routine(int file_system_id)
{
	REG r;
	union system_call_parameter *par;

	print("\n                ",file_system_id);

	par=get_kernel_parameter();


	RESET_CAPABILITY(par->process_attribute.capability);
	RESET_CAPABILITY(par->process_attribute.process.capability);
	r.ax=11;r.bx=file_system_id;
	call_kernel(&r);
	print("query file system processor resource,result is ",r.ax);

	par->process_attribute.process.max_thread_number=THREAD_NUMBER;
	par->process_attribute.process.max_semaphore_number=SEMAPHORE_NUMBER;
	RESET_CAPABILITY(par->process_attribute.capability);
	RESET_CAPABILITY(par->process_attribute.process.capability);
	par->process_attribute.process.driver=idle_device;
	par->process_attribute.process.semaphore=-1;
	par->process_attribute.process.start_point.ip=enter_file_system;
	par->process_attribute.process.start_point.cs=0x23;
	par->process_attribute.process.start_point.ds=0x2b;
	par->process_attribute.process.start_point.ss=0x2b;

	r.ax=10;r.bx=file_system_id;
	call_kernel(&r);
	print("\n                ",file_system_id);
	print("allocate processor resource for file system,result is ",r.ax);
	print_string("\n\n");

	return ;
}
void init_file_system(void)
{
	init_file_system_routine(1);
	init_file_system_routine(2);
}

⌨️ 快捷键说明

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