aboutsummaryrefslogtreecommitdiffstats
path: root/com32/sysdump/main.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-06 22:28:01 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-06 22:28:01 -0800
commit6f19ff5ce811655353712647e82f0dee22805108 (patch)
treebc01315a117d9a7c14ff8254c34af77b02acdfc9 /com32/sysdump/main.c
parent22c6d03bba83a3c68971e1927628ede12a3b618c (diff)
downloadsyslinux-6f19ff5ce811655353712647e82f0dee22805108.tar.gz
syslinux-6f19ff5ce811655353712647e82f0dee22805108.tar.xz
syslinux-6f19ff5ce811655353712647e82f0dee22805108.zip
sysdump: add support for dumping DMI tables
Add support for dumping DMI tables; hopefully in a way that is compatible with dmidecode. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/sysdump/main.c')
-rw-r--r--com32/sysdump/main.c84
1 files changed, 1 insertions, 83 deletions
diff --git a/com32/sysdump/main.c b/com32/sysdump/main.c
index decb86d0..ffe3430c 100644
--- a/com32/sysdump/main.c
+++ b/com32/sysdump/main.c
@@ -30,95 +30,13 @@ __noreturn die(const char *msg)
exit(1);
}
-#if 0
-static void get_bytes(void *buf, size_t len, struct file_info *finfo,
- size_t pos)
-{
- pos += (size_t) finfo->pvt; /* Add base */
- memcpy(buf, (void *)pos, len);
-}
-
-int main(int argc, char *argv[])
-{
- uint16_t bios_ports[4];
- const char *prefix;
- char filename[1024];
- int i;
- static struct serial_if sif = {
- .read = serial_read,
- .write = serial_write,
- };
- struct file_info finfo;
- const char ymodem_banner[] = "Now begin Ymodem download...\r\n";
- bool srec = false;
-
- if (argv[1][0] == '-') {
- srec = argv[1][1] == 's';
- argc--;
- argv++;
- }
-
- if (argc < 4)
- die("usage: memdump [-s] port prefix start,len...");
-
- finfo.pvt = (void *)0x400;
- get_bytes(bios_ports, 8, &finfo, 0); /* Get BIOS serial ports */
-
- for (i = 0; i < 4; i++)
- printf("ttyS%i (COM%i) is at %#x\n", i, i + 1, bios_ports[i]);
-
- sif.port = strtoul(argv[1], NULL, 0);
- if (sif.port <= 3) {
- sif.port = bios_ports[sif.port];
- }
-
- if (serial_init(&sif))
- die("failed to initialize serial port");
-
- prefix = argv[2];
-
- if (!srec) {
- puts("Printing prefix...");
- sif.write(&sif, ymodem_banner, sizeof ymodem_banner - 1);
- }
-
- for (i = 3; i < argc; i++) {
- uint32_t start, len;
- char *ep;
-
- start = strtoul(argv[i], &ep, 0);
- if (*ep != ',')
- die("invalid range specification");
- len = strtoul(ep + 1, NULL, 0);
-
- sprintf(filename, "%s%#x-%#x.bin", prefix, start, len);
- finfo.name = filename;
- finfo.size = len;
- finfo.pvt = (void *)start;
-
- printf("Sending %s...\n", filename);
-
- if (srec)
- send_srec(&sif, &finfo, get_bytes);
- else
- send_ymodem(&sif, &finfo, get_bytes);
- }
-
- if (!srec) {
- puts("Sending closing signature...");
- end_ymodem(&sif);
- }
-
- return 0;
-}
-#endif
-
static void dump_all(struct backend *be, const char *argv[], size_t len)
{
cpio_init(be, argv, len);
dump_memory(be);
+ dump_dmi(be);
dump_vesa_tables(be);
cpio_close(be);