<commit_before>#include <stdint.h>
#include "common.h"
#include "multiboot.h"
#include "version.h"
#include "init.h"
#include "log.h"
#include "console.h"
#include "panic.h"
#include "pit.h"
#include "task.h"
#include "erasure_tool.h"

multiboot_info_t *multiboot_info;

extern initcall_t initcall_start, initcall_end;

void kmain(uint32_t magic, multiboot_info_t *mbd) {
    multiboot_info = mbd;

    console_clear();

    logf("starting K-OS (v" XSTR(MAJOR) "." XSTR(MINOR) "." XSTR(PATCH) ")");
    if (magic != MULTIBOOT_BOOTLOADER_MAGIC)    panic("Kernel Boot Failure - multiboot loader did not pass correct magic number");
    if (!(mbd->flags & MULTIBOOT_INFO_MEM_MAP)) panic("Kernel Boot Failure - multiboot loader did not pass memory map");

    logf("running initcalls");
    for(initcall_t *initcall = &initcall_start; initcall < &initcall_end; initcall++) {
        if((*initcall)()) panic("Kernel Boot Failure - initcall aborted with non-zero exit code");
    }

    logf("entering usermode");
    erasure_tool_run();

    panic("kmain returned!");
}<commit_msg>Switched back to task development<commit_after>#include <stdint.h>
#include "common.h"
#include "multiboot.h"
#include "version.h"
#include "init.h"
#include "log.h"
#include "console.h"
#include "panic.h"
#include "task.h"

multiboot_info_t *multiboot_info;

extern initcall_t initcall_start, initcall_end;

void kmain(uint32_t magic, multiboot_info_t *mbd) {
    multiboot_info = mbd;

    console_clear();

    logf("starting K-OS (v" XSTR(MAJOR) "." XSTR(MINOR) "." XSTR(PATCH) ")");
    if (magic != MULTIBOOT_BOOTLOADER_MAGIC)    panic("Kernel Boot Failure - multiboot loader did not pass correct magic number");
    if (!(mbd->flags & MULTIBOOT_INFO_MEM_MAP)) panic("Kernel Boot Failure - multiboot loader did not pass memory map");

    logf("running initcalls");
    for(initcall_t *initcall = &initcall_start; initcall < &initcall_end; initcall++) {
        if((*initcall)()) panic("Kernel Boot Failure - initcall aborted with non-zero exit code");
    }

    logf("entering usermode");
    task_switch();

    panic("kmain returned!");
}
{'fraction_non_alphanumeric': 0.14124293785310735, 'fraction_numerical': 0.0018832391713747645, 'mean_word_length': 4.666666666666667, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1294162', 'n_tokens_mistral': 778, 'n_tokens_neox': 752, 'n_words': 184}