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

📄 root.c

📁 进程之间通讯的一个例子
💻 C
📖 第 1 页 / 共 3 页
字号:
/*
  Copyright(c) Micro-Star International Co. Ltd.
  The copyright to the computer program(s) herein is the property of
  Micro-Star International Co. Ltd.
  The program(s) may be used and/or copied only with the written
  permission of MSI or in accordance with the terms and conditions
  stipulated in the agreement/contract under which the program(s) have
  been supplied.
*/
/*
 * MODULE FILE NAME: ROOT.C
 *
 * DESCRIPTION:
 *    root() is the entry routine of runtime high level code which is the first
 *    task of the whole system.
 *
 * NOTES:
 *    1. Call ROOT_init() and third party init() first, then call create task
 *    2. No context switch is allowed before the completation of initialization phase
 *    3. Root_init() will become a idle task after initialization
 *    4. For every component, there should exist a compiler control to perform
 *           inclusion or exclusion *
 * CREATOR:
 *    David Lin, 2003/03/14 (initial)
 *    Dino King, 2003/03/17 (modified)
 *
 * HISTORY:
 *    $Log: root.c,v $
 *    Revision 1.103  2004/08/04 04:09:26  johnchang
 *    Add PPP Client feature
 *
 *    Revision 1.102  2004/08/04 02:41:53  johnchang
 *    Add PPTP Server feature
 *
 *    Revision 1.101  2004/07/29 03:30:51  wggan
 *    modify for l2tp
 *
 *    Revision 1.100  2004/07/23 15:02:42  kevinfan
 *    1.Add USB_STORAGE_Init();
 *
 *    Revision 1.99  2004/07/22 01:24:46  yukliao
 *    add ftp server
 *
 *    Revision 1.98  2004/07/21 06:52:24  yukliao
 *    add ftp server define
 *
 *    Revision 1.97  2004/07/14 06:16:26  tedwang
 *    Add TELNET_CfgInit().
 *
 *    Revision 1.96  2004/07/12 04:08:22  wyatthsu
 *    not to initialize rmgr when system is in apmode
 *
 *    Revision 1.95  2004/07/12 03:53:08  patternlee
 *    add vif function
 *
 *    Revision 1.94  2004/07/07 11:37:31  wggan
 *    create gena_notify task
 *
 *    Revision 1.93  2004/05/04 07:57:18  tedwang
 *    Change ROOT_Idle(), move FASTRT_KickTask() to SYSIO.
 *
 *    Revision 1.92  2004/04/30 02:06:54  yhhsu
 *    add FASTRT_KickTask to signal FASTRT_TaskMain to process packets in case that FASTRT queue all packets
 *
 *    Revision 1.91  2004/04/23 05:23:22  wenjenhuang
 *    add HTMLCGI_WEB_Expire_Init
 *
 *    Revision 1.90  2004/04/22 09:13:56  wenjenhuang
 *    no message
 *
 *    Revision 1.89  2004/04/22 07:05:18  wenjenhuang
 *    added CHECK_SYNC_FLASH_REQUEST(HTMLCGI_WEB_Expire_Init());
 *
 *    Revision 1.88  2004/04/12 10:41:34  jimmyhuang
 *    add webcam component
 *
 *    Revision 1.87  2004/03/09 12:05:50  wyatthsu
 *    Init DMA pool for wireless device.
 *
 *    Revision 1.86  2004/02/27 05:49:37  jfchen
 *    Add USB_PWC_Init() in ROOT_InitSystem
 *
 *    Revision 1.85  2004/02/20 12:04:57  tedwang
 *    Modify ROOT_InitMFS(), reserve Module1_New file type for MS-6848.
 *
 *    Revision 1.84  2004/02/19 08:43:59  tedwang
 *    Modify ROOT_InitMFS(), check the return code of MFS_SetFileSector().
 *
 *    Revision 1.83  2004/02/11 09:42:48  pandalee
 *    Check the return value of APMODE_init() because it will result in that CFGMGR sync the default values to flash if the return value is APMODE_NO_ERROR(equal to FALSE)
 *
 *    Revision 1.82  2004/01/30 02:48:20  pandalee
 *    Support AP mode.
 *
 *    Revision 1.81  2004/01/12 03:00:00  wyatthsu
 *    Init MVC if SYS_COMP_MVC is defined for MS6848
 *
 *    Revision 1.80  2004/01/06 07:20:58  tedwang
 *    Modify ROOT_InitMFS(), add reservation for small flash sectors.
 *
 *    Revision 1.79  2003/12/15 07:26:09  tedwang
 *    Add module file allocations on flash for MFS.
 *
 *    Revision 1.78  2003/12/02 13:38:32  philiphuang
 *    *** empty log message ***
 *
 *    Revision 1.77  2003/12/02 10:54:51  philiphuang
 *    Add BigPond Task and revise sysio.h
 *
 *    Revision 1.75  2003/11/19 10:04:38  johnnychen
 *     Add #ifdef SYS_COMP_SCTL in ROOT_InitMFS( ).
 *
 *    Revision 1.74  2003/11/19 08:50:44  johnnychen
 *    Add new component - Surfcontrol
 *
 *    Revision 1.73  2003/11/10 11:46:23  patternlee
 *    check in ipsec module
 *
 *    Revision 1.72  2003/10/27 12:28:29  dinoking
 *    Change support for CM access policy for DHCPS/PPPOECMGR
 *
 *    Revision 1.71  2003/10/23 07:27:58  dinoking
 *    supply upgrade ability for config file
 *
 *    Revision 1.70  2003/10/23 03:05:11  patternlee
 *    update pptp component initial process
 *
 *    Revision 1.69  2003/09/24 11:57:40  yhlin
 *    Add constants for Fast Route.
 *
 *    Revision 1.68  2003/09/24 11:54:18  yhlin
 *    Add component for Fast Route.
 *
 *    Revision 1.67  2003/09/23 13:34:48  wggan
 *    include dnsrelay.h
 *
 *    Revision 1.66  2003/09/20 12:01:12  jfchen
 *    Modify for WPA
 *
 *    Revision 1.65  2003/09/19 09:55:14  wyatthsu
 *    redifintion of nic initailization routine
 *
 *    Revision 1.64  2003/08/26 13:11:52  wggan
 *    add UPNP init and create task
 *
 *    Revision 1.63  2003/08/18 04:59:26  wyatthsu
 *    wlmgmt should be init'd before physical interface's initialization
 *
 *    Revision 1.62  2003/08/11 04:52:14  tedwang
 *    Modify ROOT_InitializeSystem(), change UARTDRV_Init() using 19200 bps.
 *
 *    Revision 1.61  2003/08/07 09:27:20  tedwang
 *    Modify ROOT_InitializeSystem(), move enabling WDT ealier to fix factory reset bug.
 *
 *    Revision 1.60  2003/07/25 08:53:53  tedwang
 *    Modify ROOT_InitializeSystem() & ROOT_Idle() to add watchdog timer support.
 *
 *    Revision 1.59  2003/07/22 07:42:49  johnnychen
 *    no message
 *
 *    Revision 1.58  2003/07/17 06:00:54  tedwang
 *    Modify ROOT_Idle(), removing USB_OHCI_HcReset() & ARMMACWLAN_InterfaceReset() since
 *    they already included in SYSMGMT_RestartSystem().
 *
 *    Revision 1.57  2003/07/11 02:21:28  tedwang
 *    Modify ROOT_InitializeSystem() to add BINFO_Init() supporting "mfg-" commands.
 *
 *    Revision 1.56  2003/07/03 11:06:23  claudelee
 *    Add LED task
 *
 *    Revision 1.55  2003/07/03 06:01:49  patternlee
 *    pptp module update
 *
 *    Revision 1.54  2003/07/03 05:11:20  wyatthsu
 *    reset wireless interface before system reboot
 *
 *    Revision 1.53  2003/06/27 09:32:16  tedwang
 *    Modify ROOT_InitMFS(), add reservation for BINFO, CONFIG and DHCPCFG file type.
 *
 *    Revision 1.52  2003/06/25 13:12:23  kaikerho
 *    add DDNS_Create_Task() by kaiker,ho
 *
 *    Revision 1.51  2003/06/25 11:57:39  kaikerho
 *    ADD  BOOL DDNS_MGR_Init(void) by kaiker,ho
 *
 *    Revision 1.50  2003/06/25 07:35:47  dinoking
 *    add upnp init
 *
 *    Revision 1.49  2003/06/25 05:24:29  yukliao
 *    updata eventlog
 *
 *    Revision 1.48  2003/06/25 03:25:47  claudelee
 *    Add network monitor
 *
 *    Revision 1.47  2003/06/19 14:08:27  tedwang
 *    Change ROOT_Idle() to work-around restart hang issue.
 *
 *    Revision 1.46  2003/06/19 08:06:11  wggan
 *    Add init and create task for DNS Relay
 *
 *    Revision 1.45  2003/06/19 05:31:18  dinoking
 *    move SYSINFO_Init to the front of CFGMGR_Init, so that cfgmgr can reference sysinfo on initialization
 *
 *    Revision 1.44  2003/06/18 08:40:09  tedwang
 *    Add ROOT_Idle() to detect reset push button.
 *
 *    Revision 1.43  2003/06/17 04:14:40  dinoking
 *    move CFGMGR_Init() more front
 *
 *    Revision 1.42  2003/06/12 05:05:44  wyatthsu
 *    no need to register mlme callback function for wlan management
 *
 *    Revision 1.41  2003/06/10 15:11:52  marsonchien
 *    no message
 *
 *    Revision 1.40  2003/06/09 13:42:34  tedwang
 *    Add FOPER_Init() into ROOT_InitializeSystem().
 *
 *    Revision 1.39  2003/06/06 09:40:58  wyatthsu
 *    add wlmgmt task
 *
 *    Revision 1.38  2003/06/06 05:03:56  johnnychen
 *    no message
 *
 *    Revision 1.37  2003/06/05 07:07:37  tedwang
 *    Modify ROOT_InitializeSystem() and ROOT_CreateTask(), add compiler option for WCM.
 *
 *    Revision 1.36  2003/06/03 04:26:14  johnnychen
 *    no message
 *
 *    Revision 1.35  2003/05/30 18:50:10  jfchen
 *    Creat a task to free buffer for USB ISR.
 *
 *    Revision 1.34  2003/05/28 09:57:11  kaikerho
 *    modify  PrinterServer_CreateTask
 *
 *    Revision 1.33  2003/05/28 02:34:19  jfchen
 *    Moved USB init  to USB_HUB_Thread
 *
 *    Revision 1.32  2003/05/26 13:34:26  yukliao
 *    sntp update
 *
 *    Revision 1.31  2003/05/26 12:54:20  wyatthsu
 *    add wlmgmt (wireless management) component
 *
 *    Revision 1.30  2003/05/23 10:53:35  kaikerho
 *    Added initialization for PrinterServer
 *
 *    Revision 1.29  2003/05/22 06:56:22  jfchen
 *    Extract task creating from USB_HUB_Init
 *    and create USB HUB task here.
 *
 *    Revision 1.28  2003/05/21 11:21:16  jfchen
 *    eliminate ctrl-M
 *
 *    Revision 1.27  2003/05/21 09:40:35  jfchen
 *    Added initialization for USB driver.
 *
 *    Revision 1.26  2003/05/21 09:26:53  kaikerho
 *    Add SYS_COMP_PRINTER_SERVER define for PrinterServer
 *
 *    Revision 1.25  2003/05/21 06:11:52  yukliao
 *    SNTP update
 *
 *    Revision 1.24  2003/05/21 05:56:09  yukliao
 *    SNTP update
 *
 *    Revision 1.23  2003/05/20 11:26:55  tedwang
 *    Update ROOT_InitMFS() to change the MFS_Init() input.
 *
 *    Revision 1.22  2003/05/19 11:35:49  kaikerho
 *    add Printer Server task
 *

 *    Revision 1.21  2003/05/16 14:27:41  johnchang
 *    no message
 *
 *    Revision 1.20  2003/05/16 10:46:45  yukliao
 *    sntp build
 *
 *    Revision 1.19  2003/05/14 14:47:15  tedwang
 *    Modify ROOT_InitializeSystem(); Add SYSIO, MFS, SYSMGMT, and BROMMENU init.
 *
 *    Revision 1.18  2003/05/07 02:28:43  yhlin
 *    Add bridge component
 *
 *    Revision 1.17  2003/05/06 11:29:53  wyatthsu
 *    init for wireless trap msg notification feature
 *
 *    Revision 1.16  2003/05/06 09:42:27  jimmyhuang
 *    Add dhcp server and add ifdefine macro for  sysmgmt
 *
 *    Revision 1.15  2003/05/06 07:02:05  wyatthsu
 *    Init for linkscan notification feature
 *
 *    Revision 1.14  2003/05/06 04:00:28  tedwang
 *    Modify ROOT_InitializeSystem() to add sysinfo initialization.
 *
 *    Revision 1.13  2003/05/05 12:08:18  wyatthsu
 *    1 spawn linkscan task
 *
 *    Revision 1.12  2003/04/25 15:08:10  jfchen
 *    Added initialization of  PCI driver.
 *
 *    Revision 1.11  2003/04/23 13:01:10  yhlin
 *    Make component of flash and uart reusable by other project. Once if they
 *    define related constant in sys_comp.h.
 *
 *    Revision 1.10  2003/04/17 17:10:42  philiphuang
 *    merge code with ChuPei team
 *
 *    Revision 1.9  2003/04/11 03:50:01  dinoking
 *    add init for FutureNAT
 *
 *    Revision 1.8  2003/04/09 07:49:17  marsonchien
 *    no message
 *
 *    Revision 1.7  2003/03/28 02:54:50  dinoking
 *    add init for WCM
 *
 *    Revision 1.6  2003/03/27 09:58:12  dinoking
 *    change INICHE_InitNetDB to INICHE_InitResource, implement task priority
 *    chnage and sleep task of ROOT_Main
 *
 *    Revision 1.5  2003/03/25 17:44:06  philiphuang
 *    add direct link routing table
 *
 *    Revision 1.4  2003/03/21 10:15:34  dinoking
 *    redefine some naming constant
 *
 *    Revision 1.3  2003/03/20 09:41:24  dinoking
 *    Fix header file reference
 *
 *    Revision 1.2  2003/03/19 10:30:57  dinoking
 *    add CLONEMACMGR_Init
 *
 *    Revision 1.1  2003/03/19 07:38:14  dinoking
 *    Add root task
 *
 *
 *
 */


