Octocontrabass wrote: ↑Fri Jun 13, 2025 11:28 pm
I was thinking more along the lines of having the entry point be inside (the equivalent of) msvcrt.dll. This is actually how dynamic linking works in Linux: dynamically linked ELF executables specify that ld-linux.so contains the entry point.
In Win32 applications, main() is called by a function that goes by either `_mainCRTStartup` or `_start` or `start` (I believe it depends on which compiler toolset it was compiled with). But that function is
linked into the application.
Dynamic linking on Windows works in basically the same way as on Linux, yes, but the thing doing the loading is
not msvcrt.dll. It's actually ntdll.dll. When a process is created, the main thread's first instruction is in ntdll.dll. Then, it loads all of the DLLs, and then the application. For each of the DLLs, its entry point (DllMain) is called with DLL_PROCESS_ATTACH (well, er, again, _DllMainCRTStartup etc), and
then the application's entry point is called, which eventually calls main().
kerravon wrote: ↑Sat Jun 14, 2025 1:18 am
Universal across all compilers and linkers worldwide.
All compilers... that implement the C90 standard in a way that completely abides by the standard?
Hey! I'm developing two operating systems:
NanoShell --- A 32-bit operating system whose GUI takes inspiration from Windows 9x and early UNIX desktop managers.
Boron --- A portable SMP operating system taking inspiration from the design of the Windows NT kernel.