Module Name: src Committed By: kiyohara Date: Wed Oct 27 10:37:38 UTC 2010
Modified Files: src/sys/arch/bebox/stand/boot: boot.c Log Message: Set root-device to bootinfo. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/bebox/stand/boot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/bebox/stand/boot/boot.c diff -u src/sys/arch/bebox/stand/boot/boot.c:1.23 src/sys/arch/bebox/stand/boot/boot.c:1.24 --- src/sys/arch/bebox/stand/boot/boot.c:1.23 Thu Oct 14 06:58:22 2010 +++ src/sys/arch/bebox/stand/boot/boot.c Wed Oct 27 10:37:38 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.23 2010/10/14 06:58:22 kiyohara Exp $ */ +/* $NetBSD: boot.c,v 1.24 2010/10/27 10:37:38 kiyohara Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -61,6 +61,7 @@ struct btinfo_memory btinfo_memory; struct btinfo_console btinfo_console; struct btinfo_clock btinfo_clock; +struct btinfo_rootdevice btinfo_rootdevice; extern char bootprog_name[], bootprog_rev[], bootprog_maker[], bootprog_date[]; @@ -73,7 +74,7 @@ int n = 0; int addr, speed; char *name, *cnname; - void *p, *bootinfo; + void *bootinfo; if (whichCPU() == 1) cpu1(); @@ -114,13 +115,6 @@ btinfo_clock.common.type = BTINFO_CLOCK; btinfo_clock.ticks_per_sec = TICKS_PER_SEC; - p = bootinfo; - memcpy(p, (void *)&btinfo_memory, sizeof (btinfo_memory)); - p += sizeof (btinfo_memory); - memcpy(p, (void *)&btinfo_console, sizeof (btinfo_console)); - p += sizeof (btinfo_console); - memcpy(p, (void *)&btinfo_clock, sizeof (btinfo_clock)); - runCPU1((void *)start_CPU1); wait_for(&CPU1_alive); @@ -156,9 +150,10 @@ void exec_kernel(char *name, void *bootinfo) { - int howto = 0; + int howto = 0, i; char c, *ptr; u_long marks[MARK_MAX]; + void *p; #ifdef DBMONITOR int go_monitor; @@ -209,6 +204,37 @@ } #endif /* DBMONITOR */ + p = bootinfo; + + /* + * root device + */ + btinfo_rootdevice.common.next = sizeof (btinfo_rootdevice); + btinfo_rootdevice.common.type = BTINFO_ROOTDEVICE; + strncpy(btinfo_rootdevice.rootdevice, name, + sizeof (btinfo_rootdevice.rootdevice)); + i = 0; + while (btinfo_rootdevice.rootdevice[i] != '\0') { + if (btinfo_rootdevice.rootdevice[i] == ':') + break; + i++; + } + if (btinfo_rootdevice.rootdevice[i] == ':') { + /* It is NOT in-kernel. */ + + btinfo_rootdevice.rootdevice[i] = '\0'; + + memcpy(p, (void *)&btinfo_rootdevice, + sizeof (btinfo_rootdevice)); + p += sizeof (btinfo_rootdevice); + } + + memcpy(p, (void *)&btinfo_memory, sizeof (btinfo_memory)); + p += sizeof (btinfo_memory); + memcpy(p, (void *)&btinfo_console, sizeof (btinfo_console)); + p += sizeof (btinfo_console); + memcpy(p, (void *)&btinfo_clock, sizeof (btinfo_clock)); + printf("start=0x%lx\n\n", marks[MARK_ENTRY]); delay(1000); __syncicache((void *)marks[MARK_ENTRY],