/* INCLUDE FILES */
/* system-wise dependent */
#include "sys_hdr/sys_type.h"

/* kernel service */
#include "stdio.h"

/* project dependent */
#include "sys_comp.h"
#ifndef ECOS_UITRON
#include "sys_hwcfg.h"
#include "drv/sysio/hdr/sysio.h"
#include "led.h"
#include "hal/hdr/gpio.h"
#endif

/* drviers */
#ifdef SYS_COMP_NIC
#include "drv/net/hdr/s3c2510nic.h"
#endif

#ifdef SYS_COMP_WIRELESS
#include "drv/ieee802dot11/hdr/ieee802dot11.h"
#endif

#ifdef SYS_COMP_FLASH
#include "drv/flash/hdr/flashdrv.h"
#endif

#ifdef SYS_COMP_UART
#include "drv/uart/hdr/uartdrv.h"
#endif

#ifdef SYS_COMP_USB
#include "drv/usb/hdr/usb_init.h"
#endif  /* #ifdef SYS_COMP_USB */



/* own components */
#include "core/root/hdr/root.h"
#include "core/cfgmgr/hdr/cfgmgr.h"
#include "core/ifmgr/hdr/ifmgr.h"
#include "core/clonemacmgr/hdr/clonemacmgr.h"
#include "core/dhcpcmgr/hdr/dhcpcmgr.h"
#include "core/wcm/hdr/wcm_mgr.h"
#ifdef SYS_COMP_MFS
#include "core/mfs/hdr/mfs.h"
#endif
#include "core/foper/hdr/foper.h"
#include "core/sysmgmt/hdr/sysinfo.h"
#include "core/dhcps/hdr/dhcpsmgr.h"
#include "core/sysmgmt/hdr/sysmgmt.h"



