diff --git a/Kernel/Sys.cpp b/Kernel/Sys.cpp index 3d631968..61fbc700 100644 --- a/Kernel/Sys.cpp +++ b/Kernel/Sys.cpp @@ -6,20 +6,32 @@ TSys Sys; const TTime Time; +// 系统配置 +const SystemConfig g_Config = { + // 操作系统 v3.2.x + (0x03020000 | __BUILD_DATE__), + "SmartOS_CPU", + + // 硬件 + 0x0, + + // 应用软件 + 0x0, + 0x0, + "WsLink", + "", +}; + #if defined(BOOT) || defined(APP) struct HandlerRemap StrBoot __attribute__((at(0x2000fff0))); #endif -#ifndef BIT - #define BIT(x) (1 << (x)) -#endif - // 关键性代码,放到开头 INROOT TSys::TSys() { - Config = nullptr; + Config = &g_Config; OnInit(); @@ -48,11 +60,10 @@ void TSys::Init(void) void TSys::ShowInfo() const { #if DEBUG - //byte* ver = (byte*)&Version; debug_printf("%s::%s Code:%04X ", Company, Name, Code); - //debug_printf("Ver:%x.%x Build:%s\r\n", *ver++, *ver++, BuildTime); - Version v(0, 0, Ver); - debug_printf("Ver:%s Build:%s\r\n", v.ToString().GetBuffer(), v.Compile().ToString().GetBuffer()); + Version v(Config->Ver); + debug_printf("Ver:%s\r\n", v.ToString().GetBuffer()); + debug_printf("Build:%s %s\r\n", __BUILD_USER__, __BUILD_COMPILE__); OnShowInfo(); diff --git a/Kernel/Sys.h b/Kernel/Sys.h index 936b0926..405e8809 100644 --- a/Kernel/Sys.h +++ b/Kernel/Sys.h @@ -144,18 +144,17 @@ class SystemConfig { public: // 操作系统 + uint Ver; // 系统版本。Version格式 char Name[16]; // 系统名称。如:SmartOS-M3-10x - uint Ver; // 系统版本。系统内 // 硬件 uint HardVer; // 硬件版本 // 应用软件 - ushort Type; // 产品种类 + ushort Code; // 产品种类 uint AppVer; // 产品版本 - char Serial[16]; // 授权码 - char Product[16];// 产品名称 char Company[16];// 公司 + char Product[16];// 产品批次 char DevID[16]; // 设备编码 char Server[32]; // 服务器。重置后先尝试厂商前端,再尝试原服务器 @@ -207,6 +206,21 @@ public: #endif +// 编译信息兼容性处理 +#ifndef __BUILD_DATE__ +#define __BUILD_DATE__ 0 +#endif +#ifndef __BUILD_TIME__ +#define __BUILD_TIME__ 0 +#endif +#ifndef __BUILD_COMPILE__ +#define __BUILD_COMPILE__ "" +#endif +#ifndef __BUILD_USER__ +#define __BUILD_USER__ "" +#endif + + #endif //_Sys_H_ /* diff --git a/Tool/Build_SmartOS_M3.cs b/Tool/Build_SmartOS_M3.cs index 62633900..c6af2fb0 100644 --- a/Tool/Build_SmartOS_M3.cs +++ b/Tool/Build_SmartOS_M3.cs @@ -17,6 +17,7 @@ build.AddFiles("..\\Test"); build.AddFiles("..\\TinyIP", "*.c;*.cpp", false, "HttpClient"); build.AddFiles("..\\TinyNet"); build.AddFiles("..\\TokenNet"); +build.AlwaysBuild = "Sys.cpp"; build.Libs.Clear(); //build.Preprocess = true; build.CompileAll();