got some of the pty actually working in userspace
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <drivers/pit/pit.h>
|
||||
#include <drivers/vga/vga.h>
|
||||
#include <drivers/cpio/cpio.h>
|
||||
#include <drivers/devfs/devfs.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
@@ -65,6 +66,10 @@ void load_root_program(const char* path) {
|
||||
flush_tlb();
|
||||
|
||||
uint32_t eip = load_elf_program(path);
|
||||
if (eip == 0) {
|
||||
kprintf("Failed to load elf program file\n");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t stack_sz = PAGE_SIZE * 16;
|
||||
uint32_t stack_top = 0xBFFF0000;
|
||||
@@ -122,12 +127,26 @@ void kmain(uint32_t magic, multiboot_info* mbi) {
|
||||
vfs_mount(vfs_root, initrd_root);
|
||||
kprintf("initrd read, mounted @ /\n");
|
||||
|
||||
vfs_node_t* devfs = create_devfs();
|
||||
if (!devfs) {
|
||||
kprintf("failed to create devfs\n");
|
||||
return;
|
||||
}
|
||||
|
||||
vfs_node_t* vga_dev = devfs->create(devfs, "tvga");
|
||||
vga_dev->write = vga_write;
|
||||
|
||||
vfs_node_t* dev = vfs_find("/dev");
|
||||
if (dev) {
|
||||
dev->mnt = devfs;
|
||||
}
|
||||
|
||||
disable_interrupts();
|
||||
init_scheduler();
|
||||
enable_interrupts();
|
||||
|
||||
kprintf("loading terminal program\n");
|
||||
load_root_program("/vga_text_term.elf");
|
||||
load_root_program("/bin/vga_text_term.elf");
|
||||
|
||||
kprintf("kernel going to sleep...\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user