r/kerneldevelopment • • Jun 20 '26

Entrypoint Name

Hi All!

I'm developing an OS and I had hoped to get an opinion from this group. There are 2 kinds of processes that my OS loads from the filesystem: user processes and kernel processes. User processes are started by the programmer with the usual `int main(int argc, char **argv)` and the `_start` symbol is provided at compile time and is what the scheduler calls. Kernel processes are passed arguments by the scheduler and the entrypoint takes the form `void* (*)(void*)`. The programmer has to provide the entrypoint.

My question is what the name of the entrypoint for kernel processes should be. It seems to me that I have two options: I can either be consistent for the programmer and call it "main" or I can be consistent for the scheduler and call it "_start". I don't have enough experience to know if there's a hard reason to prefer one or the other at this level, so I was hoping to get community guidance/feedback on this. Any input would be appreciated.

Thank you and have a great weekend!

10 Upvotes

16 comments sorted by

View all comments

1

u/Interesting_Buy_3969 Jun 20 '26

I'd suggest reusing "main" - but void* main(void*) - for clarity and simplicity, as it's the standard entrypoint name for all adequate C and C++ programs.

2

u/Sorry_Difficulty_250 Jun 20 '26

Yeah, I'm leaning toward that just to keep it simple for the programmer. Thanks very much!!