kernel: x86_64: add machine init function called by kernel_init

This commit is contained in:
2023-02-03 20:24:27 +00:00
parent dba6269fcb
commit c65f034e0e
3 changed files with 17 additions and 3 deletions

View File

@@ -3,6 +3,6 @@
#include <stdint.h>
extern int machine_init(uintptr_t arg);
extern int ml_init(uintptr_t arg);
#endif

15
arch/x86_64/init.c Normal file
View File

@@ -0,0 +1,15 @@
#include <socks/machine/cpu.h>
static ml_cpu_block g_bootstrap_cpu = {0};
static void bootstrap_cpu_init(void)
{
ml_cpu_block_init(&g_bootstrap_cpu);
ml_cpu_block_use(&g_bootstrap_cpu);
}
int ml_init(uintptr_t arg)
{
bootstrap_cpu_init();
return 0;
}

View File

@@ -15,8 +15,7 @@ void bootstrap_cpu_init(void)
void kernel_init(uintptr_t arg)
{
bootstrap_cpu_init();
console_init();
ml_init(arg);
for (int i = 0; i < 8; i++) {
printf("Line %d\n", i);