The correct development order when writing an OS.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Sourcer
Member
Member
Posts: 58
Joined: Fri Jun 17, 2016 11:29 pm
Libera.chat IRC: WalterPinkman

The correct development order when writing an OS.

Post by Sourcer »

Hey, i'm not new to software development, but i am a newbie in OS dev.

I've started to write my own OS for x86, and i was wondering what is the correct and most efficient order of steps..

I'm using GRUB as my bootloader;
I already have a very simple IRQ implementation for my keyboard, and all of the IDT exception handlers.

What should be my next module? some sites say a memory manager, and others say ATA drivers..

I'm not really sure.

Thanks. :D
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: The correct development order when writing an OS.

Post by iansjack »

It's entirely up to you. There are no absolutes. Perhaps draw up a high level view of how you think your OS should look and work from there.

But you may like to consider whether your memory allocator will need to read or write an ATA device or whether your driver will need memory allocated.
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: The correct development order when writing an OS.

Post by glauxosdever »

Hi,

Sourcer wrote:I've started to write my own OS for x86, and i was wondering what is the correct and most efficient order of steps..
I think there is no correct order, and there is no wrong order, but I can recommend you the Going_Further_on_x86 article as a short term guide.
Sourcer wrote:What should be my next module? some sites say a memory manager, and others say ATA drivers..
Definitely a memory manager. How would you tell your ATA driver where to load the sectors from the device?


Regards,
glauxosdever
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: The correct development order when writing an OS.

Post by neon »

Memory management should have been the first thing you should have done (after basic serial debug out of course) since it ties into the rest of the system. Given that you don't have this, I assume you don't have any real architecture for your drivers either -- so expect to have to rewrite them in the future.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: The correct development order when writing an OS.

Post by ~ »

Sourcer wrote:Hey, i'm not new to software development, but i am a newbie in OS dev.

I've started to write my own OS for x86, and i was wondering what is the correct and most efficient order of steps..

I'm using GRUB as my bootloader;
I already have a very simple IRQ implementation for my keyboard, and all of the IDT exception handlers.

What should be my next module? some sites say a memory manager, and others say ATA drivers..

I'm not really sure.

Thanks. :D
You will need to learn a lot and the goal will be to implement many applications.

You should choose your favorite open source applications and also learn which libraries and other kernels will help you learn. Then pick your favorite or oldest version of that application which runs fast and in most new and old systems.

Do the same with the newest versions.

Make a snapshot of the original source code of those applications as the root of that branch and then create another snapshot as the first modified version, your own branch of those projects.

You will lag behind the technology a lot while you try to implement your own OS, and the latest versions of your branched applications also will be left behind newer updates. But you will now need to start your learning from there, from modifying and taking apart those programs until you can understand them fully and apply that knowledge on your own without using those projects.

Now you must create a completely separate project repository to implement your very own projects, code you have written 100%. It should only contain the best you have done and the things you really understand and for which you have the greatest and most brilliant ideas you've had on how to implement them better than in the other projects you've seen.


So the first thing to do is taking a snapshot of the books, the tools, the programs, their source code and the rest of resources you will use as if they were the last versions ever to make it possible a smooth learning.


Also, by totally separating those resources in a repository, and the results of your work in a totally different repository, you will be able to actually make visible your contributions and make their development more interesting and useful to others. And you will also be able to clearly appreciate what you have achieved all of your own and what you have used as the base resources.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: The correct development order when writing an OS.

Post by Combuster »

Have you read What order should I make things in? In particular, memory management is on the mandatory list.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply