feat: a pseudo shell environment for basic interacting and testing purpose
[lunaix-os.git] / lunaix-os / kernel / lxconsole.c
index c718b7124c82f284586c39c906e11150d36e4165..77949c897822c699c733fc03ac683b493e48a44f 100644 (file)
@@ -50,23 +50,9 @@ void
 lxconsole_init()
 {
     memset(&lx_console, 0, sizeof(lx_console));
-    fifo_init(&lx_console.output, VGA_BUFFER_VADDR + 0x1000, 8192, 0);
+    fifo_init(&lx_console.output, vzalloc(8192), 8192, 0);
     fifo_init(&lx_console.input, valloc(4096), 4096, 0);
 
-    // FIXME use valloc to allocate console buffer.
-    // In doing this, the console buffer can only be accessed from kernel mode
-    //  any direct write to this buffer from user land should be purged!
-
-    // 分配控制台缓存
-    for (size_t i = 0; i < PG_ALIGN(lx_console.output.size); i += PG_SIZE) {
-        uintptr_t pa = pmm_alloc_page(KERNEL_PID, 0);
-        vmm_set_mapping(PD_REFERENCED,
-                        (uintptr_t)lx_console.output.data + i,
-                        pa,
-                        PG_PREM_URW,
-                        0);
-    }
-
     lx_console.flush_timer = NULL;
 
     struct device* tty_dev = device_addseq(NULL, &lx_console, "tty");