system.h

来自「别人的根据linux0.11改的一个小的操作系统」· C头文件 代码 · 共 33 行

H
33
字号
/*
 * system.h
 * 
 */
#ifndef	_SYSTEM_H
#define	_SYSTEM_H

/* move into user mode. */
#define move_to_user_mode()\
	asm(\
		"movl	%%esp,%%eax;"\
		"pushl	$0x17;"\
		"pushl	%%eax;"\
		"pushfl;"\
		"pushl	$0x0f;"\
		"pushl	$L;"\
		"iret;"\
		"L:;"\
		"movl	$0x17,%%eax;"\
		"movw	%%ax,%%ds;"\
		"movw	%%ax,%%es;"\
		"movw	%%ax,%%fs;"\
		"movw	%%ax,%%gs;"\
		::)

void set_tss_desc(int, char *);         /* Set tss descriptor. */
void set_ldt_desc(int, char *);         /* Set ldt descriptor. */
void set_ldt(char *_ldt, unsigned long limit, char *addr);
                                        /* Set ldt. */
void memcopy(char *, char *, long);     /* copy memory from source to destination. */

#endif

⌨️ 快捷键说明

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