vxworks在usrKernel.c打印信息

/* usrKernel.c - wind kernel initialization */

/* Copyright 1992-1999 Wind River Systems, Inc. */

/*
modification history
--------------------
01f,20jan99,jpd  added INITIAL_MEM_ALLOCATION.
01e,18sep95,ism  imported conditional include of wvLib.h from bootConfig.c
01d,28mar95,kkk  moved kernel defines to configAll.h
01c,07dec93,smb  configuration change for windview
01b,10nov92,jcf  configuration change for MicroWorks.
01a,18sep92,jcf  written.
*/

/*
DESCRIPTION
This file is used to configure and initialize the Wind kernel.  This file is
included by usrConfig.c.

NOMANUAL
*/

#ifdef INCLUDE_WDB
#define FREE_MEM_START_ADRS (FREE_RAM_ADRS + WDB_POOL_SIZE)
#else /* ! INCLUDE_WDB */
#define FREE_MEM_START_ADRS FREE_RAM_ADRS
#endif

#ifdef  INCLUDE_INITIAL_MEM_ALLOCATION
#define MEM_POOL_START (char *) /
     (ROUND_UP(FREE_MEM_START_ADRS, (INITIAL_MEM_ALIGNMENT)) + /
     (INITIAL_MEM_SIZE))
#else   /* INCLUDE_INITIAL_MEM_ALLOCATION */
#define MEM_POOL_START (char *) FREE_MEM_START_ADRS
#endif  /* INCLUDE_INITIAL_MEM_ALLOCATION */
/* global variables */

#ifdef INCLUDE_CONSTANT_RDY_Q
BMAP_LIST readyQBMap;  /* bit mapped ready queue list array */
#endif /* INCLUDE_CONSTANT_RDY_Q */

/*******************************************************************************
*
* usrKernelInit - configure kernel data structures
*
* NOMANUAL
*/

#define COM1_PORT   0x3F8
void  com_send_data(unsigned char sdata);
int com1_send_data_ready(void);
void com1_send_data(unsigned char data);
void com1_init(void)
 {
  int data;
    sysOutByte(COM1_PORT+3,0x80);   //DLAB="1", set baud

 sysOutByte(COM1_PORT,0x0c);     // 波特率 0x30:2400 0x18:4800 0x0c:9600
  
 sysOutByte(COM1_PORT+2,0x87);
 sysOutByte(COM1_PORT+2,0x81);

 sysOutByte(COM1_PORT+1,0x00);
 
 sysOutByte(COM1_PORT+3,0x03);   //data length: 8 , stop bits: 1

 sysOutByte(COM1_PORT+4,0x0b);

 //outportb(COM1_PORT+1,0x01);   // receive interrupt enable
 sysInByte(COM1_PORT);
 }
 

void com_send_string(unsigned char *str)
{
 int i;
 i="0";
 while(str[i] != '/0')
 {
  com_send_data(str[i]);
  i++;
 }
}

void  com_send_data(unsigned char sdata)
{
  while(1)
  {
    if(com1_send_data_ready())   // send data to com1 ready: 1, else 0
     {
        com1_send_data(sdata);    // send data to com1( 查询方式?)
        break;
     }
  }
}


int com1_send_data_ready(void)   // send data to com1 ready: 1, else 0
{
 if(((unsigned char )sysInByte(COM1_PORT+5) & 0x20)!= 0)
  return 1;
 else return 0;
}

void com1_send_data(unsigned char data)    // send data to com1( 查询方式?)
{
 //printf(" %x ",data);
 sysOutByte(COM1_PORT,data);
}

void usrKernelInit (void)

    {
   char *ROOT_buffersy;//shenyan
    classLibInit ();   /* initialize class (must be first) */
    taskLibInit ();   /* initialize task object */
    /* configure the kernel queues */

#ifdef INCLUDE_CONSTANT_RDY_Q
    qInit (&readyQHead, Q_PRI_BMAP, (int)&readyQBMap, 256); /* fixed ready q */
#else
    qInit (&readyQHead, Q_PRI_LIST); /* simple priority ready q */
#endif /* !INCLUDE_CONSTANT_RDY_Q */
//sysOutByte (0x3F8, 6);
    qInit (&activeQHead, Q_FIFO);  /* FIFO queue for active q */
    qInit (&tickQHead, Q_PRI_LIST);  /* simple priority semaphore q*/

    workQInit ();   /* queue for deferred work */

    /* start the kernel specifying usrRoot as the root task */

   com1_init();
   sprintf(ROOT_buffersy,"ROOT_STACK_SIZE=%d/n",ROOT_STACK_SIZE);
   com_send_string(ROOT_buffersy);
   sprintf(ROOT_buffersy,"ISR_STACK_SIZE=%d/n",ISR_STACK_SIZE);
   com_send_string(ROOT_buffersy);
   sprintf(ROOT_buffersy,"INT_LOCK_LEVEL=%d/n",INT_LOCK_LEVEL);
   com_send_string(ROOT_buffersy);  
   sprintf(ROOT_buffersy,"MEM_POOL_START=%d/n",MEM_POOL_START);
   com_send_string(ROOT_buffersy);
   kernelInit ((FUNCPTR) usrRoot, ROOT_STACK_SIZE, MEM_POOL_START,
                sysMemTop (), ISR_STACK_SIZE, INT_LOCK_LEVEL);
    } 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值