I am writing a monolithic OS (it is a joke to call it an OS, but it has very minimal school-level functionalities). When I say monolithic, I meant that it was compiled as a single binary blob and does not support the file system, etc. Currently, I just have a rudimentary simple user space, which is nothing more than an infinite while loop.
I plan to make my OS a little more useful and I want to write custom applications that may stop, like regular applications on a full-blown OS.
I have no glibc or equivalent. My current library in user space is the code I wrote. Now my problem is how to add a framework for user space applications, which will allow them to stop working at a fixed point.
I know how programs compile on regular systems and what happens when a program terminates. However, in my case, I donβt have the luxury of compiling programs against libraries, and if the program terminates, my instruction pointer just goes wildly around.
I am currently doing all applications to make a "callback", and I am pre-populating the application stack with the patch address (at startup). Is there a better way to deal with the problem?
Along with the answer, I would be more than happy to get clarity about some OS concepts.
I am working on an x86 platform emulator and set up a static binary table. (I have virtual memory support)
source share