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

📄 system_call0.c

📁 阿基米德操作系统的源代码
💻 C
字号:

////////////////////////////////////////////////long the_screen_call00(long num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x00),"b" (num)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call01(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x01)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call02(unsigned char num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02),"b" (num)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call03(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x03)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call04(unsigned char num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x04),"b" (num)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call05(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x05)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call06(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x06)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call07(short num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x07),"b" (num)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call08(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x08)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call09(short num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x09),"b" (num)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_screen_call10(unsigned char num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0a),"b" (num)
					 ); 
	return __res;
}
//////////////////////////////////////////////////////////
long the_screen_call11(unsigned char num)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0b),"b" (num)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call12(unsigned char num , long addr)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0c),"b" (num),"c" (addr)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call13(short num , long addr)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0d),"b" (num),"c" (addr)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call14(long num , long addr , long count)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0e),"b" (num),"c" (addr), "d" (count)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call15(long num , long addr , long count)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x0f),"b" (num),"c" (addr), "d" (count)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call16(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x10)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call17(short rowcol_val)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x11),"b" (rowcol_val)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////
long the_screen_call18(const char * the_string)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x12),"b" (the_string)
					 ); 
	return __res;
}
/////////////////////////////////////////////////////////////////////////

long the_keybd_call00(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x010000)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_keybd_call01(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x010001)
					 ); 
	return __res;
}
////////////////////////////////////////////////
long the_keybd_call02(char * buf,unsigned char length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x010002), "b" (buf), "c" (length)
					 ); 
	return __res;
}

///////////////////////////////////////////////////////////////////////////////

long the_file_sync(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020000)
					 ); 
	return __res;
}

long the_file_reload(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020001)
					 ); 
	return __res;
}

long the_file_chdriver(long new_driver, unsigned char * buf, unsigned long length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020002),"b" (new_driver),"c" (buf),"d" (length)
					 ); 
	return __res;
}

long the_file_mkdir(const char * pathname)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020003),"b" (pathname)
					 ); 
	return __res;

}

long the_file_rmdir(const char * name)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020004),"b" (name)
					 ); 
	return __res;
}

long the_file_chdir(const char * filename, unsigned char * buf, unsigned long length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020005),"b" (filename),"c" (buf),"d" (length)
					 ); 
	return __res;
}

long the_file_dirstart(const char * pathname, const char * basename, unsigned char * buf, unsigned long length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020006),"b" (pathname),"c" (basename),"d" (buf),"S" (length)
					 ); 
	return __res;
}

long the_file_dirend(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020007)
					 ); 
	return __res;
}

long the_file_rddir(char * buf,int length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020008), "b" (buf), "c" (length)
					 ); 
	return __res;
}

long the_file_create(const char * pathname, unsigned char mode)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020009),"b" (pathname),"c" (mode)
					 ); 
	return __res;
}

long the_file_delete(const char * name)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000a),"b" (name)
					 ); 
	return __res;
}

long the_file_open(const char * filename,unsigned char flag,unsigned char mode)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000b),"b" (filename),"c" (flag), "d" (mode)
					 ); 
	return __res;
}

long the_file_close(int fd)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000c),"b" (fd)
					 ); 
	return __res;
}

long the_file_lseek(unsigned int fd, int offset, int origin)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000d),"b" (fd),"c" (offset), "d" (origin)
					 ); 
	return __res;
}

long the_file_read(unsigned int fd,char * buf,int count)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000e),"b" (fd),"c" (buf), "d" (count)
					 ); 
	return __res;
}

long the_file_write(unsigned int fd,char * buf,int count)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x02000f),"b" (fd),"c" (buf), "d" (count)
					 ); 
	return __res;
}

long the_file_openEX(const char * filename,unsigned char flag,unsigned char mode,unsigned char * buf,unsigned long length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020010),"b" (filename),"c" (flag), "d" (mode), "S" (buf), "D" (length)
					 ); 
	return __res;
}

long the_file_getpath(unsigned char * buf, unsigned long length, unsigned long * driver_ptr)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020011),"b" (buf),"c" (length),"d" (driver_ptr)
					 ); 
	return __res;
}

long the_file_getsize(unsigned int fd)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x020012),"b" (fd)
					 ); 
	return __res;
}

///////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////!!!!!!!!

long the_exec_execve(unsigned char * arg_ptr)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x030000),"b" (arg_ptr)
					 ); 
	return __res;

}

long the_exec_exit(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x030001)
					 ); 
	return __res;
}

///////////////////////////////////////////////////////////////////////!!!!!!!!

/////////////////////////////////////////////////////////////////////

long the_serial_open(unsigned long * serialparam_ptr)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040000),"b" (serialparam_ptr)
					 ); 
	return __res;
}

/////////////////////////////////////////////////////////////////////

long the_serial_close(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040001)
					 ); 
	return __res;
}

/////////////////////////////////////////////////////////////////////

long the_serial_refresh(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040002)
					 ); 
	return __res;
}

/////////////////////////////////////////////////////////////////////

long the_serial_getbaud(void)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040003)
					 ); 
	return __res;
}

/////////////////////////////////////////////////////////////////////

long the_serial_setbaud(short serial_BAUD)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040004),"b" (serial_BAUD)
					 ); 
	return __res;
}

////////////////////////////////////////////////

long the_serial_Send(char * buf, int length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040005), "b" (buf), "c" (length)
					 ); 
	return __res;
}

/////////////////////////////////////////////////

long the_serial_Receive(char * buf, int length)
{
	long __res;
	
	__asm__ volatile ("int $0x80" 
					 :"=a"(__res) 
					 :"0"(0x040006), "b" (buf), "c" (length)
					 ); 
	return __res;
}

///////////////////////////////////////////////////////////////////////////////



⌨️ 快捷键说明

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