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

📄 system_call.c

📁 别人的根据linux0.11改的一个小的操作系统
💻 C
字号:
/*
 * system_call.c
 *
 * There have some routines that is used for system call.
 */
#include <def.h>
#include <sched.h>

/********************************************
 *those routines be used for system call
 *they are not visible to user
 ********************************************/

void _clrscr();				/*clear screen*/
void _scr_up();				/*make the screen scroll up 1 row*/

void _clrscr()
{
	asm(
		"pushw	%%es;"
		"movw	$0x18,%%ax;"
		"movw	%%ax,%%es;"
		"movl	$1000,%%ecx;"
		"xorl	%%eax,%%eax;"
		"xorl	%%edi,%%edi;"
		"cld;"
		"rep	stosl;"
		"popw	%%es;"
		::
		:"%eax","%ecx","%edi");
	setCursor(0,0);
}

void _scr_up()
{
	asm(
		"pushw	%%ds;"
		"pushw	%%es;"
		"movw	$0x18,%%ax;"
		"movw	%%ax,%%ds;"
		"movw	%%ax,%%es;"
		"movl	$160,%%esi;"
		"xorl	%%edi,%%edi;"
		"movl	$960,%%ecx;"
		"cld;"
		"rep	movsl;"
		"movl	$40,%%ecx;"
		"xorl	%%eax,%%eax;"
		"rep	stosl;"
		"popw	%%es;"
		"popw	%%ds;"
		::
		:"%eax","%ecx","%esi","%edi");
	setCursor(0,24);
}

⌨️ 快捷键说明

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