Skip to content

Commit

Permalink
setup, kernel: print CPU vendor string during boot
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Mazein <[email protected]>
  • Loading branch information
MegaMaddin committed Oct 20, 2020
1 parent 406915d commit 1eb46b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <apic.h>
#include <cmdline.h>
#include <console.h>
#include <cpuid.h>
#include <ktf.h>
#include <lib.h>
#include <multiboot.h>
Expand All @@ -52,6 +53,7 @@ bool_cmd("debug", opt_debug);
io_port_t com_ports[2];

const char *kernel_cmdline;
char cpu_identifier[49];

static __text_init int parse_bool(const char *s) {
if (!strcmp("no", s) || !strcmp("off", s) || !strcmp("false", s) ||
Expand Down Expand Up @@ -164,6 +166,10 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,

init_boot_traps();

/* Print cpu vendor info */
if (cpu_vendor_string(&cpu_identifier[0]))
printk("CPU: %.48s\n", cpu_identifier);

/* Initialize Programmable Interrupt Controller */
init_pic();

Expand Down
1 change: 1 addition & 0 deletions include/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
extern io_port_t com_ports[2];

extern const char *kernel_cmdline;
extern char cpu_identifier[49];

static inline void get_com_ports(void) {
memcpy((void *) com_ports, (void *) (BDA_COM_PORTS_ENTRY), sizeof(com_ports));
Expand Down

0 comments on commit 1eb46b8

Please sign in to comment.