kernel: x86_64: add machine init function called by kernel_init
This commit is contained in:
@@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern int machine_init(uintptr_t arg);
|
extern int ml_init(uintptr_t arg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
15
arch/x86_64/init.c
Normal file
15
arch/x86_64/init.c
Normal 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;
|
||||||
|
}
|
||||||
@@ -15,8 +15,7 @@ void bootstrap_cpu_init(void)
|
|||||||
|
|
||||||
void kernel_init(uintptr_t arg)
|
void kernel_init(uintptr_t arg)
|
||||||
{
|
{
|
||||||
bootstrap_cpu_init();
|
ml_init(arg);
|
||||||
console_init();
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
for (int i = 0; i < 8; i++) {
|
||||||
printf("Line %d\n", i);
|
printf("Line %d\n", i);
|
||||||
|
|||||||
Reference in New Issue
Block a user