#ifdef SYS_COMP_SNTPCLIENT
#include "core/sntp/hdr/sntp_mgr.h"
#endif

#ifdef SYS_COMP_EVENTLOG
#include "core/eventlog/hdr/eventlog_mgr.h"
#endif

#ifdef SYS_COMP_BRIDGE
#include "core/bridge/hdr/bridge.h"
#endif

#ifdef BOOTROM_SYSTEM
#include "bootrom/cli/hdr/brommenu.h"
#endif

#ifdef SYS_COMP_DHCP_CLIENT
#include "core/dhcpcmgr/hdr/dhcpcmgr.h"
#endif

#ifdef SYS_COMP_WEBCAM
#include "core/webcammgr/hdr/webcammgr.h"
#endif

#ifdef SYS_COMP_PPPOE_CLIENT
#include "core/pppoecmgr/hdr/pppoecmgr.h"
#endif

#ifdef SYS_COMP_FUTURE_NAT
#include "core/funat/hdr/funat_mgr.h"
#endif

#ifdef SYS_COMP_FUTURE_FIREWALL
#include "core/fwl/hdr/fwl_mgr.h"
#endif


#ifdef SYS_COMP_PRINTER_SERVER
#include "core/lpd/hdr/lpdapi.h"
#endif

#ifdef SYS_COMP_WLMGMT
#include "core/wlmgmt/hdr/wlmgmt.h"
#endif

