AndrewAPrice wrote:
Sorry, I mean to say there is no "file open" system call.
Well, what's the point of that? You end up with a bunch of "dynamic" system calls you need in almost every application anyway. I suspect that all I/O system calls are dynamic in this way. Thus all of your applications end up doing a theoretically dynamic initialization that is going to turn out the same for all of them. Basically what a dynamic linker does.
See, OS-9 pushes all I/O system calls to the IOMAN program. The kernel itself contains only a stub for doing exactly that. This does however mean that there is a stable "open" system call with the same ABI as the memory and process system calls, and the fact that they're RPCs under the hood doesn't have to concern the program running the call. (If you're wondering why I keep bringing up OS-9, it's basically the only microkernel OS I know in any depth).
AndrewAPrice wrote:
However a simple GUI calculator program is 9MB in my OS.
[...]I'd appreciate it if anyone has any advice on how I can shrink my binaries.
I suspect it's because my UI library uses skia for drawing, and by touching it for a few things (e.g. drawing some text and buttons) I end up touching a lot of unused but plausibly reachable code paths and all of skias dependencies get linked in.
I know entire operating systems that aren't this large. My advice is to use "nm" to analyze the symbols linked into the binary. Check if you can reduce the dependency chains.