dev: boot framebuffer support
This commit is contained in:
18
init/main.c
18
init/main.c
@@ -182,14 +182,28 @@ void kernel_init(uintptr_t arg)
|
||||
|
||||
printk("kernel_init() running on processor %u", this_cpu());
|
||||
|
||||
|
||||
create_kernel_thread(background_thread);
|
||||
|
||||
struct object *fb;
|
||||
struct object *kbd;
|
||||
|
||||
run_all_tests();
|
||||
|
||||
status = object_namespace_get_object(global_namespace(), "/dev/input/input0", &kbd);
|
||||
status = object_get("/dev/video/fb0", &fb);
|
||||
if (status == KERN_OK) {
|
||||
struct device *fb_dev = cast_to_device(fb);
|
||||
struct framebuffer_device *fb_info = FRAMEBUFFER_DEVICE(fb_dev);
|
||||
|
||||
printk("fb: mode=%ux%ux%u type=%u cells=%ux%u",
|
||||
fb_info->fb_varinfo.fb_xres, fb_info->fb_varinfo.fb_yres,
|
||||
fb_info->fb_varinfo.fb_flags,
|
||||
fb_info->fb_varinfo.fb_xcells, fb_info->fb_varinfo.fb_ycells);
|
||||
} else {
|
||||
printk("fb: unavailable");
|
||||
}
|
||||
|
||||
|
||||
status = object_get("/dev/input/input0", &kbd);
|
||||
if (status != KERN_OK) {
|
||||
printk("no keyboard available");
|
||||
hang();
|
||||
|
||||
Reference in New Issue
Block a user