this also fixes up a bunch of formatting, adding the type vaddr_t Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
53 lines
1,005 B
C
53 lines
1,005 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
#include <kernel/common.h>
|
|
#include <kernel/buddy.h>
|
|
#include <kernel/mem.h>
|
|
#include <kernel/device.h>
|
|
#include <kernel/requests.h>
|
|
#include <arch/init.h>
|
|
|
|
#include <kernel/page.h>
|
|
|
|
#include <drivers/tty.h>
|
|
#include <drivers/serial.h>
|
|
|
|
#include <drivers/apic.h>
|
|
|
|
#include <lib/stdio.h>
|
|
#include <lib/rbtree.h>
|
|
|
|
#define P_STACK_SIZE 0x8000
|
|
|
|
struct tty *tty_printf = NULL;
|
|
|
|
void kmain()
|
|
{
|
|
/* init tty ASAP */
|
|
requests_init();
|
|
mem_init();
|
|
buddy_init();
|
|
|
|
void *ap_stack = buddy_alloc(P_STACK_SIZE);
|
|
arch_stack_init(ap_stack, P_STACK_SIZE);
|
|
|
|
rbt_slab_init();
|
|
device_layer_init();
|
|
tty_layer_init();
|
|
|
|
dev_t serial_port = arch_serial_init();
|
|
tty_printf = tty_create("ttyS0", serial_port);
|
|
|
|
int rows;
|
|
int cols;
|
|
|
|
tty_get_size(tty_printf, &rows, &cols);
|
|
tty_setlf(tty_printf);
|
|
tty_clear_screen(tty_printf);
|
|
tty_set_cursor_pos(tty_printf, 0, 0);
|
|
|
|
/* start the kernel */
|
|
|
|
page_init();
|
|
kprintf(COL_CYAN_BLACK "Welcome to vbos!\n" COL_RESET);
|
|
yield();
|
|
}
|