Questions on compiling libgcc, multitasking, filesystem, and how to go about them

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
atomtables
Posts: 14
Joined: Fri Nov 08, 2024 5:08 pm
Libera.chat IRC: atomtables

Questions on compiling libgcc, multitasking, filesystem, and how to go about them

Post by atomtables »

Hello. My kernel's at the stage where user-mode code can run, and I would like to start generating executables for the kernel to jump to after initialisation. I wanted to start this by building a toolchain, but looking at the requirements for all-target-libgcc, I was a little worried

Code: Select all

unistd.h: pid_t, intptr_t, fork(), execv(), execve(), execvp(), getpid().
int execv(const char*, char* const[]);
int execve(const char*, char* const[], char* const[]);
int execvp(const char*, char* const[]);
pid_t fork(void);
This would mean the kernel needs some sort of multitasking system first, right? I would like to develop multitasking after developing a proper compiler, but would it make more sense to develop multitasking first?

Also, for the file reading functions, would it also make more sense to develop something like Linux's VFS before going about trying to implement the C library? Just looking for some guidance. Thank you
nullplan
Member
Member
Posts: 2051
Joined: Wed Aug 30, 2017 8:24 am

Re: Questions on compiling libgcc, multitasking, filesystem, and how to go about them

Post by nullplan »

There is nothing stopping you from making fork() return -1 all the time. And for the VFS, you kind of need to develop the syscall layer and the internals together.
Carpe diem!
atomtables
Posts: 14
Joined: Fri Nov 08, 2024 5:08 pm
Libera.chat IRC: atomtables

Re: Questions on compiling libgcc, multitasking, filesystem, and how to go about them

Post by atomtables »

Oh ok, that makes sense. Thanks. As for testing these systemcalls, we would just have to write the calls and functions and start testing when we have program execution working, right?
Post Reply