|
@@ -68,6 +68,8 @@ VFS* vfs;
|
|
|
auto dev_random = make<RandomDevice>();
|
|
|
auto dev_ptmx = make<PTYMultiplexer>();
|
|
|
|
|
|
+ bool textmode = !KParams::the().get("text_debug").is_null();
|
|
|
+
|
|
|
auto root = KParams::the().get("root");
|
|
|
if (root.is_empty()) {
|
|
|
root = "/dev/hda";
|
|
@@ -163,15 +165,23 @@ VFS* vfs;
|
|
|
// SystemServer will start WindowServer, which will be doing graphics.
|
|
|
// From this point on we don't want to touch the VGA text terminal or
|
|
|
// accept keyboard input.
|
|
|
- tty0->set_graphical(true);
|
|
|
-
|
|
|
- auto* system_server_process = Process::create_user_process("/bin/SystemServer", (uid_t)0, (gid_t)0, (pid_t)0, error, {}, {}, tty0);
|
|
|
- if (error != 0) {
|
|
|
- kprintf("init_stage2: error spawning SystemServer: %d\n", error);
|
|
|
- hang();
|
|
|
+ if (textmode) {
|
|
|
+ tty0->set_graphical(false);
|
|
|
+ auto* shell_process = Process::create_user_process("/bin/Shell", (uid_t)0, (gid_t)0, (pid_t)0, error, {}, {}, tty0);
|
|
|
+ if (error != 0) {
|
|
|
+ kprintf("init_stage2: error spawning Shell: %d\n", error);
|
|
|
+ hang();
|
|
|
+ }
|
|
|
+ shell_process->set_priority(Process::HighPriority);
|
|
|
+ } else {
|
|
|
+ tty0->set_graphical(true);
|
|
|
+ auto* system_server_process = Process::create_user_process("/bin/SystemServer", (uid_t)0, (gid_t)0, (pid_t)0, error, {}, {}, tty0);
|
|
|
+ if (error != 0) {
|
|
|
+ kprintf("init_stage2: error spawning SystemServer: %d\n", error);
|
|
|
+ hang();
|
|
|
+ }
|
|
|
+ system_server_process->set_priority(Process::HighPriority);
|
|
|
}
|
|
|
- system_server_process->set_priority(Process::HighPriority);
|
|
|
-
|
|
|
Process::create_kernel_process("NetworkTask", NetworkTask_main);
|
|
|
|
|
|
current->process().sys$exit(0);
|
|
@@ -212,6 +222,8 @@ extern "C" [[noreturn]] void init()
|
|
|
// must come after kmalloc_init because we use AK_MAKE_ETERNAL in KParams
|
|
|
new KParams(String(reinterpret_cast<const char*>(multiboot_info_ptr->cmdline)));
|
|
|
|
|
|
+ bool textmode = !KParams::the().get("text_debug").is_null();
|
|
|
+
|
|
|
vfs = new VFS;
|
|
|
dev_debuglog = new DebugLogDevice;
|
|
|
|
|
@@ -257,14 +269,18 @@ extern "C" [[noreturn]] void init()
|
|
|
id.device_id);
|
|
|
});
|
|
|
|
|
|
- if (multiboot_info_ptr->framebuffer_type == 1) {
|
|
|
- new MBVGADevice(
|
|
|
- PhysicalAddress((u32)(multiboot_info_ptr->framebuffer_addr)),
|
|
|
- multiboot_info_ptr->framebuffer_pitch,
|
|
|
- multiboot_info_ptr->framebuffer_width,
|
|
|
- multiboot_info_ptr->framebuffer_height);
|
|
|
+ if (textmode) {
|
|
|
+ dbgprintf("Text mode enabled\n");
|
|
|
} else {
|
|
|
- new BXVGADevice;
|
|
|
+ if (multiboot_info_ptr->framebuffer_type == 1 || multiboot_info_ptr->framebuffer_type == 2) {
|
|
|
+ new MBVGADevice(
|
|
|
+ PhysicalAddress((u32)(multiboot_info_ptr->framebuffer_addr)),
|
|
|
+ multiboot_info_ptr->framebuffer_pitch,
|
|
|
+ multiboot_info_ptr->framebuffer_width,
|
|
|
+ multiboot_info_ptr->framebuffer_height);
|
|
|
+ } else {
|
|
|
+ new BXVGADevice;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
LoopbackAdapter::the();
|