aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.c
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-26 21:43:54 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-26 21:43:54 +0100
commit87d1a2597ceedd03a7d4005db1bf82b72b423a18 (patch)
treee53bf20d06016b37fde0067526ed7abd95b848e8 /kernel/main.c
parenteec442be4d2dd0a1630a820ee43220e635450aa7 (diff)
downloadfbos-87d1a2597ceedd03a7d4005db1bf82b72b423a18.tar.gz
fbos-87d1a2597ceedd03a7d4005db1bf82b72b423a18.zip
Show the detected machine model
Originally I was planning to detect the machine model just in case we needed to do workaround for special cases. But since apparently even VisionFive2 brings its own CPU frequency base on DT, this is not even needed. Hence, fetching the model is now a cool message being shown on boot. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index a39ed29..ecb93da 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -18,6 +18,7 @@ struct task_struct tasks[4] = {
// Defined in fbos/init.h.
struct dt_info info = {
+ .model = { '\0' },
.cpu_freq = 0,
.initrd_start = 0,
.initrd_end = 0,
@@ -36,6 +37,13 @@ __noreturn __kernel void start_kernel(void *dtb)
get_dt_info(dtb, &info);
extract_initrd((unsigned char *)info.initrd_start, info.initrd_end - info.initrd_start, tasks);
+ // If we were able to fetch the model, print it now.
+ if (info.model[0] != '\0') {
+ printk("Running on: ");
+ printk(info.model);
+ printk("\n");
+ }
+
// At this point everything has already been handled: setup the interrupt
// vector and enable the timer to start ticking and scheduling the three
// tasks at hand.