OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: How does your OS manage dependencies/extensions?
PostPosted: Sun Sep 18, 2016 7:40 am 
Offline

Joined: Sun Sep 18, 2016 7:28 am
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Sun Sep 18, 2016 11:26 am 
Offline
Member
Member
User avatar

Joined: Sat Dec 27, 2014 9:11 am
Posts: 901
Location: Maadi, Cairo, Egypt
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.


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Sun Sep 18, 2016 11:48 am 
Offline

Joined: Sun Sep 18, 2016 7:28 am
Posts: 3
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


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Sun Sep 18, 2016 12:29 pm 
Offline
Member
Member

Joined: Sat Jan 16, 2016 10:43 am
Posts: 68
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.


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 10:02 am 
Offline
Member
Member

Joined: Wed Dec 25, 2013 11:51 am
Posts: 45
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>?
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.).

_________________
Machina - https://github.com/brunexgeek/machina


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 10:17 am 
Offline
Member
Member

Joined: Wed Dec 25, 2013 11:51 am
Posts: 45
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.

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.
He can still implement a JIT compiler to improve performance.

trekos wrote:
Because there isn't any compiling to be done, I believe the application programming will be tons simpler.
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.

_________________
Machina - https://github.com/brunexgeek/machina


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 12:33 pm 
Offline

Joined: Sun Sep 18, 2016 7:28 am
Posts: 3
brunexgeek wrote:
Snip


Hi,

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


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 1:36 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 286
Location: East Riding of Yorkshire, UK
trekos wrote:
brunexgeek wrote:
Snip


Hi,

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


Why not allow the user to edit it on the fly, similar to how Emacs works?

_________________
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 2:02 pm 
Offline
Member
Member

Joined: Wed Dec 25, 2013 11:51 am
Posts: 45
trekos wrote:
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 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.

_________________
Machina - https://github.com/brunexgeek/machina


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 3:22 pm 
Offline
Member
Member

Joined: Sat Nov 07, 2015 3:12 pm
Posts: 145
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.


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Tue Sep 20, 2016 5:25 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

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.


Mostly, I don't handle dependencies and extensions.

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.


Top
 Profile  
 
 Post subject: Re: How does your OS manage dependencies/extensions?
PostPosted: Wed Sep 21, 2016 3:00 pm 
Offline
Member
Member

Joined: Wed Oct 01, 2008 1:55 pm
Posts: 3191
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


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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group