static void printMemoryInfo(void) { int line; int i; MemoryRange *mp = bootInfo->memoryMap; // Activate and clear page 1 setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition( 0, 0, 1 ); printf("BIOS reported memory ranges:\n"); line = 1; for (i=0; i<bootInfo->memoryMapCount; i++) { printf("Base 0x%08x%08x, ", (unsigned long)(mp->base >> 32), (unsigned long)(mp->base)); printf("length 0x%08x%08x, type %d\n", (unsigned long)(mp->length >> 32), (unsigned long)(mp->length), mp->type); if (line++ > 20) { pause(); line = 0; } mp++; } if (line > 0) { pause(); } setActiveDisplayPage(0); }
void processRAMDiskCommand(char ** argPtr, const char * cmd) { char * ptr = *argPtr; char param[1024]; getNextArg(&ptr, param); if (strcmp(cmd, "m") == 0) { mountRAMDisk(param); sleep(2); } else if (strcmp(cmd, "u") == 0) { umountRAMDisk(); sleep(2); } else if (strcmp(cmd, "e") == 0) { setRAMDiskBTHook(true); sleep(2); } else if (strcmp(cmd, "d") == 0) { setRAMDiskBTHook(false); sleep(2); } else if (strcmp(cmd, "i") == 0) { setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition(0, 0, 1); showInfoRAMDisk(); //Azi: check Chazi on these line breaks here*** printf("\n\nPress any key to continue.\n"); getchar(); setActiveDisplayPage(0); } else { setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition(0, 0, 1); printf("\nusage:\n"); printf("\n?rd i - display ramdisk information"); printf("\n?rd m <filename> - mount ramdisk image\n?rd u - unmount ramdisk image"); printf("\n?rd e - enable bt(0,0) alias\n?rd d - disable bt(0,0) alias"); printf("\n\nPress any key to continue.\n"); getchar(); setActiveDisplayPage(0); } }
void lspci(void) { if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition(0, 0, 1); } dump_pci_dt(root_pci_dev->children); pause(); if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(0); } }
void lspci(void) { if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition(0, 0, 1); } dump_pci_dt(((pci_dt_t *)(uint32_t)get_env(envPCIRootDev))->children); pause(); if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(0); } }
void lspci(void) { if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(1); clearScreenRows(0, 24); setCursorPosition(0, 0, 1); } dump_pci_dt(root_pci_dev->children); printf("(Press a key to continue...)"); getc(); if (bootArgs->Video.v_display == VGA_TEXT_MODE) { setActiveDisplayPage(0); } }
static void showTextBuffer(char *buf, int size) { char *bp; int line; int line_offset; int c; if (bootArgs->Video.v_display == GRAPHICS_MODE) { showInfoBox( "Press q to quit\n",buf ); return; } bp = buf; while (size-- > 0) { if (*bp == '\n') { *bp = '\0'; } bp++; } *bp = '\1'; line_offset = 0; setActiveDisplayPage(1); while (1) { clearScreenRows(0, 24); setCursorPosition(0, 0, 1); bp = buf; for (line = 0; *bp != '\1' && line < line_offset; line++) { while (*bp != '\0') { bp++; } bp++; } for (line = 0; *bp != '\1' && line < 23; line++) { setCursorPosition(0, line, 1); printf("%s\n", bp); while (*bp != '\0') { bp++; } bp++; } setCursorPosition(0, 23, 1); if (*bp == '\1') { printf("[Type %sq or space to quit viewer]", (line_offset > 0) ? "p for previous page, " : ""); } else { printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } c = getc(); if (c == 'q' || c == 'Q') { break; } if ((c == 'p' || c == 'P') && line_offset > 0) { line_offset -= 23; } if (c == ' ') { if (*bp == '\1') { break; } else { line_offset += 23; } } } setActiveDisplayPage(0); }
void showTextBuffer(char *buf_orig, int size) { char *bp; char* buf; int line; int line_offset; int c; if (bootArgs->Video.v_display != VGA_TEXT_MODE) { showInfoBox( "Press q to continue, space for next page.\n",buf_orig ); return; } // Create a copy so that we don't mangle the original buf = malloc(size + 1); memcpy(buf, buf_orig, size); bp = buf; while (size-- > 0) { if (*bp == '\n') { *bp = '\0'; } bp++; } *bp = '\1'; line_offset = 0; setActiveDisplayPage(1); while (1) { clearScreenRows(0, 24); setCursorPosition(0, 0, 1); bp = buf; for (line = 0; *bp != '\1' && line < line_offset; line++) { while (*bp != '\0') { bp++; } bp++; } for (line = 0; *bp != '\1' && line < 23; line++) { setCursorPosition(0, line, 1); printf("%s\n", bp); while (*bp != '\0') { bp++; } bp++; } setCursorPosition(0, 23, 1); if (*bp == '\1') { printf("[Type %sq or space to quit viewer]", (line_offset > 0) ? "p for previous page, " : ""); } else { printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } c = getchar(); if (c == 'q' || c == 'Q') { break; } if ((c == 'p' || c == 'P') && line_offset > 0) { line_offset -= 23; } if (c == ' ') { if (*bp == '\1') { break; } else { line_offset += 23; } } } setActiveDisplayPage(0); }
static void showHelp() { #define BOOT_HELP_PATH "/usr/standalone/i386/BootHelp.txt" int fd; int size; int line; int line_offset; int c; if ( (fd = open(BOOT_HELP_PATH, 0)) >= 0 ) { char * buffer; char * bp; size = file_size(fd); buffer = malloc( size + 1 ); read(fd, buffer, size); close(fd); bp = buffer; while (size > 0) { while (*bp != '\n') { bp++; size--; } *bp++ = '\0'; size--; } *bp = '\1'; line_offset = 0; setActiveDisplayPage(1); while (1) { clearScreenRows(0, 24); setCursorPosition(0, 0, 1); bp = buffer; for (line = 0; *bp != '\1' && line < line_offset; line++) { while (*bp != '\0') bp++; bp++; } for (line = 0; *bp != '\1' && line < 23; line++) { setCursorPosition(0, line, 1); printf("%s\n", bp); while (*bp != '\0') bp++; bp++; } setCursorPosition(0, 23, 1); if (*bp == '\1') { printf("[Type %sq or space to quit help]", (line_offset > 0) ? "p for previous page, " : ""); } else { printf("[Type %s%sq to quit help]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : ""); } c = getc(); if (c == 'q' || c == 'Q') { break; } if ((c == 'p' || c == 'P') && line_offset > 0) { line_offset -= 23; } if (c == ' ') { if (*bp == '\1') { break; } else { line_offset += 23; } } } free(buffer); setActiveDisplayPage(0); } }