Page 1 of 1

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

Posted: Sat Nov 08, 2025 10:33 pm
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

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

Posted: Sun Nov 09, 2025 12:23 am
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.

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

Posted: Sun Nov 09, 2025 6:36 am
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?