mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 05:58:15 -04:00
Cleanup
This commit is contained in:
parent
d2ee3b1c6d
commit
cb75dc20e1
@ -24,6 +24,7 @@ void block_process(pid_t pid);
|
|||||||
void unblock_process(pid_t pid);
|
void unblock_process(pid_t pid);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
|
void start() __attribute__((noreturn));
|
||||||
|
|
||||||
int64_t exec(const std::string& path, const std::vector<std::string>& params);
|
int64_t exec(const std::string& path, const std::vector<std::string>& params);
|
||||||
|
|
||||||
|
@ -94,11 +94,7 @@ void kernel_main(){
|
|||||||
sysfs::set_constant_value("/sys/", "author", "Baptiste Wicht");
|
sysfs::set_constant_value("/sys/", "author", "Baptiste Wicht");
|
||||||
|
|
||||||
scheduler::init();
|
scheduler::init();
|
||||||
|
scheduler::start();
|
||||||
//Launch the shell
|
|
||||||
init_shell();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -549,19 +549,6 @@ void init_context(scheduler::process_t& process, const char* buffer, const std::
|
|||||||
process.context = reinterpret_cast<interrupt::syscall_regs*>(scheduler::user_rsp - sizeof(interrupt::syscall_regs) - args_size);
|
process.context = reinterpret_cast<interrupt::syscall_regs*>(scheduler::user_rsp - sizeof(interrupt::syscall_regs) - args_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void start() __attribute__((noreturn));
|
|
||||||
void start(){
|
|
||||||
started = true;
|
|
||||||
|
|
||||||
for(auto& process : pcb){
|
|
||||||
if(process.state != scheduler::process_state::EMPTY){
|
|
||||||
k_printf("pid: %u ppid: %u\n", process.process.pid, process.process.ppid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
init_task_switch(current_pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
} //end of anonymous namespace
|
} //end of anonymous namespace
|
||||||
|
|
||||||
void scheduler::init(){ //Create the idle task
|
void scheduler::init(){ //Create the idle task
|
||||||
@ -583,13 +570,13 @@ void scheduler::init(){ //Create the idle task
|
|||||||
pcb[current_pid].state = scheduler::process_state::RUNNING;
|
pcb[current_pid].state = scheduler::process_state::RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t scheduler::exec(const std::string& file, const std::vector<std::string>& params){
|
void scheduler::start(){
|
||||||
//TODO Once shell removed, start will be called in init()
|
started = true;
|
||||||
if(!started){
|
|
||||||
start();
|
|
||||||
//Unreachable
|
|
||||||
}
|
|
||||||
|
|
||||||
|
init_task_switch(current_pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
int64_t scheduler::exec(const std::string& file, const std::vector<std::string>& params){
|
||||||
std::string content;
|
std::string content;
|
||||||
auto result = vfs::direct_read(file, content);
|
auto result = vfs::direct_read(file, content);
|
||||||
if(result < 0){
|
if(result < 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user