{
char buffer[81];
char buffer1[81];
- clear_screen();
+ reset_more_printf();
more_printf("CPU\n");
more_printf("Vendor : %s\n", hardware->cpu.vendor);
more_printf("Model : %s\n", hardware->cpu.model);
char available_dmi_commands[1024];
memset(available_dmi_commands, 0, sizeof(available_dmi_commands));
- more_printf("Available DMI modules on your system:\n");
+ printf("Available DMI modules on your system:\n");
if (hardware->dmi.base_board.filled == true)
- more_printf("\t%s\n", CLI_DMI_BASE_BOARD);
+ printf("\t%s\n", CLI_DMI_BASE_BOARD);
if (hardware->dmi.battery.filled == true)
- more_printf("\t%s\n", CLI_DMI_BATTERY);
+ printf("\t%s\n", CLI_DMI_BATTERY);
if (hardware->dmi.bios.filled == true)
- more_printf("\t%s\n", CLI_DMI_BIOS);
+ printf("\t%s\n", CLI_DMI_BIOS);
if (hardware->dmi.chassis.filled == true)
- more_printf("\t%s\n", CLI_DMI_CHASSIS);
+ printf("\t%s\n", CLI_DMI_CHASSIS);
for (int i = 0; i < hardware->dmi.memory_count; i++) {
if (hardware->dmi.memory[i].filled == true) {
- more_printf("\tbank <number>\n", CLI_DMI_MEMORY);
+ printf("\tbank <number>\n");
break;
}
}
if (hardware->dmi.processor.filled == true)
- more_printf("\t%s\n", CLI_DMI_PROCESSOR);
+ printf("\t%s\n", CLI_DMI_PROCESSOR);
if (hardware->dmi.system.filled == true)
- more_printf("\t%s\n", CLI_DMI_SYSTEM);
+ printf("\t%s\n", CLI_DMI_SYSTEM);
if (hardware->dmi.ipmi.filled == true)
- more_printf("\t%s\n", CLI_DMI_IPMI);
+ printf("\t%s\n", CLI_DMI_IPMI);
}
static void show_dmi_base_board(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.base_board.filled == false) {
- more_printf("base_board information not found on your system, see "
+ printf("base_board information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("Base board\n");
more_printf(" Manufacturer : %s\n",
hardware->dmi.base_board.manufacturer);
struct s_hardware *hardware)
{
if (hardware->dmi.system.filled == false) {
- more_printf("system information not found on your system, see "
+ printf("system information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("System\n");
- more_printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
- more_printf(" Product Name : %s\n", hardware->dmi.system.product_name);
- more_printf(" Version : %s\n", hardware->dmi.system.version);
- more_printf(" Serial : %s\n", hardware->dmi.system.serial);
- more_printf(" UUID : %s\n", hardware->dmi.system.uuid);
- more_printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
- more_printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
- more_printf(" Family : %s\n", hardware->dmi.system.family);
+ printf("System\n");
+ printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer);
+ printf(" Product Name : %s\n", hardware->dmi.system.product_name);
+ printf(" Version : %s\n", hardware->dmi.system.version);
+ printf(" Serial : %s\n", hardware->dmi.system.serial);
+ printf(" UUID : %s\n", hardware->dmi.system.uuid);
+ printf(" Wakeup Type : %s\n", hardware->dmi.system.wakeup_type);
+ printf(" SKU Number : %s\n", hardware->dmi.system.sku_number);
+ printf(" Family : %s\n", hardware->dmi.system.family);
}
static void show_dmi_bios(int argc __unused, char** argv __unused,
struct s_hardware *hardware)
{
if (hardware->dmi.bios.filled == false) {
- more_printf("bios information not found on your system, see "
+ printf("bios information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("BIOS\n");
more_printf(" Vendor : %s\n", hardware->dmi.bios.vendor);
more_printf(" Version : %s\n", hardware->dmi.bios.version);
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("Chassis\n");
- more_printf(" Manufacturer : %s\n",
+ printf("Chassis\n");
+ printf(" Manufacturer : %s\n",
hardware->dmi.chassis.manufacturer);
- more_printf(" Type : %s\n", hardware->dmi.chassis.type);
- more_printf(" Lock : %s\n", hardware->dmi.chassis.lock);
- more_printf(" Version : %s\n",
+ printf(" Type : %s\n", hardware->dmi.chassis.type);
+ printf(" Lock : %s\n", hardware->dmi.chassis.lock);
+ printf(" Version : %s\n",
hardware->dmi.chassis.version);
- more_printf(" Serial : %s\n", hardware->dmi.chassis.serial);
- more_printf(" Asset Tag : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.chassis.serial);
+ printf(" Asset Tag : %s\n",
hardware->dmi.chassis.asset_tag);
- more_printf(" Boot up state : %s\n",
+ printf(" Boot up state : %s\n",
hardware->dmi.chassis.boot_up_state);
- more_printf(" Power supply state : %s\n",
+ printf(" Power supply state : %s\n",
hardware->dmi.chassis.power_supply_state);
- more_printf(" Thermal state : %s\n",
+ printf(" Thermal state : %s\n",
hardware->dmi.chassis.thermal_state);
- more_printf(" Security Status : %s\n",
+ printf(" Security Status : %s\n",
hardware->dmi.chassis.security_status);
- more_printf(" OEM Information : %s\n",
+ printf(" OEM Information : %s\n",
hardware->dmi.chassis.oem_information);
- more_printf(" Height : %u\n", hardware->dmi.chassis.height);
- more_printf(" NB Power Cords : %u\n",
+ printf(" Height : %u\n", hardware->dmi.chassis.height);
+ printf(" NB Power Cords : %u\n",
hardware->dmi.chassis.nb_power_cords);
}
more_printf("IPMI module not available\n");
return;
}
- clear_screen();
- more_printf("IPMI\n");
- more_printf(" Interface Type : %s\n",
+ printf("IPMI\n");
+ printf(" Interface Type : %s\n",
hardware->dmi.ipmi.interface_type);
- more_printf(" Specification Ver. : %u.%u\n",
+ printf(" Specification Ver. : %u.%u\n",
hardware->dmi.ipmi.major_specification_version,
hardware->dmi.ipmi.minor_specification_version);
- more_printf(" I2C Slave Address : 0x%02x\n",
+ printf(" I2C Slave Address : 0x%02x\n",
hardware->dmi.ipmi.I2C_slave_address);
- more_printf(" Nv Storage Address : %u\n",
+ printf(" Nv Storage Address : %u\n",
hardware->dmi.ipmi.nv_address);
uint32_t high = hardware->dmi.ipmi.base_address >> 32;
uint32_t low = hardware->dmi.ipmi.base_address & 0xFFFF;
- more_printf(" Base Address : %08X%08X\n",
+ printf(" Base Address : %08X%08X\n",
high,(low & ~1));
- more_printf(" IRQ : %d\n",
+ printf(" IRQ : %d\n",
hardware->dmi.ipmi.irq);
}
struct s_hardware *hardware)
{
if (hardware->dmi.battery.filled == false) {
- more_printf("battery information not found on your system, see "
+ printf("battery information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
- more_printf("Battery \n");
- more_printf(" Vendor : %s\n",
+ printf("Battery \n");
+ printf(" Vendor : %s\n",
hardware->dmi.battery.manufacturer);
- more_printf(" Manufacture Date : %s\n",
+ printf(" Manufacture Date : %s\n",
hardware->dmi.battery.manufacture_date);
- more_printf(" Serial : %s\n", hardware->dmi.battery.serial);
- more_printf(" Name : %s\n", hardware->dmi.battery.name);
- more_printf(" Chemistry : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.battery.serial);
+ printf(" Name : %s\n", hardware->dmi.battery.name);
+ printf(" Chemistry : %s\n",
hardware->dmi.battery.chemistry);
- more_printf(" Design Capacity : %s\n",
+ printf(" Design Capacity : %s\n",
hardware->dmi.battery.design_capacity);
- more_printf(" Design Voltage : %s\n",
+ printf(" Design Voltage : %s\n",
hardware->dmi.battery.design_voltage);
- more_printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
- more_printf(" SBDS Manuf. Date : %s\n",
+ printf(" SBDS : %s\n", hardware->dmi.battery.sbds);
+ printf(" SBDS Manuf. Date : %s\n",
hardware->dmi.battery.sbds_manufacture_date);
- more_printf(" SBDS Chemistry : %s\n",
+ printf(" SBDS Chemistry : %s\n",
hardware->dmi.battery.sbds_chemistry);
- more_printf(" Maximum Error : %s\n",
+ printf(" Maximum Error : %s\n",
hardware->dmi.battery.maximum_error);
- more_printf(" OEM Info : %s\n",
+ printf(" OEM Info : %s\n",
hardware->dmi.battery.oem_info);
}
struct s_hardware *hardware)
{
if (hardware->dmi.processor.filled == false) {
- more_printf("processor information not found on your system, see "
+ printf("processor information not found on your system, see "
"`show list' to see which module is available.\n");
return;
}
- clear_screen();
+ reset_more_printf();
more_printf("CPU\n");
more_printf(" Socket Designation : %s\n",
hardware->dmi.processor.socket_designation);
static void show_dmi_memory_bank(int argc, char** argv,
struct s_hardware *hardware)
{
- long bank = -1;
+ int bank = -1;
/* Sanitize arguments */
if (argc > 0)
bank = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE || bank < 0) {
- more_printf("This bank number is incorrect\n");
+ printf("This bank number is incorrect\n");
return;
}
if ((bank >= hardware->dmi.memory_count) || (bank < 0)) {
- more_printf("Bank %d number doesn't exists\n", bank);
+ printf("Bank %d number doesn't exists\n", bank);
return;
}
if (hardware->dmi.memory[bank].filled == false) {
- more_printf("Bank %d doesn't contain any information\n", bank);
+ printf("Bank %d doesn't contain any information\n", bank);
return;
}
- more_printf("Memory Bank %d\n", bank);
- more_printf(" Form Factor : %s\n",
+ printf("Memory Bank %d\n", bank);
+ printf(" Form Factor : %s\n",
hardware->dmi.memory[bank].form_factor);
- more_printf(" Type : %s\n", hardware->dmi.memory[bank].type);
- more_printf(" Type Detail : %s\n",
+ printf(" Type : %s\n", hardware->dmi.memory[bank].type);
+ printf(" Type Detail : %s\n",
hardware->dmi.memory[bank].type_detail);
- more_printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
- more_printf(" Size : %s\n", hardware->dmi.memory[bank].size);
- more_printf(" Device Set : %s\n",
+ printf(" Speed : %s\n", hardware->dmi.memory[bank].speed);
+ printf(" Size : %s\n", hardware->dmi.memory[bank].size);
+ printf(" Device Set : %s\n",
hardware->dmi.memory[bank].device_set);
- more_printf(" Device Loc. : %s\n",
+ printf(" Device Loc. : %s\n",
hardware->dmi.memory[bank].device_locator);
- more_printf(" Bank Locator : %s\n",
+ printf(" Bank Locator : %s\n",
hardware->dmi.memory[bank].bank_locator);
- more_printf(" Total Width : %s\n",
+ printf(" Total Width : %s\n",
hardware->dmi.memory[bank].total_width);
- more_printf(" Data Width : %s\n",
+ printf(" Data Width : %s\n",
hardware->dmi.memory[bank].data_width);
- more_printf(" Error : %s\n", hardware->dmi.memory[bank].error);
- more_printf(" Vendor : %s\n",
+ printf(" Error : %s\n", hardware->dmi.memory[bank].error);
+ printf(" Vendor : %s\n",
hardware->dmi.memory[bank].manufacturer);
- more_printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
- more_printf(" Asset Tag : %s\n",
+ printf(" Serial : %s\n", hardware->dmi.memory[bank].serial);
+ printf(" Asset Tag : %s\n",
hardware->dmi.memory[bank].asset_tag);
- more_printf(" Part Number : %s\n",
+ printf(" Part Number : %s\n",
hardware->dmi.memory[bank].part_number);
}
detect_dmi(hardware);
if (hardware->is_dmi_valid == false) {
- more_printf("No valid DMI table found, exiting.\n");
+ printf("No valid DMI table found, exiting.\n");
return;
}
- more_printf("DMI Table version %d.%d found\n",
+ printf("DMI Table version %d.%d found\n",
hardware->dmi.dmitable.major_version,
hardware->dmi.dmitable.minor_version);
{
int i;
- more_printf("Available modes:\n");
+ printf("Available modes:\n");
for (i = 0; i < MAX_MODES; i++)
more_printf("\t%s\n", list_modes[i]->name);
}
cli_mode_t new_mode;
if (argc <= 0) {
- more_printf("Which mode?\n");
+ printf("Which mode?\n");
return;
}
find_cli_mode_descr(hdt_cli.mode, ¤t_mode);
- more_printf("Available commands are:\n");
+ printf("Available commands are:\n");
/* List first default modules of the mode */
if (current_mode->default_modules != NULL ) {
/* List secondly the show modules of the mode */
if (current_mode->show_modules != NULL &&
current_mode->show_modules->nb_modules != 0) {
- more_printf("show commands:\n");
+ printf("show commands:\n");
for (j = 0; j < current_mode->show_modules->nb_modules; j++)
more_printf("\t%s\n",
current_mode->show_modules->modules[j].name);
/* List thirdly the set modules of the mode */
if (current_mode->set_modules != NULL &&
current_mode->set_modules->nb_modules != 0) {
- more_printf("set commands:\n");
+ printf("set commands:\n");
for (j = 0; j < current_mode->set_modules->nb_modules; j++)
more_printf("\t%s\n",
current_mode->set_modules->modules[j].name);
current_mode->default_modules,
&associated_module);
if (associated_module == NULL)
- more_printf("%s ",
+ printf("%s ",
hdt_mode.default_modules->modules[j].name);
}
- more_printf("\n");
+ printf("\n");
}
main_show_modes(argc, argv, hardware);
void main_show_hdt(int argc __unused, char **argv __unused,
struct s_hardware *hardware __unused)
{
- more_printf("HDT\n");
- more_printf(" Product : %s\n", PRODUCT_NAME);
- more_printf(" Version : %s\n", VERSION);
- more_printf(" Author : %s\n", AUTHOR);
- more_printf(" Contact : %s\n", CONTACT);
+ printf("HDT\n");
+ printf(" Product : %s\n", PRODUCT_NAME);
+ printf(" Version : %s\n", VERSION);
+ printf(" Author : %s\n", AUTHOR);
+ printf(" Contact : %s\n", CONTACT);
char *contributors[NB_CONTRIBUTORS] = CONTRIBUTORS;
for (int c = 0; c < NB_CONTRIBUTORS; c++) {
- more_printf(" Contributor : %s\n", contributors[c]);
+ printf(" Contributor : %s\n", contributors[c]);
}
}
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
nopciids = true;
- more_printf(" Missing pci.ids, we can't compute the list\n");
+ printf(" Missing pci.ids, we can't compute the list\n");
return;
}
if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) {
nomodulespcimap = true;
- more_printf
+ printf
(" Missing modules.pcimap, we can't compute the list\n");
return;
}
/* Print the found items */
for (int i = 0; i < MAX_PCI_CLASSES; i++) {
if (strlen(category_name[i]) > 1) {
- more_printf("%s : %s\n", category_name[i], modules[i]);
+ printf("%s : %s\n", category_name[i], modules[i]);
}
}
}
{
int i = 0;
struct pci_device *pci_device = NULL, *temp_pci_device;
- long pcidev = -1;
+ int pcidev = -1;
bool nopciids = false;
bool nomodulespcimap = false;
char kernel_modules[LINUX_KERNEL_MODULE_SIZE *
/* Sanitize arguments */
if (argc <= 0) {
- more_printf("show device <number>\n");
+ printf("show device <number>\n");
return;
} else
pcidev = strtol(argv[0], (char **)NULL, 10);
if (errno == ERANGE) {
- more_printf("This PCI device number is incorrect\n");
+ printf("This PCI device number is incorrect\n");
return;
}
if ((pcidev > hardware->nb_pci_devices) || (pcidev <= 0)) {
- more_printf("PCI device %d doesn't exists\n", pcidev);
+ printf("PCI device %d doesn't exists\n", pcidev);
return;
}
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
}
if (pci_device == NULL) {
- more_printf("We were enabled to find PCI device %d\n", pcidev);
+ printf("We were enabled to find PCI device %d\n", pcidev);
return;
}
if (pci_device->dev_info->linux_kernel_module_count == 0)
strlcpy(kernel_modules, "unknown", 7);
- clear_screen();
- more_printf("PCI Device %d\n", pcidev);
+ printf("PCI Device %d\n", pcidev);
if (nopciids == false) {
- more_printf("Vendor Name : %s\n",
+ printf("Vendor Name : %s\n",
pci_device->dev_info->vendor_name);
- more_printf("Product Name : %s\n",
+ printf("Product Name : %s\n",
pci_device->dev_info->product_name);
- more_printf("Class Name : %s\n",
+ printf("Class Name : %s\n",
pci_device->dev_info->class_name);
}
if (nomodulespcimap == false) {
- more_printf("Kernel module : %s\n", kernel_modules);
+ printf("Kernel module : %s\n", kernel_modules);
}
- more_printf("Vendor ID : %04x\n", pci_device->vendor);
- more_printf("Product ID : %04x\n", pci_device->product);
- more_printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
- more_printf("SubProduct ID : %04x\n", pci_device->sub_product);
- more_printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
+ printf("Vendor ID : %04x\n", pci_device->vendor);
+ printf("Product ID : %04x\n", pci_device->product);
+ printf("SubVendor ID : %04x\n", pci_device->sub_vendor);
+ printf("SubProduct ID : %04x\n", pci_device->sub_product);
+ printf("Class ID : %02x.%02x.%02x\n", pci_device->class[2],
pci_device->class[1], pci_device->class[0]);
- more_printf("Revision : %02x\n", pci_device->revision);
+ printf("Revision : %02x\n", pci_device->revision);
if ((pci_device->dev_info->irq > 0)
&& (pci_device->dev_info->irq < 255))
more_printf("IRQ : %0d\n", pci_device->dev_info->irq);
- more_printf("Latency : %0d\n", pci_device->dev_info->latency);
- more_printf("PCI Bus : %02d\n", bus);
- more_printf("PCI Slot : %02d\n", slot);
- more_printf("PCI Func : %02d\n", func);
+ printf("Latency : %0d\n", pci_device->dev_info->latency);
+ printf("PCI Bus : %02d\n", bus);
+ printf("PCI Slot : %02d\n", slot);
+ printf("PCI Func : %02d\n", func);
if (hardware->is_pxe_valid == true) {
- more_printf("Mac Address : %s\n", hardware->pxe.mac_addr);
+ printf("Mac Address : %s\n", hardware->pxe.mac_addr);
if ((hardware->pxe.pci_device != NULL)
&& (hardware->pxe.pci_device == pci_device))
- more_printf("PXE : Current boot device\n",
- func);
+ printf("PXE : Current boot device\n");
}
}
char first_line[81];
char second_line[81];
- clear_screen();
+ reset_more_printf();
more_printf("%d PCI devices detected\n", hardware->nb_pci_devices);
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
("%02d: %04x:%04x [%04x:%04x] Kmod:%s\n", i,
pci_device->vendor, pci_device->product,
pci_device->sub_vendor,
- pci_device->sub_product, kernel_modules,
pci_device->sub_product, kernel_modules);
}
}
struct pci_device *pci_device;
bool nopciids = false;
- clear_screen();
+ reset_more_printf();
more_printf("%d PCI devices detected\n", hardware->nb_pci_devices);
more_printf("IRQ : product\n");
more_printf("-------------\n");
if (hardware->pci_detection == false) {
detect_pci(hardware);
if (hardware->pci_ids_return_code == -ENOPCIIDS) {
- more_printf
+ printf
("The pci.ids file is missing, device names can't be computed.\n");
- more_printf("Please put one in same dir as hdt\n");
+ printf("Please put one in same dir as hdt\n");
error = true;
}
if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) {
- more_printf
+ printf
("The modules.pcimap file is missing, device names can't be computed.\n");
- more_printf("Please put one in same dir as hdt\n");
+ printf("Please put one in same dir as hdt\n");
error = true;
}
if (error == true) {
char tempbuf[10];
- more_printf("Press enter to continue\n");
+ printf("Press enter to continue\n");
fgets(tempbuf, sizeof(tempbuf), stdin);
}
}
char buffer[81];
memset(buffer, 0, sizeof(81));
if (hardware->sv->filesystem != SYSLINUX_FS_PXELINUX) {
- more_printf("You are not currently using PXELINUX\n");
+ printf("You are not currently using PXELINUX\n");
return;
}
detect_pxe(hardware);
- more_printf("PXE\n");
+ printf("PXE\n");
if (hardware->is_pxe_valid == false) {
- more_printf(" No valid PXE ROM found\n");
+ printf(" No valid PXE ROM found\n");
return;
}
struct s_pxe *p = &hardware->pxe;
- more_printf(" PCI device no: %d \n", p->pci_device_pos);
+ printf(" PCI device no: %d \n", p->pci_device_pos);
if (hardware->pci_ids_return_code == -ENOPCIIDS ||
(p->pci_device == NULL)) {
snprintf(buffer, sizeof(buffer),
" PCI Bus pos. : %02x:%02x.%02x\n", p->pci_bus,
p->pci_dev, p->pci_func);
- more_printf(buffer);
+ printf(buffer);
} else {
snprintf(buffer, sizeof(buffer), " Manufacturer : %s \n",
p->pci_device->dev_info->vendor_name);
- more_printf(buffer);
+ printf(buffer);
snprintf(buffer, sizeof(buffer), " Product : %s \n",
p->pci_device->dev_info->product_name);
- more_printf(buffer);
+ printf(buffer);
}
- more_printf(" Addresses : %d.%d.%d.%d @ %s\n", p->ip_addr[0],
+ printf(" Addresses : %d.%d.%d.%d @ %s\n", p->ip_addr[0],
p->ip_addr[1], p->ip_addr[2], p->ip_addr[3], p->mac_addr);
}
void main_show_syslinux(int argc __unused, char **argv __unused,
struct s_hardware *hardware)
{
- more_printf("SYSLINUX\n");
- more_printf(" Bootloader : %s\n", hardware->syslinux_fs);
- more_printf(" Version : %s\n", hardware->sv->version_string + 2);
- more_printf(" Version : %u\n", hardware->sv->version);
- more_printf(" Max API : %u\n", hardware->sv->max_api);
- more_printf(" Copyright : %s\n", hardware->sv->copyright_string + 1);
+ printf("SYSLINUX\n");
+ printf(" Bootloader : %s\n", hardware->syslinux_fs);
+ printf(" Version : %s\n", hardware->sv->version_string + 2);
+ printf(" Version : %u\n", hardware->sv->version);
+ printf(" Max API : %u\n", hardware->sv->max_api);
+ printf(" Copyright : %s\n", hardware->sv->copyright_string + 1);
}
struct cli_module_descr syslinux_show_modules = {
{
detect_vesa(hardware);
if (hardware->is_vesa_valid == false) {
- more_printf("No VESA BIOS detected\n");
+ printf("No VESA BIOS detected\n");
return;
}
- more_printf("VESA\n");
- more_printf(" Vesa version : %d.%d\n", hardware->vesa.major_version,
+ printf("VESA\n");
+ printf(" Vesa version : %d.%d\n", hardware->vesa.major_version,
hardware->vesa.minor_version);
- more_printf(" Vendor : %s\n", hardware->vesa.vendor);
- more_printf(" Product : %s\n", hardware->vesa.product);
- more_printf(" Product rev. : %s\n", hardware->vesa.product_revision);
- more_printf(" Software rev.: %s\n", hardware->vesa.software_rev);
- more_printf(" Memory (KB) : %d\n", hardware->vesa.total_memory * 64);
- more_printf(" Modes : %d\n", hardware->vesa.vmi_count);
+ printf(" Vendor : %s\n", hardware->vesa.vendor);
+ printf(" Product : %s\n", hardware->vesa.product);
+ printf(" Product rev. : %s\n", hardware->vesa.product_revision);
+ printf(" Software rev.: %d\n", hardware->vesa.software_rev);
+ printf(" Memory (KB) : %d\n", hardware->vesa.total_memory * 64);
+ printf(" Modes : %d\n", hardware->vesa.vmi_count);
}
static void show_vesa_modes(int argc __unused, char **argv __unused,
{
detect_vesa(hardware);
if (hardware->is_vesa_valid == false) {
- more_printf("No VESA BIOS detected\n");
+ printf("No VESA BIOS detected\n");
return;
}
- clear_screen();
- more_printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n",
- hardware->vesa.vmi_count);
- more_printf("----------------------------------------\n",
- hardware->vesa.vmi_count);
+ reset_more_printf();
+ printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n");
+ printf("----------------------------------------\n");
for (int i = 0; i < hardware->vesa.vmi_count; i++) {
struct vesa_mode_info *mi = &hardware->vesa.vmi[i].mi;
* We don't need to display that ones.
*/
if ((mi->h_res == 0) || (mi->v_res == 0)) continue;
- more_printf("%5u %5u %3u %3d 0x%04x\n",
+ printf("%5u %5u %3u %3d 0x%04x\n",
mi->h_res, mi->v_res, mi->bpp,
hardware->vesa.vmi[i].mode + 0x200,
hardware->vesa.vmi[i].mode);
break;
case PXE_MODE:
if (hardware->sv->filesystem != SYSLINUX_FS_PXELINUX) {
- more_printf("You are not currently using PXELINUX\n");
+ printf("You are not currently using PXELINUX\n");
break;
}
hdt_cli.mode = mode;
case DMI_MODE:
detect_dmi(hardware);
if (!hardware->is_dmi_valid) {
- more_printf("No valid DMI table found, exiting.\n");
+ printf("No valid DMI table found, exiting.\n");
break;
}
hdt_cli.mode = mode;
break;
default:
/* Invalid mode */
- more_printf("Unknown mode, please choose among:\n");
+ printf("Unknown mode, please choose among:\n");
for (i = 0; i < MAX_MODES; i++)
- more_printf("\t%s\n", list_modes[i]->name);
+ printf("\t%s\n", list_modes[i]->name);
}
find_cli_mode_descr(hdt_cli.mode, ¤t_mode);
/* There is not cli_mode_descr struct for the exit mode */
if (current_mode == NULL && hdt_cli.mode != EXIT_MODE) {
/* Shouldn't get here... */
- more_printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
+ printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
}
}
/* First take care of the two special commands: 'show' and 'set' */
if (strncmp(CLI_SHOW, command, strlen(command)) == 0) {
- more_printf("%s\n", CLI_SHOW);
+ printf("%s\n", CLI_SHOW);
autocomplete_add_token_to_list(CLI_SHOW);
}
if (strncmp(CLI_SET, command, strlen(command)) == 0) {
- more_printf("%s\n", CLI_SET);
+ printf("%s\n", CLI_SET);
autocomplete_add_token_to_list(CLI_SET);
}
*/
for (j = 0; j < MAX_MODES; j++) {
if (strncmp(list_modes[j]->name, command, strlen(command)) == 0) {
- more_printf("%s\n", list_modes[j]->name);
+ printf("%s\n", list_modes[j]->name);
autocomplete_add_token_to_list(list_modes[j]->name);
}
}
if (strncmp(current_mode->default_modules->modules[j].name,
command,
strlen(command)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->default_modules->modules[j].name);
autocomplete_add_token_to_list(current_mode->default_modules->modules[j].name);
}
strncmp(command,
hdt_mode.default_modules->modules[j].name,
strlen(command)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
hdt_mode.default_modules->modules[j].name);
autocomplete_add_token_to_list(hdt_mode.default_modules->modules[j].name);
}
if (strncmp(current_mode->show_modules->modules[j].name,
module,
strlen(module)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->show_modules->modules[j].name);
sprintf(autocomplete_full_line, "%s %s",
CLI_SHOW, current_mode->show_modules->modules[j].name);
if (strncmp(current_mode->set_modules->modules[j].name,
module,
strlen(module)) == 0) {
- more_printf("%s\n",
+ printf("%s\n",
current_mode->set_modules->modules[j].name);
sprintf(autocomplete_full_line, "%s %s",
CLI_SET, current_mode->set_modules->modules[j].name);
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown command: '%s'\n", command);
+ printf("unknown command: '%s'\n", command);
return;
}
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown module: '%s'\n", module);
+ printf("unknown module: '%s'\n", module);
return;
} else if (!strncmp(command, CLI_SET, sizeof(CLI_SET) - 1)) {
return current_module->exec(argc, argv, hardware);
}
- more_printf("unknown module: '%s'\n", module);
+ printf("unknown module: '%s'\n", module);
return;
}
- more_printf("I don't understand: '%s'. Try 'help'.\n", line);
+ printf("I don't understand: '%s'. Try 'help'.\n", line);
/* Let's not forget to clean ourselves */
free(command);
{
/* No need to display the prompt if we exit */
if (hdt_cli.mode != EXIT_MODE) {
- more_printf("%s", hdt_cli.prompt);
+ printf("%s", hdt_cli.prompt);
/* Reset the line */
memset(hdt_cli.input, '\0', MAX_LINE_SIZE);
hdt_cli.cursor_pos = 0;
find_cli_mode_descr(hdt_cli.mode, ¤t_mode);
if (current_mode == NULL) {
/* Shouldn't get here... */
- more_printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
+ printf("!!! BUG: Mode '%d' unknown.\n", hdt_cli.mode);
return;
}
- more_printf("Entering CLI mode\n");
+ printf("Entering CLI mode\n");
/* Display the cursor */
display_cursor(true);
break;
case KEY_CTRL('c'):
- more_printf("\n");
+ printf("\n");
reset_prompt();
break;
if (autocomplete_last_seen == NULL)
autocomplete_last_seen = autocomplete_head;
} else {
- more_printf("\n");
+ printf("\n");
autocomplete(skip_spaces(hdt_cli.input));
autocomplete_last_seen = autocomplete_head;
- more_printf("%s%s", hdt_cli.prompt, hdt_cli.input);
+ printf("%s%s", hdt_cli.prompt, hdt_cli.input);
}
break;
case KEY_ENTER:
- more_printf("\n");
+ printf("\n");
if (strlen(remove_spaces(hdt_cli.input)) < 1) {
reset_prompt();
break;
break;
case KEY_F1:
- more_printf("\n");
+ printf("\n");
exec_command(CLI_HELP, hardware);
reset_prompt();
break;
set_us_g0_charset();
display_cursor(false);
clear_entire_screen();
- display_line_nb = 0;
+ reset_more_printf();
}
/* remove begining spaces */