summaryrefslogtreecommitdiff
path: root/com32/hdt/hdt-menu.h
blob: 9c61459521ff6f3de1d42758c502e09bfe34aed3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2009 Erwan Velu - All Rights Reserved
 *
 *   Permission is hereby granted, free of charge, to any person
 *   obtaining a copy of this software and associated documentation
 *   files (the "Software"), to deal in the Software without
 *   restriction, including without limitation the rights to use,
 *   copy, modify, merge, publish, distribute, sublicense, and/or
 *   sell copies of the Software, and to permit persons to whom
 *   the Software is furnished to do so, subject to the following
 *   conditions:
 *
 *   The above copyright notice and this permission notice shall
 *   be included in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *   OTHER DEALINGS IN THE SOFTWARE.
 *
 * -----------------------------------------------------------------------
*/

#ifndef DEFINE_HDT_MENU_H
#define DEFINE_HDT_MENU_H
#include <stdio.h>
#include "menu.h"
#include "help.h"
//#include "cpuid.h"
#include "sys/pci.h"
#include "hdt-common.h"
#include "dmi/dmi.h"
#include "hdt-ata.h"

#define EDITPROMPT 21

#define SUBMENULEN 46

#define SUBMENU_Y 3
#define SUBMENU_X 29

#define MAX_PCI_SUB_MENU 128
#define MAX_MEMORY_SUB_MENU 32
#define MAX_DISK_SUB_MENU 32

struct s_my_menu {
 unsigned char menu;
 int items_count;
};

struct s_hdt_menu {
	struct s_my_menu main_menu;
	struct s_my_menu cpu_menu;
	struct s_my_menu mobo_menu;
	struct s_my_menu chassis_menu;
	struct s_my_menu bios_menu;
	struct s_my_menu system_menu;
	struct s_my_menu pci_menu;
	struct s_my_menu pci_sub_menu[MAX_PCI_SUB_MENU];
	struct s_my_menu kernel_menu;
	struct s_my_menu memory_menu;
	struct s_my_menu memory_sub_menu[MAX_MEMORY_SUB_MENU];
	struct s_my_menu disk_menu;
	struct s_my_menu disk_sub_menu[MAX_DISK_SUB_MENU];
	struct s_my_menu battery_menu;
	struct s_my_menu syslinux_menu;
	struct s_my_menu about_menu;
	int total_menu_count; // sum of all menus we have
};

TIMEOUTCODE ontimeout();
void keys_handler(t_menusystem *ms, t_menuitem *mi,unsigned int scancode);

// PCI Stuff
void compute_pci_device(struct s_my_menu *menu,struct pci_device *pci_device,int pci_bus, int pci_slot, int pci_func);
int compute_PCI(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware);

// KERNEL Stuff
void compute_kernel(struct s_my_menu *menu,struct s_hardware *hardware);

// Disk Stuff
int compute_disk_module(struct s_my_menu *menu, int nb_sub_disk_menu, struct diskinfo *d,int disk_number);
void compute_disks(struct s_hdt_menu *menu, struct diskinfo *disk_info);

// DMI Stuff
void compute_motherboard(struct s_my_menu *menu,s_dmi *dmi);
void compute_battery(struct s_my_menu *menu, s_dmi *dmi);
void compute_system(struct s_my_menu *menu,s_dmi *dmi);
void compute_chassis(struct s_my_menu *menu,s_dmi *dmi);
void compute_bios(struct s_my_menu *menu,s_dmi *dmi);
void compute_memory(struct s_hdt_menu *menu, s_dmi *dmi);
void compute_memory_module(struct s_my_menu *menu, s_dmi *dmi, int slot_number);

// Processor Stuff
void compute_processor(struct s_my_menu *menu,struct s_hardware *hardware);

// Syslinux stuff
void compute_syslinuxmenu(struct s_my_menu *menu);

// About menu
void compute_aboutmenu(struct s_my_menu *menu);

int start_menu_mode(struct s_hardware *hardware, char *version_string);
void setup_menu(char *version);
void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware);
void compute_submenus(struct s_hdt_menu *hdt_menu,struct s_hardware *hardware);
void detect_hardware(struct s_hardware *hardware);
#endif