• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------- *
2  *
3  *   Copyright 2006 Erwan Velu - All Rights Reserved
4  *
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.
10  *
11  * ----------------------------------------------------------------------- */
12 
13 #ifndef DMI_BIOS_H
14 #define DMI_BIOS_H
15 
16 #include "stdbool.h"
17 #define BIOS_VENDOR_SIZE		65
18 #define BIOS_VERSION_SIZE		65
19 #define BIOS_RELEASE_SIZE		65
20 #define BIOS_RUNTIME_SIZE_UNIT_SIZE	16
21 #define BIOS_ROM_UNIT_SIZE		16
22 #define BIOS_BIOS_REVISION_SIZE		16
23 #define BIOS_FIRMWARE_REVISION_SIZE	16
24 
25 #define BIOS_CHAR_NB_ELEMENTS		29
26 #define BIOS_CHAR_X1_NB_ELEMENTS	8
27 #define BIOS_CHAR_X2_NB_ELEMENTS	3
28 
29 extern const char *bios_charac_strings[];
30 
31 /* this struct has BIOS_CHAR_NB_ELEMENTS */
32 /* each bool is associated with the relevant message above */
33 typedef struct {
34     bool bios_characteristics_not_supported;
35     bool isa;
36     bool mca;
37     bool eisa;
38     bool pci;
39     bool pc_card;
40     bool pnp;
41     bool apm;
42     bool bios_upgreadable;
43     bool bios_shadowing;
44     bool vlb;
45     bool escd;
46     bool boot_from_cd;
47     bool selectable_boot;
48     bool bios_rom_socketed;
49     bool boot_from_pcmcia;
50     bool edd;
51     bool japanese_floppy_nec_9800_1_2MB;
52     bool japanese_floppy_toshiba_1_2MB;
53     bool floppy_5_25_360KB;
54     bool floppy_5_25_1_2MB;
55     bool floppy_3_5_720KB;
56     bool floppy_3_5_2_88MB;
57     bool print_screen;
58     bool keyboard_8042_support;
59     bool serial_support;
60     bool printer_support;
61     bool cga_mono_support;
62     bool nec_pc_98;
63 } __attribute__ ((__packed__)) s_characteristics;
64 
65 extern const char *bios_charac_x1_strings[];
66 
67 /* this struct has BIOS_CHAR_X1_NB_ELEMENTS */
68 /* each bool is associated with the relevant message above */
69 typedef struct {
70     bool acpi;
71     bool usb_legacy;
72     bool agp;
73     bool i2o_boot;
74     bool ls_120_boot;
75     bool zip_drive_boot;
76     bool ieee_1394_boot;
77     bool smart_battery;
78 } __attribute__ ((__packed__)) s_characteristics_x1;
79 
80 extern const char *bios_charac_x2_strings[];
81 
82 /* this struct has BIOS_CHAR_X2_NB_ELEMENTS */
83 /* each bool is associated with the relevant message above */
84 typedef struct {
85     bool bios_boot_specification;
86     bool bios_network_boot_by_keypress;
87     bool target_content_distribution;
88 } __attribute__ ((__packed__)) s_characteristics_x2;
89 
90 typedef struct {
91     char vendor[BIOS_VENDOR_SIZE];
92     char version[BIOS_VERSION_SIZE];
93     char release_date[BIOS_RELEASE_SIZE];
94     uint16_t address;
95     uint16_t runtime_size;
96     char runtime_size_unit[BIOS_RUNTIME_SIZE_UNIT_SIZE];
97     uint16_t rom_size;
98     char rom_size_unit[BIOS_ROM_UNIT_SIZE];
99     s_characteristics characteristics;
100     s_characteristics_x1 characteristics_x1;
101     s_characteristics_x2 characteristics_x2;
102     char bios_revision[BIOS_BIOS_REVISION_SIZE];
103     char firmware_revision[BIOS_FIRMWARE_REVISION_SIZE];
104 /* The filled field have to be set to true when the dmitable implement that item */
105     bool filled;
106 } s_bios;
107 
108 #endif
109