How does your OS manage dependencies/extensions?
How does your OS manage dependencies/extensions?
Hi,
I wanted to ask how you all handled dependencies and extensions. My OS is in its infancy stages (I've just finished with paging and heap), and I wanted to ask how you build and apply extensions to your OS. Now, I don't mean like a microkernel. I mean having the source code for the VFS, or drivers, or anything else seperated from the kernel's build system.
My goal with my OS is to have a core kernel that is completely capable of running on its own. Then I will have a Javascript VM that the kernel runs, then applications that the Javascript VM runs.
I'd like to know how you build different aspects of your OS. Do you build the code for extensions, in this case the Javascript VM, into the kernel's build system or does you set up your build system to scan a directory for extensions, or <other>?
Cheers,
trekos
I wanted to ask how you all handled dependencies and extensions. My OS is in its infancy stages (I've just finished with paging and heap), and I wanted to ask how you build and apply extensions to your OS. Now, I don't mean like a microkernel. I mean having the source code for the VFS, or drivers, or anything else seperated from the kernel's build system.
My goal with my OS is to have a core kernel that is completely capable of running on its own. Then I will have a Javascript VM that the kernel runs, then applications that the Javascript VM runs.
I'd like to know how you build different aspects of your OS. Do you build the code for extensions, in this case the Javascript VM, into the kernel's build system or does you set up your build system to scan a directory for extensions, or <other>?
Cheers,
trekos
- BrightLight
- Member
- Posts: 901
- Joined: Sat Dec 27, 2014 9:11 am
- Location: Maadi, Cairo, Egypt
- Contact:
Re: How does your OS manage dependencies/extensions?
It sounds like your OS would really be a JavaScript interpreter on "bare metal." IMHO, that's not a good approach; interpreted languages are always slower than compiled code.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
Re: How does your OS manage dependencies/extensions?
Hi,
Honestly, I'm not focused on providing speed for userspace applications right now, I'm focused on providing a simple way to program applications.
Because there isn't any compiling to be done, I believe the application programming will be tons simpler. If you don't have to compile then these Javascript applications can work architecture independent. That way when I port other architectures it will be super simple for users to download, install, and run applications.
That's just my thoughts.
Cheers,
trekos
Honestly, I'm not focused on providing speed for userspace applications right now, I'm focused on providing a simple way to program applications.
Because there isn't any compiling to be done, I believe the application programming will be tons simpler. If you don't have to compile then these Javascript applications can work architecture independent. That way when I port other architectures it will be super simple for users to download, install, and run applications.
That's just my thoughts.
Cheers,
trekos
Re: How does your OS manage dependencies/extensions?
The OS kernel doesn't maybe created in the JavaScript and other like programming languages. The reason is that these languages imply presence implement memory manager, protection, task management, etc. Another problem is that these languages do not provide means low-level code managment for interrupt and exception handling, cpu control, task switching, etc. You can implement kernel modules, which may be developed on most languages, but maybe a problems related to performance.
I implemented kernel modules loading from PE DLL's and I implemented partial support msvcrt so I can use standard C/C++ libraries without problems with porting. In a similar way, you can implement support for interpreters, but I don't need it.
I implemented kernel modules loading from PE DLL's and I implemented partial support msvcrt so I can use standard C/C++ libraries without problems with porting. In a similar way, you can implement support for interpreters, but I don't need it.
-
- Member
- Posts: 45
- Joined: Wed Dec 25, 2013 11:51 am
Re: How does your OS manage dependencies/extensions?
I use CMake to automate my build process. The kernel itself is an executable and the kernel modules are shared libraries. I also have some static libraries to implement small functions/classes that I use in many components (e.g. clear memory, copy memory, etc.).trekos wrote:Do you build the code for extensions, in this case the Javascript VM, into the kernel's build system or does you set up your build system to scan a directory for extensions, or <other>?
Machina - https://github.com/brunexgeek/machina
-
- Member
- Posts: 45
- Joined: Wed Dec 25, 2013 11:51 am
Re: How does your OS manage dependencies/extensions?
omarrx024 wrote:It sounds like your OS would really be a JavaScript interpreter on "bare metal." IMHO, that's not a good approach; interpreted languages are always slower than compiled code.
He can still implement a JIT compiler to improve performance.trekos wrote:Honestly, I'm not focused on providing speed for userspace applications right now, I'm focused on providing a simple way to program applications.
You mean simpler because you don't need to run a compiler explicitly to generate the executable? If you intent to run JavaScript programs directly from source you might have some problems (for example) with performance (you need to compile the code every time the user runs it) and security (the source code is exposed and there's no guarantee the code wasn't modified). Compiled executable (native or bytecode) allows you to simplify the process of load/execute programs and also allows you to introduce some security validations.trekos wrote:Because there isn't any compiling to be done, I believe the application programming will be tons simpler.
Machina - https://github.com/brunexgeek/machina
Re: How does your OS manage dependencies/extensions?
Hi,brunexgeek wrote:Snip
I mean that it would be simpler for cross-platform applications (think of Java), but instead of compiling it to bytecode (again like Java) it is interpreted by the built in Javascript module.
I will still support executable files, but Javascript would be much better to use for user-mode applications. I see where you come from about security, and I will have to take this into consideration. Perhaps implement a checksum to the application's package before executing?
Cheers,
trekos
Re: How does your OS manage dependencies/extensions?
Why not allow the user to edit it on the fly, similar to how Emacs works?trekos wrote:Hi,brunexgeek wrote:Snip
I mean that it would be simpler for cross-platform applications (think of Java), but instead of compiling it to bytecode (again like Java) it is interpreted by the built in Javascript module.
I will still support executable files, but Javascript would be much better to use for user-mode applications. I see where you come from about security, and I will have to take this into consideration. Perhaps implement a checksum to the application's package before executing?
Cheers,
trekos
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
Compiler Development Forum
-
- Member
- Posts: 45
- Joined: Wed Dec 25, 2013 11:51 am
Re: How does your OS manage dependencies/extensions?
I understand, but notice that even an interpreted language will required some kind of intermediate representation (bytecode, syntax tree, etc.) which can be executed by a virtual machine. The only difference is whether the program will be stored as source (JavaScript) or not (e.g. bytecode). In the first case you need to "compile" at runtime; in the later you just load the intermediate representation and run.trekos wrote:I mean that it would be simpler for cross-platform applications (think of Java), but instead of compiling it to bytecode (again like Java) it is interpreted by the built in Javascript modulebrunexgeek wrote:Snip
Machina - https://github.com/brunexgeek/machina
Re: How does your OS manage dependencies/extensions?
Scripts are not less secure than binaries.
It just takes less tools to alter them.
Never give power to something you have no trust/faith in.
It just takes less tools to alter them.
Never give power to something you have no trust/faith in.
Re: How does your OS manage dependencies/extensions?
Hi,
In theory I'd have a "standard base" (OS installer, boot loaders, kernel, drivers, GUI, utilities/tools, etc) that covers the minimum/required functionality and is all under the one build system and kept "in sync" (only ever depending on itself); and then (completely separated from that) I'd have "optional stuff" (applications, etc). In practice I never get far enough to worry about "optional stuff", so there are no dependencies or extensions on top of that "minimum/required functionality that only ever depends on itself".
Cheers,
Brendan
Mostly, I don't handle dependencies and extensions.trekos wrote:I wanted to ask how you all handled dependencies and extensions. My OS is in its infancy stages (I've just finished with paging and heap), and I wanted to ask how you build and apply extensions to your OS. Now, I don't mean like a microkernel. I mean having the source code for the VFS, or drivers, or anything else seperated from the kernel's build system.
In theory I'd have a "standard base" (OS installer, boot loaders, kernel, drivers, GUI, utilities/tools, etc) that covers the minimum/required functionality and is all under the one build system and kept "in sync" (only ever depending on itself); and then (completely separated from that) I'd have "optional stuff" (applications, etc). In practice I never get far enough to worry about "optional stuff", so there are no dependencies or extensions on top of that "minimum/required functionality that only ever depends on itself".
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: How does your OS manage dependencies/extensions?
I use a code patching model for it. I insert kernel calls with a macro, which is modified when accessed and patched with the real entry point. Services are registered by drivers at initialization time. Then I build a binary by combining drivers I need for a specific configuration. This way I don't need to link a huge binary, rather the configuration process only needs to write the wanted drivers into the image. The image can by built in the target system itself (or on Windows), supporting automatic configuration.trekos wrote:Hi,
I wanted to ask how you all handled dependencies and extensions. My OS is in its infancy stages (I've just finished with paging and heap), and I wanted to ask how you build and apply extensions to your OS. Now, I don't mean like a microkernel. I mean having the source code for the VFS, or drivers, or anything else seperated from the kernel's build system.
My goal with my OS is to have a core kernel that is completely capable of running on its own. Then I will have a Javascript VM that the kernel runs, then applications that the Javascript VM runs.
I'd like to know how you build different aspects of your OS. Do you build the code for extensions, in this case the Javascript VM, into the kernel's build system or does you set up your build system to scan a directory for extensions, or <other>?
Cheers,
trekos