@@ -68,6 +68,8 @@ VFS* vfs;
68
68
auto dev_random = make<RandomDevice>();
69
69
auto dev_ptmx = make<PTYMultiplexer>();
70
70
71
+ bool textmode = !KParams::the ().get (" text_debug" ).is_null ();
72
+
71
73
auto root = KParams::the ().get (" root" );
72
74
if (root.is_empty ()) {
73
75
root = " /dev/hda" ;
@@ -163,15 +165,23 @@ VFS* vfs;
163
165
// SystemServer will start WindowServer, which will be doing graphics.
164
166
// From this point on we don't want to touch the VGA text terminal or
165
167
// accept keyboard input.
166
- tty0->set_graphical (true );
167
-
168
- auto * system_server_process = Process::create_user_process (" /bin/SystemServer" , (uid_t )0 , (gid_t )0 , (pid_t )0 , error, {}, {}, tty0);
169
- if (error != 0 ) {
170
- kprintf (" init_stage2: error spawning SystemServer: %d\n " , error);
171
- hang ();
168
+ if (textmode) {
169
+ tty0->set_graphical (false );
170
+ auto * shell_process = Process::create_user_process (" /bin/Shell" , (uid_t )0 , (gid_t )0 , (pid_t )0 , error, {}, {}, tty0);
171
+ if (error != 0 ) {
172
+ kprintf (" init_stage2: error spawning Shell: %d\n " , error);
173
+ hang ();
174
+ }
175
+ shell_process->set_priority (Process::HighPriority);
176
+ } else {
177
+ tty0->set_graphical (true );
178
+ auto * system_server_process = Process::create_user_process (" /bin/SystemServer" , (uid_t )0 , (gid_t )0 , (pid_t )0 , error, {}, {}, tty0);
179
+ if (error != 0 ) {
180
+ kprintf (" init_stage2: error spawning SystemServer: %d\n " , error);
181
+ hang ();
182
+ }
183
+ system_server_process->set_priority (Process::HighPriority);
172
184
}
173
- system_server_process->set_priority (Process::HighPriority);
174
-
175
185
Process::create_kernel_process (" NetworkTask" , NetworkTask_main);
176
186
177
187
current->process ().sys $exit (0 );
@@ -212,6 +222,8 @@ extern "C" [[noreturn]] void init()
212
222
// must come after kmalloc_init because we use AK_MAKE_ETERNAL in KParams
213
223
new KParams (String (reinterpret_cast <const char *>(multiboot_info_ptr->cmdline )));
214
224
225
+ bool textmode = !KParams::the ().get (" text_debug" ).is_null ();
226
+
215
227
vfs = new VFS;
216
228
dev_debuglog = new DebugLogDevice;
217
229
@@ -257,14 +269,18 @@ extern "C" [[noreturn]] void init()
257
269
id.device_id );
258
270
});
259
271
260
- if (multiboot_info_ptr->framebuffer_type == 1 ) {
261
- new MBVGADevice (
262
- PhysicalAddress ((u32 )(multiboot_info_ptr->framebuffer_addr )),
263
- multiboot_info_ptr->framebuffer_pitch ,
264
- multiboot_info_ptr->framebuffer_width ,
265
- multiboot_info_ptr->framebuffer_height );
272
+ if (textmode) {
273
+ dbgprintf (" Text mode enabled\n " );
266
274
} else {
267
- new BXVGADevice;
275
+ if (multiboot_info_ptr->framebuffer_type == 1 || multiboot_info_ptr->framebuffer_type == 2 ) {
276
+ new MBVGADevice (
277
+ PhysicalAddress ((u32 )(multiboot_info_ptr->framebuffer_addr )),
278
+ multiboot_info_ptr->framebuffer_pitch ,
279
+ multiboot_info_ptr->framebuffer_width ,
280
+ multiboot_info_ptr->framebuffer_height );
281
+ } else {
282
+ new BXVGADevice;
283
+ }
268
284
}
269
285
270
286
LoopbackAdapter::the ();
0 commit comments