Jump to content

Operating System Devlopment

Didey

Not sure if this belongs here or in programming, but I think Operating System development is awesome. I've been reading some articles and watching some videos on the topic, and it is fascinating. I wanted to know if there are any OS developers here who could explain some stuff, and maybe give me some pointers because I want to write my own kernel. Right now, I am reading https://www.gitbook.com/book/samypesse/how-to-create-an-operating-system/details

 

Questions for OS Devs:

 

1. What languages do you use?

 

2. Do you work off the Linux kernel?

 

3. How do you handle drivers?

 

Also general OS Development thread.

Link to comment
Share on other sites

Link to post
Share on other sites

I can only answer 1) and that's because I read up about that one a bit..

You use the language C probably. But that's about all I really know though..

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

Moved to Programming.

If you don't care about performance, and be an overlay on top of a current OS, you can technically use any well develop language.

However, if you want to code your own kernel natively, you are looking at using C

If you want performance on your side, then you need an extremely in depth knowledge of programming, and do it in assembly, or partially in assembly. The less powerful you aim the kernel you plan to run on, and the lower the footprint, the higher the difficulty increasing at an exponential rate. Why assembly? Because you can fine tune the optimization of your program to reflect what you are trying to achieve. Then again, gcc compiler is very good.

Of course, I am no expert in the field.

Link to comment
Share on other sites

Link to post
Share on other sites

 C++ is one way, and a kernel is usually needed. 

People program operating systems in C++? I thought it was mostly C.

 

Doesn't C++ have a lot of minor problems that become fairly significant when you try and do something like build an operating system with it?

Link to comment
Share on other sites

Link to post
Share on other sites

Well, one problem I know C++ has, is overhead due to Objected Oriented part.

It's not bad per se, but when doing an OS kernel, and assuming you want good performance on a mobile device, say smartphone, or old low end PC spec, it mashers.

Doing a kernel, a good one, is a serious challenge, that is why you don't have many.

Link to comment
Share on other sites

Link to post
Share on other sites

It really depends on the OS.  But, C is one of the more go to.  You can do it with C++ though.  But, a mod already explained why C is far more logical...your own kernel.  However, if you plan to make a linux distro, for example, or use an already existing kernel you can use most languages though some will restrict various things.  Personally, I'd use C or C# as C++ is one of the more painful languages especially if you mess up.  That's why I wouldn't use C++ to develop an OS.  The massive advantage though of using C++ is cross platform compatibility.  But, that's usually with other forms of SW like games.  

You'd use C#? Isn't the requirement of a runtime preventative of anything OS level?

 

Also, isn't compatibility fairly poor with C++? I thought because of name mangling, you had to always use the same compiler if you wanted to link things, whereas with C, every ANSI compiler should work together.

Link to comment
Share on other sites

Link to post
Share on other sites

You'd use C#? Isn't the requirement of a runtime preventative of anything OS level?

 

I'm not sure the OS can be written in 100% C#, as from my understanding a certain amount of assembly (or similar low level code) is needed, but I could be wrong. To get around the runtime though you just have to compile it to native instructions. For example, COMOS uses IL2CPU to do so. They seem to combine C# with X# though which would satisfy that low level requirement that I think exists (or maybe it's not required and it's just useful to have).

Link to comment
Share on other sites

Link to post
Share on other sites

I'm not sure the OS can be written in 100% C#, as from my understanding a certain amount of assembly (or similar low level code) is needed, but I could be wrong. To get around the runtime though you just have to compile it to native instructions. For example, COMOS uses IL2CPU to do so. They seem to combine C# with X# though which would satisfy that low level requirement that I think exists (or maybe it's not required and it's just useful to have).

Well I guess that explains the runtime layer issue.

 

Does COMOS have problems with latency due to the garbage collector?

Link to comment
Share on other sites

Link to post
Share on other sites

Well I guess that explains the runtime layer issue.

 

Does COMOS have problems with latency due to the garbage collector?

 

Not sure. I'm curious about that too. Maybe @valdyrgramr knows something about it.

Link to comment
Share on other sites

Link to post
Share on other sites

Not sure, but it is possible.  That could be either code or design related though.

Well, unless you can get around the garbage collector collecting whenever it feels like it, there's potential for latency problems. 

 

If a large tree goes out of scope suddenly, that could potentially significant amount of time to deallocate all of the nodes.

 

I don't know whether that is a real problem or not if the OS isn't a realtime OS.

Link to comment
Share on other sites

Link to post
Share on other sites

You could probably code a fix for that, but that's beyond my knowledge.  I don't dwell too much in OS development as games are my strong area.   :D

I doubt you could code a fix for that... C# is not designed for you to explicitly deallocate anything.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×