[PATCH] boot_linux.c: show all parametel for kernol booting
"boot [-v]" show sysconf by function ShowSysConf();
signed-off-by: Rouchel Yan <rouchel.yan@gmail.com>
signed-off-by: Dongwei King <dongwei.king@gmail.com>
signed-off-by: Benner Zhou <benner.zhou@gmail.com>
_________________________________________________________________
diff -Nr g-bios/app/boot/boot_linux.c g-bios-new/app/boot/boot_linux.c
452a453,486
>
>
> static void ShowSysConf()
> {
> struct NetConf *pNetConf;
> struct LinuxParam *pKeParam;
> char IpV4Tmp[8];
>
> printf("Machine Id: %4d\n", MACH_ID);
>
> IpV4Tmp[7] = '\0';
> GuSysGetNetConf(&pNetConf);
> GuSysGetLinuxParam(&pKeParam);
> printf("****** SYS CONF ******\n");
>
> printf("RootDev: %d\n", pKeParam->nRootDev);
>
> GuIpToStr(IpV4Tmp, pNetConf->dwTftpSvrIP);
> printf("TftpServerIp: %s\n", IpV4Tmp);
> GuIpToStr(IpV4Tmp, pNetConf->dwLocalIP);
> printf("LocalIp: %s\n", IpV4Tmp);
>
> GuIpToStr(IpV4Tmp, pKeParam->szNfsSvr);
> printf("NFS Sever: %s", IpV4Tmp);
> printf(":%s\n", pKeParam->szNfsPath);
>
> printf("ImgKernelName: %s\n", pKeParam->szImgKernel);
> printf("ImgRmdiskName: %s\n", *pKeParam->szImgRd == 0? "No RmDisk Image!": pKeParam);
>
> printf("condev : %s\n", pKeParam->szConDev);
> printf("****************************\n");
> }
>
>
455c489
< int i, ret;
---
> int i, ret, vflag = 0;
572a607
> case 'V':
573a609
> ShowSysConf();
604a641
>
647d683
<
Binary files g-bios/.configure.swp and g-bios-new/.configure.swp differ
Binary files g-bios/Untitled Project.IAB and g-bios-new/Untitled Project.IAB differ
Binary files g-bios/Untitled Project.IAD and g-bios-new/Untitled Project.IAD differ
Binary files g-bios/Untitled Project.IMB and g-bios-new/Untitled Project.IMB differ
Binary files g-bios/Untitled Project.IMD and g-bios-new/Untitled Project.IMD differ
Binary files g-bios/Untitled Project.PFI and g-bios-new/Untitled Project.PFI differ
Binary files g-bios/Untitled Project.PO and g-bios-new/Untitled Project.PO differ
Binary files g-bios/Untitled Project.PR and g-bios-new/Untitled Project.PR differ
Binary files g-bios/Untitled Project.PRI and g-bios-new/Untitled Project.PRI differ
Binary files g-bios/Untitled Project.PS and g-bios-new/Untitled Project.PS differ
diff -Nr g-bios/Untitled Project.SearchResults g-bios-new/Untitled Project.SearchResults
0a1,2
> ---- prinft Matches (1 in 1 files) ----^M
> Boot_linux.c (app\boot): prinft("mem:\n \^M
Binary files g-bios/Untitled Project.WK3 and g-bios-new/Untitled Project.WK3 differ
[ 本帖最后由 rouchel 于 2009-6-26 16:38 编辑 ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
1. patch格式不对,请重新生成patch
2. 函数的本意是只显示本次启动时使用的内核参数,而patch中未能做到这一点,有些不必要的信息也打印出来了,如nRootDev
Only patch form has been changed, please check it! Thanks!
------------------------------------------------------------------------------------------------
Index: app/boot/boot_linux.c
===================================================================
--- app/boot/boot_linux.c (revision 420)
+++ app/boot/boot_linux.c (working copy)
@@ -450,6 +450,40 @@
return 0;
}
+
+
+static void ShowSysConf()
+{
+ struct NetConf *pNetConf;
+ struct LinuxParam *pKeParam;
+ char IpV4Tmp[8];
+
+ printf("Machine Id: %4d\n", MACH_ID);
+
+ IpV4Tmp[7] = '\0';
+ GuSysGetNetConf(&pNetConf);
+ GuSysGetLinuxParam(&pKeParam);
+ printf("****** SYS CONF ******\n");
+
+ printf("RootDev: %d\n", pKeParam->nRootDev);
+
+ GuIpToStr(IpV4Tmp, pNetConf->dwTftpSvrIP);
+ printf("TftpServerIp: %s\n", IpV4Tmp);
+ GuIpToStr(IpV4Tmp, pNetConf->dwLocalIP);
+ printf("LocalIp: %s\n", IpV4Tmp);
+
+ GuIpToStr(IpV4Tmp, pKeParam->szNfsSvr);
+ printf("NFS Sever: %s", IpV4Tmp);
+ printf(":%s\n", pKeParam->szNfsPath);
+
+ printf("ImgKernelName: %s\n", pKeParam->szImgKernel);
+ printf("ImgRmdiskName: %s\n", *pKeParam->szImgRd == 0? "No RmDisk Image!": pKeParam);
+
+ printf("condev : %s\n", pKeParam->szConDev);
+ printf("****************************\n");
+}
+
+
static int main(int argc, char *argv[])
{
int i, ret;
@@ -570,7 +604,9 @@
break;
case 'v':
+ case 'V':
isShowArg = TRUE;
+ ShowSysConf();
break;
case 'h':
@@ -602,6 +638,7 @@
{
ret = PartLoadImage(PT_OS_LINUX, &pImgKernel);
}
+
// TODO: check the kernel image
@@ -644,7 +681,6 @@
EndSetupTag(pTag);
-
if (isShowArg)
{
ShowBootArgs((void *)ATAG_BASE);
Index: boot/nand.c
===================================================================
The "nrootdev" option has been fixed! If some lines need to be fixed or has anything wrong, please send a massage to tell me, thanks!
______________________________________________
+ printf("ImgKernelName: %s\n", pKeParam->szImgKernel);
+ printf("ImgRmdiskName: %s\n", *pKeParam->szImgRd == 0? "No RmDisk Image!": pKeParam);
+
+ printf("condev : %s\n", pKeParam->szConDev);
+ printf("****************************\n");
+}
+
+
static int main(int argc, char *argv[])
{
int i, ret;
@@ -570,7 +602,9 @@
break;
case 'v':
+ case 'V':
isShowArg = TRUE;
+ ShowSysConf();
break;
case 'h':
@@ -602,6 +636,7 @@
{
ret = PartLoadImage(PT_OS_LINUX, &pImgKernel);
}
+
// TODO: check the kernel image
@@ -644,7 +679,6 @@
EndSetupTag(pTag);
-
if (isShowArg)
{
ShowBootArgs((void *)ATAG_BASE);
Index: boot/nand.c
===================================================================
--- boot/nand.c (revision 421)
+++ boot/nand.c (working copy)
@@ -75,7 +75,7 @@
}
-int IsPower2(UINT32 n)
+static int IsPower2(UINT32 n)
{
return (n & (n - 1)) == 0;
}
[ 本帖最后由 rouchel 于 2009-6-26 14:39 编辑 ]
The problem was fixed, please review again! Thanks~!
________________________________________
Index: app/boot/boot_linux.c
===================================================================
--- app/boot/boot_linux.c (revision 421)
+++ app/boot/boot_linux.c (working copy)
@@ -408,6 +408,8 @@
i = 0;
printf("\n");
+ printf("Machine Id: %d\n", MACH_ID);
+
while (1)
{
printf("[ATAG %d] ", ++i);
@@ -416,6 +418,13 @@
{
case ATAG_CORE:
printf("****** ATAG Begin ******\n");
+ printf("************core************\n\
+ \rFlags: %d\n\
+ \rPagesize: 0x%8x\n\
+ \rRootdev: %d\n",
+ pTag->stCore.ulFlags,
+ pTag->stCore.nPageSize,
+ pTag->stCore.ulRootDev);
break;
case ATAG_CMDLINE:
@@ -429,18 +438,92 @@
);
break;
+ case ATAG_VIDEOTEXT:
+ printf("************Videotext************\n\
+ \rX: %3d Y: %3d\n\
+ \rvideopage: %d\n\
+ \rvideomode: %d\n\
+ \rvideocols: %d\n\
+ \rvideoegabx: %d\n\
+ \rvideoelines: %d\n\
+ \rvideoisvga: %d\n\
+ \rvideopoints: %d\n",
+ pTag->stVideoText.bX,
+ pTag->stVideoText.bY,
+ pTag->stVideoText.usVideoPage,
+ pTag->stVideoText.bVideoMode,
+ pTag->stVideoText.bVideoCols,
+ pTag->stVideoText.usVideoEgaBx,
+ pTag->stVideoText.bVideoLines,
+ pTag->stVideoText.bVideoIsVGA,
+ pTag->stVideoText.usVideoPoints);
+ break;
+
+ case ATAG_RAMDISK:
+ printf("************ramdisk************\n\
+ \rFlags: %d\n\
+ \rSize: %d\n\
+ \rStart: 0x%8x\n",
+ pTag->stRamDisk.dwFlags,
+ pTag->stRamDisk.nSize,
+ pTag->stRamDisk.nStart);
+ break;
+
+ case ATAG_INITRD:
case ATAG_INITRD2:
+ printf("************initrd************\n");
printf("Initrd: [0x%08x - 0x%08x]\n",
pTag->stInitRd.ulStart, pTag->stInitRd.ulStart + pTag->stInitRd.nSize
);
break;
+ case ATAG_SERIAL:
+ printf("************serial************\n\
+ \rLow: %d\n\
+ \rHigh: %d\n",
+ pTag->stSerialNr.ulLow,
+ pTag->stSerialNr.ulHigh);
+ break;
+
+ case ATAG_REVISION:
+ printf("************revison************\n");
+ printf("revsion:\nRevsion: %d\n", pTag->stRevision);
+ break;
+
+ case ATAG_VIDEOLFB:
+ printf("************videolfb************\n\
+ \rbWidth: %d\n\
+ \rbHigh: %d\n\
+ \rDepth: %d\n\
+ \rLineLengt: %d\n\
+ \rBaseAddr: 0x%8x\n\
+ \rsize: %d\n\
+ \rRedsize: %d\tRedPos: %d\n\
+ \rGreensize: %d\tGrePos: %d\n\
+ \rBluesize: %d\tBluPos: %d\n\
+ \rRsvdSize: %d\n\
+ \rRsvdPos: %d\n",
+ pTag->stVideoLfb.usLfbWidth,
+ pTag->stVideoLfb.usLfbHeight,
+ pTag->stVideoLfb.usLfbDepth,
+ pTag->stVideoLfb.usLfbLineLength,
+ pTag->stVideoLfb.ulLfbBase,
+ pTag->stVideoLfb.nLfbSize,
+ pTag->stVideoLfb.bRedSize,
+ pTag->stVideoLfb.bRedPos,
+ pTag->stVideoLfb.bGreenSize,
+ pTag->stVideoLfb.bGreenPos,);
+ break;
+
case ATAG_NONE:
printf("****** ATAG End ******\n");
return 0;
- default: // fixme
- printf("tag = 0x%08x\n", pTag->stHdr.ulTag);
+ default:
break;
}