#ifdef SYS_COMP_SMTPC
#include "core/smtpc/hdr/smtpc.h"
#endif

#ifdef SYS_COMP_NETMON
#include "core/netmon/hdr/netmon.h"
#endif

#ifdef SYS_COMP_DNSRELAY
#include "core/dnsrelay/hdr/dnsrelay.h"
#endif

#ifdef SYS_COMP_UPNP
#include "core/upnp/hdr/upnp.h"
#endif

#ifndef ECOS_UITRON
#include "core/binfo/hdr/binfo.h"
#endif

#ifdef SYS_COMP_RMGR
#include "core/rmgr/hdr/rmgr.h"
#endif

#ifdef SYS_COMP_SCTL
#include "core/sctl/hdr/sctl.h"
#endif

#ifdef SYS_COMP_WPA
#include "core/wpa/hdr/wpa.h"
#endif

#ifdef SYS_COMP_HARDWARE_DES
#include "drv/des/hdr/desdrv.h"
#endif

#ifdef SYS_COMP_FASTROUTE
#include "core/fastrt/hdr/fastrt.h"
#endif


#ifdef SYS_COMP_VPN
#include "core/vpnmgr/hdr/vpnmgr.h"
#endif

#ifdef SYS_COMP_APMODE
#include "core/apmode/hdr/apmode_api.h"
#endif

#ifdef SYS_COMP_BGLONG
#include "core/bpalogin/hdr/bigpond_mgr.h"
#endif

#ifdef SYS_COMP_TASK1
#include "core/task1/hdr/task1.h"
#endif

#ifdef SYS_COMP_TASK2
#include "core/task2/hdr/task2.h"
#endif

⌨️ 快捷键说明

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