📄 ut10_klog.c
字号:
/***************************************************************************
** File name : klogdaemon.c
** Author : x.cheng
** Create date :
**
** Comment:
** The kernel log daemon.
**
** Revisions:
** $Log: ut10_klog.c,v $
** Revision 1.2 2005/07/27 15:52:11 x.cheng
** bug fix, schedule in endless loop.
**
** Revision 1.1.1.1 2005/07/27 06:53:15 x.cheng
** add into repositories
**
**
***************************************************************************/
#include "const.h"
#include "type.h"
#include "stdarg.h"
#include "stdlib.h"
#include "..\..\inc\i386\page.h" //kernel\inc\i386
#include "..\..\inc\i386\x86.h"
#include "..\..\inc\i386\system.h"
#include "..\..\inc\task.h" //kernel\inc
#include "..\..\inc\vga.h"
#include "..\..\inc\mts.h"
#include "..\..\inc\pmm.h"
#include "..\..\inc\tui.h"
/* debug preprocessor instrument
#ifdef _DEBUG__
#ifdef _DEBUG_SRV__
#endif
#endif
***************************/
/************************************************
*golable variabel
************************************************/
ts_Task *g_pstKlogTask = NULL;
//! Log level colors.
static unsigned char aucLogLevelColors [] =
{
RED, // KERN_EMERG
LIGHT_RED, // KERN_ALERT
YELLOW, // KERN_CRIT
GREEN, // KERN_ERR
LIGHT_GREEN, // KERN_WARNING
WHITE, // KERN_NOTICE
LIGHT_GREY, // KERN_INFO
GREY, // KERN_DEBUG
};
/************************************************************
*************************************************************
** Function Name: vUt10KernelLog
** Author: x.cheng
**
** Comment:
** The kernel log daemon.
**
** List of parameters:
**
**
** Return value:
**
**
** Revisions:
**
*************************************************************
*************************************************************/
void vUt10KernelLog()
{
ts_Console *pstConsole = pstTuiGetConsoleAddress(iTuiGetCurrentConsole());
unsigned long ulFlags;
#ifdef _DEBUG__
#ifdef _DEBUG_SRV__
kprintf("%s: enter log daemon", __FUNCTION__);
vDbgDummy();
#endif
#endif
g_pstKlogTask = pstMtsGetCurrentTask();
g_pstKlogTask->iConsole = TOTAL_VIRTUAL_CONSOLE_NB;
while( TRUE ) {
SaveEflagsAndCli(ulFlags);
//vVgaConsolePutString(pstConsole, "enter log daemon");
#ifdef _DEBUG__
#ifdef _DEBUG_SRV__
kprintf("log daemon thread....\n");
vMtsPrintProcessInfo();
// vMtsTaskSleep(&g_pstKlogTask);
vDbgDummy();
#endif
#endif
vMtsPrintProcessInfo();
RestoreEflags(ulFlags);
// vMtsTaskSleep(&g_pstKlogTask);
vMtsSchedule();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -