1 /* ----------------------------------------------------------------------- *
3 * Copyright 2006 Erwan Velu - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 #define DMI_BUFFER_SIZE 16
17 #define MAX_DMI_MEMORY_ITEMS 32
18 #define MAX_DMI_CACHE_ITEMS 32
19 #define OEM_STRINGS_SIZE 512
20 #define HARDWARE_SECURITY_SIZE 16
22 #define PAGE_SIZE 4096
24 extern const char *out_of_spec
;
25 extern const char *bad_index
;
27 #define WORD(x) (uint16_t)(*(const uint16_t *)(x))
28 #define DWORD(x) (uint32_t)(*(const uint32_t *)(x))
29 #define QWORD(x) (*(const uint64_t *)(x))
31 enum { DMI_TABLE_PRESENT
= 100, ENODMITABLE
};
34 #include "dmi_system.h"
35 #include "dmi_base_board.h"
36 #include "dmi_chassis.h"
37 #include "dmi_processor.h"
38 #include "dmi_memory.h"
39 #include "dmi_battery.h"
41 #include "dmi_cache.h"
43 extern char display_line
;
44 #define moreprintf(...) do { display_line++; if (display_line == 24) { char tempbuf[10]; display_line=0; printf("Press enter to continue"); fgets(tempbuf, sizeof tempbuf, stdin);} printf ( __VA_ARGS__); } while (0);
51 uint16_t major_version
;
52 uint16_t minor_version
;
65 s_base_board base_board
;
67 s_processor processor
;
69 s_memory_module memory_module
[MAX_DMI_MEMORY_ITEMS
];
70 s_memory memory
[MAX_DMI_MEMORY_ITEMS
];
72 s_cache cache
[MAX_DMI_CACHE_ITEMS
];
73 int memory_module_count
;
77 char oem_strings
[OEM_STRINGS_SIZE
];
79 char power_on_passwd_status
[HARDWARE_SECURITY_SIZE
];
80 char keyboard_passwd_status
[HARDWARE_SECURITY_SIZE
];
81 char administrator_passwd_status
[HARDWARE_SECURITY_SIZE
];
82 char front_panel_reset_status
[HARDWARE_SECURITY_SIZE
];
87 void to_dmi_header(struct dmi_header
*h
, uint8_t * data
);
88 void dmi_bios_runtime_size(uint32_t code
, s_dmi
* dmi
);
89 const char *dmi_string(struct dmi_header
*dm
, uint8_t s
);
90 int dmi_checksum(uint8_t * buf
, int len
);
91 void parse_dmitable(s_dmi
* dmi
);
92 void dmi_decode(struct dmi_header
*h
, uint16_t ver
, s_dmi
* dmi
);
93 int dmi_iterate(s_dmi
* dmi
);
96 void display_bios_characteristics(s_dmi
* dmi
);
97 void display_base_board_features(s_dmi
* dmi
);
98 void display_processor_flags(s_dmi
* dmi
);