onureozcan / zero_os

hobby os
7 stars 0 forks source link

PANIC: could not load process (the window manager) after boot up #2

Open ajh123 opened 3 years ago

ajh123 commented 3 years ago

Here is the serial log

initializing Zero Os ...                                                                                      
multiboot info is located at 0x10000. magic: 0x2badb002                                                       
[MEMORY MANAGER]:initialized with 127 mb usable and 127 mb total memory                                      
[MEMORY MANAGER]:kernel reserved:20 mb                                                                       
[MEMORY MANAGER]:106 mb available for user space out of 127 mb                                                
[DEVICE MANAGER]:initializing device manager                                                                  
[FRAMEBUFFER DEVICE]:registered framebuffer device. size: 3686400, lfb address: 0xfd000000                   
[NULL DEVICE]:registered null device                                                                          
[NULL VOLUME]:registered null volume                                                                          
[ROOT FS]:registered root fs                                                                                  
[BOOT FS]:registered boot fs                                                                                  
[DEVICE FS]:registered device fs                                                                              
[MOUSE DEVICE]:registered mouse device                                                                       
[TASK_MANAGER]:load process window manager                                                                    
PANIC:could not load process                                                                                  
page fault 0xf000ff53                                                                                         

I have not modified any of the os, when booting after building on macOs with docker QEMU just shows a blank window and thats above in the log

ajh123 commented 3 years ago

Solved the page fault by changing kernel/tasking/init.c to

//
// Created by onureozcan on 04.06.2019.
//

#include <multiboot.h>
#include <display/console.h>
#include <memory/memory_manager.h>
#include <string/k_string.h>
#include <tasking/task_manager.h>
#include <fs/vfs.h>

#ifdef LOG_TAG
#undef LOG_TAG
#endif
#define  LOG_TAG "INIT"

void init_load_hello() {
    console_debug(LOG_TAG, "loading hello...\n");
    char *hello_world_bytes;
    int hello_world_size;
    vfs_node_t *hello = vfs_open("/user/hello", 0); #Changed /user was /boot
    if (hello == NULL) {
        console_error(LOG_TAG, "could not find hello app.\n");
        panic(LOG_TAG);
        return;
    }
    hello_world_bytes = (char *) (k_malloc(hello->size_bytes));
    hello_world_size = hello->size_bytes;
    vfs_read(hello, hello_world_bytes, hello_world_size, 0);
    task_manager_load_process("hello", hello_world_bytes, NULL, 0);
    k_free(hello_world_bytes);
}

void init_load_window_manager(int lfb_w, int lfb_h, int lfb_depth) {
    console_debug(LOG_TAG, "loading window manager...\n");
    char *wm_bytes;
    int wm_size;
    vfs_node_t *wm = vfs_open("/user/window_manager", 0); #Changed /user was /boot
    if (wm == NULL) {
        console_error(LOG_TAG, "could not find window manager app.\n");
        panic(LOG_TAG);
        return;
    }
    wm_bytes = (char *) (k_malloc(wm->size_bytes));
    wm_size = wm->size_bytes;
    vfs_read(wm, wm_bytes, wm_size, 0);
    char *c_lfb_w = (char *) lfb_w;
    char *c_lfb_h = (char *) lfb_h;
    char *c_lfb_d = (char *) lfb_depth;
    char *args[] = {c_lfb_w, c_lfb_h, c_lfb_d};
    uint32_t pid = task_manager_load_process("window manager", wm_bytes, args, 3);
    window_manager = task_manager_find_process_by_id(pid);
    k_free(wm_bytes);
}
ajh123 commented 3 years ago

but still no window manager opening

ajh123 commented 3 years ago

Now i have this after clean & rebuild

[INIT]:could not find window manager app.                                                                     
PANIC:INIT