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

📄 def_cdl.h

📁 小型操作系统,以VC为开发环境,需要boachs调试
💻 H
字号:
/***************************************************************************
**     File name   : def_cdl.h
**     Author      : x.cheng
**     Create date :
**
**	   Comment:
**        cd loader.
**
**     Revisions:
**     $Log: def_cdl.h,v $
**     Revision 1.1  2005/08/14 09:50:23  x.cheng
**     add into repositories
**
**
***************************************************************************/
#ifndef __DEF_CDL_H__
#define __DEF_CDL_H__
#include "def_iso.h"

//#define _DEBUG_LOADER__

#define CLI()	__asm__ ("cli" : : );
#define STI()	__asm__ ("sti" : : );
#define HALT()	__asm__ ("hlt" : : );

#define vOutPort(_uiPort, _ucData) \
	__asm__ __volatile__("outb %b0, %w1" : :"a"(_ucData), "d"(_uiPort));
/* 带延迟的硬件端口输出输入函数 */
/* 标号是数字 */ 
#define ucInPortDelay(_uiPort) ({	\
	unsigned char ucResult;	\
	__asm__ __volatile__("inb %w1, %b0\n"	\
						"\tjmp	1f\n"	\
						"1:\tjmp 1f\n"	\
						"1:" : "=a" (ucResult) : "d" (_uiPort));	\
	ucResult;	\
	})
#define vOutPortDelay(_uiPort, _ucData) \
	__asm__ __volatile__("outb %b0, %w1\n"	\
			"\tjmp 1f\n"	\
			"1:\tjmp 1f\n"	\
			"1:" : : "a" (_ucData), "d"(_uiPort));

/*从端口读入一串数据*/
#define ReadPortString(_uiPort,_pucBuffer,_uiBytes)	\
	__asm__ __volatile__("cld;rep;insw"::"d" (_uiPort),"D" (_pucBuffer),"c" (_uiBytes/2))

/*向端口写入一串数据*/
#define WritePortString(_uiPort,_pucBuffer,_uiBytes)	\
	__asm__ __volatile__("cld;rep;outsw"::"d" (_uiPort),"S" (_pucBuffer),"c" (_uiBytes/2))

/***************funciton prototype, in ld2_atapi.c**************/
int iLd2CdromReset(void);
void Ld2ReadSector( unsigned long ulSector, unsigned char* pucBuffer);

/***************funciton prototype, in ld3_util.c**************/
int iLd3WaitIdeStatus( int iMask, int iVal);
int iLd3ControllerReady( );
#define PANIC(szPrompt)	\
	do {	\
		Ld4PutString( (const char*)(szPrompt) );	\
		CLI();	\
		HALT();	\
	}while(0)

#define POSITION(szPrompt)	\
	kprintf("%s-%d|%s(): position indicator...\n", __FILE__, __LINE__, __FUNCTION__)
void vDummy();
/***************funciton prototype, in ld4_video.c**************/
/* video CRTC register       */
#define VGA_CRTC_INDX   0x3d4
#define VGA_CRTC_DATA   0x3d5
void Ld4ScrollUp(void);
inline void Ld4GotoXy(WORD uiX, WORD uiY);
void Ld4PutChar(const char ch);
void Ld4PutString(const char *sz);
void Ld4ClearVideoRam(void);
void Ld4PutSpecialChar(unsigned char ucChar, unsigned char ucColor);
#define INIT_PROGRESS	0x00
#define ADD_PROGRESS	0x01
#define DEC_PROGRESS	0x02
#define END_PROGRESS	0x03
void Ld4PrintProgress(unsigned char ucAct, int iStep);

/***************funciton prototype, in ld5_iso.c**************/
void Ld5Iso96Setup();
int iLd5Iso96ReadFile(char* szFileName, unsigned char* pucBuffer);
int iLd5Iso96CompareName(char* szFileName, ts_Iso9660DirEntry* pstEntry);






/******************************************************/
int kprintf(const char *fmt, ...);
void HexDump(unsigned char *pszBuffer, unsigned short uiLen);

#endif /* end of  __DEF_CDL_H__ */

⌨️ 快捷键说明

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