build: add a "user" arch to allow the kernel to run as a program on the host machine
This commit is contained in:
27
arch/user/stdcon.c
Normal file
27
arch/user/stdcon.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <socks/libc/string.h>
|
||||
#include <socks/libc/ctype.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <socks/console.h>
|
||||
#include <socks/vm.h>
|
||||
#include <socks/printk.h>
|
||||
|
||||
static void stdcon_write(console_t *con, const char *s, unsigned int len)
|
||||
{
|
||||
for (unsigned int i = 0; i < len; i++) {
|
||||
fputc(s[i], stdout);
|
||||
}
|
||||
}
|
||||
|
||||
static console_t stdcon = {
|
||||
.c_name = "stdcon",
|
||||
.c_flags = CON_BOOT,
|
||||
.c_write = stdcon_write,
|
||||
.c_lock = SPIN_LOCK_INIT,
|
||||
};
|
||||
|
||||
void stdcon_init(void)
|
||||
{
|
||||
console_register(&stdcon);
|
||||
early_printk_init(&stdcon);
|
||||
}
|
||||
Reference in New Issue
Block a user