mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 10:48:38 +00:00
FIX: Race condition causing applications to print to serial out instead of the CLI
This commit is contained in:
parent
7116de4152
commit
7f510c6aa5
2 changed files with 4 additions and 5 deletions
|
|
@ -179,7 +179,7 @@ process_t* process_create(void (*entry_point)(void), bool is_user) {
|
||||||
return new_proc;
|
return new_proc;
|
||||||
}
|
}
|
||||||
|
|
||||||
process_t* process_create_elf(const char* filepath, const char* args_str) {
|
process_t* process_create_elf(const char* filepath, const char* args_str, bool terminal_proc, int tty_id) {
|
||||||
uint64_t rflags = spinlock_acquire_irqsave(&runqueue_lock);
|
uint64_t rflags = spinlock_acquire_irqsave(&runqueue_lock);
|
||||||
process_t *new_proc = NULL;
|
process_t *new_proc = NULL;
|
||||||
|
|
||||||
|
|
@ -210,8 +210,8 @@ process_t* process_create_elf(const char* filepath, const char* args_str) {
|
||||||
new_proc->ui_window = NULL;
|
new_proc->ui_window = NULL;
|
||||||
new_proc->heap_start = 0x20000000; // 512MB mark
|
new_proc->heap_start = 0x20000000; // 512MB mark
|
||||||
new_proc->heap_end = 0x20000000;
|
new_proc->heap_end = 0x20000000;
|
||||||
new_proc->is_terminal_proc = false;
|
new_proc->is_terminal_proc = terminal_proc;
|
||||||
new_proc->tty_id = -1;
|
new_proc->tty_id = tty_id;
|
||||||
new_proc->kill_pending = false;
|
new_proc->kill_pending = false;
|
||||||
|
|
||||||
process_t *parent = process_get_current();
|
process_t *parent = process_get_current();
|
||||||
|
|
@ -231,7 +231,6 @@ process_t* process_create_elf(const char* filepath, const char* args_str) {
|
||||||
serial_write("[PROC] Failed to load ELF: ");
|
serial_write("[PROC] Failed to load ELF: ");
|
||||||
serial_write(filepath);
|
serial_write(filepath);
|
||||||
serial_write("\n");
|
serial_write("\n");
|
||||||
// We technically leak the page table here, but let's ignore cleanup for now
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ typedef struct {
|
||||||
|
|
||||||
void process_init(void);
|
void process_init(void);
|
||||||
process_t* process_create(void (*entry_point)(void), bool is_user);
|
process_t* process_create(void (*entry_point)(void), bool is_user);
|
||||||
process_t* process_create_elf(const char* filepath, const char* args_str);
|
process_t* process_create_elf(const char* filepath, const char* args_str, bool terminal_proc, int tty_id);
|
||||||
process_t* process_get_current(void);
|
process_t* process_get_current(void);
|
||||||
void process_set_current_for_cpu(uint32_t cpu_id, process_t* p);
|
void process_set_current_for_cpu(uint32_t cpu_id, process_t* p);
|
||||||
process_t* process_get_current_for_cpu(uint32_t cpu_id);
|
process_t* process_get_current_for_cpu(uint32_t cpu_id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue