44 lines
901 B
C
44 lines
901 B
C
#include <stdint.h>
|
|
#include <socks/init.h>
|
|
#include <socks/panic.h>
|
|
#include <socks/test.h>
|
|
#include <socks/printk.h>
|
|
#include <socks/kext.h>
|
|
#include <socks/object.h>
|
|
#include <socks/sched.h>
|
|
#include <socks/machine/init.h>
|
|
#include <socks/cpu.h>
|
|
|
|
extern unsigned long get_rflags(void);
|
|
|
|
extern char __pstart[], __pend[];
|
|
|
|
void print_kernel_banner(void)
|
|
{
|
|
printk("Socks kernel version " BUILD_ID);
|
|
}
|
|
|
|
void kernel_init(uintptr_t arg)
|
|
{
|
|
ml_init(arg);
|
|
|
|
kern_status_t status;
|
|
status = scan_internal_kexts();
|
|
if (status != KERN_OK) {
|
|
panic("scan_internal_kexts() failed with code %s", kern_status_string(status));
|
|
}
|
|
|
|
status = bring_internal_kexts_online();
|
|
if (status != KERN_OK) {
|
|
panic("bring_internal_kexts_online() failed with code %s", kern_status_string(status));
|
|
}
|
|
|
|
printk("kernel_init() running on processor %u", this_cpu());
|
|
|
|
run_all_tests();
|
|
|
|
while (1) {
|
|
ml_cpu_pause();
|
|
}
|
|
}
|