Hi,
one feature that goes with a device model is to add indentification capability to the SerialICE shell.
I added two commands:
*mb prints the mainboard name in a 32byte free text string. *vi prints version information. (To determine whether the Shell part and the Qemu part fit together)
So each board defines
const char boardname[33]="Kontron 986LCD-M ";
How would people prefer to have it? A null terminated string rather than a fixed size string? Spaces?
Stefan
Signed-off-by: Stefan Reinauer stepan@coresystems.de
Index: serialice.c =================================================================== --- serialice.c (revision 66) +++ serialice.c (working copy) @@ -186,13 +186,24 @@ sio_put32(reg32); }
+static void serialice_mainboard(void) +{ + /* must be defined in mainboard/<boardname>.c */ + sio_putstring(boardname); +} + +static void serialice_version(void) +{ + sio_putstring("\nSerialICE v" VERSION " (" __DATE__ ")\n"); +} + int main(void) { chipset_init();
sio_init();
- sio_putstring("\nSerialICE v" VERSION " (" __DATE__ ")\n"); + serialice_version();
while(1) { u16 c; @@ -227,6 +238,11 @@ case (('c' << 8)|'i'): // Read CPUID *ci serialice_cpuinfo(); break; + case (('m' << 8)|'b'): // Read mainboard type *mb + serialice_mainboard(); + break; + case (('v' << 8)|'i'): // Read version info *vi + serialice_mainboard(); default: sio_putstring("ERROR\n"); break; Index: mainboard/asus_p2b.c =================================================================== --- mainboard/asus_p2b.c (revision 66) +++ mainboard/asus_p2b.c (working copy) @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is a chipset init file for the ASUS P2B mainboard. - */ +/* This is a chipset init file for the ASUS P2B mainboard. */
+const char boardname[33]="ASUS P2B "; + #define PNP_PORT 0x3f0
static void superio_init(void) Index: mainboard/dell_s1850.c =================================================================== --- mainboard/dell_s1850.c (revision 66) +++ mainboard/dell_s1850.c (working copy) @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is an example chipset init file for the Dell S1850 - */ +/* This is a chipset init file for the Dell S1850 */
+const char boardname[33]="DELL S1850 "; + /* Hardware specific functions */ static void mainboard_set_ich5(void) { Index: mainboard/thomson_ip1000.c =================================================================== --- mainboard/thomson_ip1000.c (revision 66) +++ mainboard/thomson_ip1000.c (working copy) @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is an example chipset init file for the THOMSON IP1000 mainboard - */ +/* This is a chipset init file for the THOMSON IP1000 mainboard */
+const char boardname[33]="THOMSON IP1000 "; + /* Hardware specific functions */
#define PMBASE 0x400 Index: mainboard/asus_m2v-mx_se.c =================================================================== --- mainboard/asus_m2v-mx_se.c (revision 66) +++ mainboard/asus_m2v-mx_se.c (working copy) @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+const char boardname[33]="ASUS M2V-MX SE "; + #define SUPERIO_CONFIG_PORT 0x2e
static void superio_init(void) Index: mainboard/rca_rm4100.c =================================================================== --- mainboard/rca_rm4100.c (revision 66) +++ mainboard/rca_rm4100.c (working copy) @@ -17,9 +17,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is an example chipset init file for the RCA RM4100 mainboard - */ +/* This is a chipset init file for the RCA RM4100 mainboard */ + +const char boardname[33]="RCA RM4100 ";
/* Hardware specific functions */
Index: mainboard/intel_d945gclf.c =================================================================== --- mainboard/intel_d945gclf.c (revision 66) +++ mainboard/intel_d945gclf.c (working copy) @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is an example chipset init file for the Kontron 986LCD-M mainboard - */ +/* This is a chipset init file for the Intel D945GCLF mainboard */
+const char boardname[33]="Intel D945GCLF "; + /* Hardware specific functions */
#define RCBA 0xfed1c000 Index: mainboard/kontron_986lcd-m.c =================================================================== --- mainboard/kontron_986lcd-m.c (revision 66) +++ mainboard/kontron_986lcd-m.c (working copy) @@ -17,10 +17,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-/* - * This is an example chipset init file for the Kontron 986LCD-M mainboard - */ +/* This is a chipset init file for the Kontron 986LCD-M mainboard */
+const char boardname[33]="Kontron 986LCD-M "; + /* Hardware specific functions */
#define RCBA 0xfed1c000 Index: mainboard/msi_ms6178.c =================================================================== --- mainboard/msi_ms6178.c (revision 66) +++ mainboard/msi_ms6178.c (working copy) @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+const char boardname[33]="MSI MS6178 "; + #define PMBASE 0x40 #define COM_DEC 0xe0 #define LPC_EN 0xe6
On 11/25/2009 06:04 PM, Stefan Reinauer wrote:
Hi,
one feature that goes with a device model is to add indentification capability to the SerialICE shell.
I added two commands:
*mb prints the mainboard name in a 32byte free text string. *vi prints version information. (To determine whether the Shell part and the Qemu part fit together)
So each board defines
const char boardname[33]="Kontron 986LCD-M ";
How would people prefer to have it? A null terminated string rather than a fixed size string? Spaces?
I think it is a fine idea.
Will it also print the vender/model in the dump? That may be helpful when referencing a bunch of different dumps (my collection is growing:-))