proc: add basic proc loading
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
f9ddb8f379
commit
6b40cca5b0
10 changed files with 187 additions and 44 deletions
|
|
@ -5,13 +5,11 @@
|
|||
#include <drivers/serial.h>
|
||||
#include <kernel/tty.h>
|
||||
|
||||
static mem_cache_t *tty_slab;
|
||||
|
||||
static struct tty_serial_ops arch_serial_ops = {.serial_getchar = arch_serial_read, .serial_putchar = arch_serial_write};
|
||||
|
||||
struct tty *tty_create(const char *name, void *priv)
|
||||
{
|
||||
struct tty *tty = slab_alloc(tty_slab);
|
||||
struct tty *tty = kzalloc(sizeof(struct tty), ALLOC_KERN);
|
||||
|
||||
dev_t tty_device = device_create(tty, DEV_CLASS_TTY, name);
|
||||
|
||||
|
|
@ -38,12 +36,3 @@ void tty_write(struct tty *tty, const char *s)
|
|||
while ((c = *s++))
|
||||
tty_putchar(tty, c);
|
||||
}
|
||||
|
||||
void tty_layer_init()
|
||||
{
|
||||
tty_slab = slab_create("tty_layer", sizeof(struct tty), 256 * KB, 8);
|
||||
|
||||
if (!tty_slab) {
|
||||
panic("tty_slab alloc failed\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue