OS design plan

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

OS design plan

Post by arming »

When a programmer designs a program, I suppose that this programmer write the algorithm (for example, in pseudocode), but when the desing is for an Operative system... what?

Are they some examples?
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: OS design plan

Post by turdus »

arming wrote:When a programmer designs a program, I suppose that this programmer write the algorithm (for example, in pseudocode), but when the desing is for an Operative system... what?

Are they some examples?
paper, pencil. Believe me, the best.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: OS design plan

Post by Brendan »

Hi,
arming wrote:When a programmer designs a program, I suppose that this programmer write the algorithm (for example, in pseudocode), but when the desing is for an Operative system... what?
Programmers don't design programs, they implement them. When someone (e.g. a software engineer) designs a program, they don't write algorithms - they create diagrams that describe what pieces of a system do and how they interact.

You should do something similar. An OS is a massive thing - break it into pieces (kernel, GUI, shell, text editor, etc), then break each of those pieces into smaller pieces (physical memory manager, virtual memory manager, scheduler, etc), then break each of those pieces into even smaller pieces (free page pools, MTRR handling, memory mapped IO control, etc). For each of those tiny tiny pieces, work out how they interact and design the interface/API.

Once you've done that, you'll have a list of functions you need to implement.


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.
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: OS design plan

Post by arming »

Brendan wrote:Hi,
arming wrote:When a programmer designs a program, I suppose that this programmer write the algorithm (for example, in pseudocode), but when the desing is for an Operative system... what?
Programmers don't design programs, they implement them. When someone (e.g. a software engineer) designs a program, they don't write algorithms - they create diagrams that describe what pieces of a system do and how they interact.

You should do something similar. An OS is a massive thing - break it into pieces (kernel, GUI, shell, text editor, etc), then break each of those pieces into smaller pieces (physical memory manager, virtual memory manager, scheduler, etc), then break each of those pieces into even smaller pieces (free page pools, MTRR handling, memory mapped IO control, etc). For each of those tiny tiny pieces, work out how they interact and design the interface/API.

Once you've done that, you'll have a list of functions you need to implement.


Cheers,

Brendan
Fantastic explanation! Now I understand.

Thanks for all.
User avatar
DavidCooper
Member
Member
Posts: 1150
Joined: Wed Oct 27, 2010 4:53 pm
Location: Scotland

Re: OS design plan

Post by DavidCooper »

arming wrote:When a programmer designs a program, I suppose that this programmer writes the algorithm (for example, in pseudocode), but when the design is for an Operative system... what?

Are there some examples?
[To help you with your English I've made a couple of corrections - hope you don't mind.]

Isn't most of the fun the whole business of coming up with your own design? Ask yourself what you're doing it for: do you want to write your own OS or do you want to write someone else's? Put together your own ideas first, and then take a look at what other people are doing, or put your plan forward for others to comment on.

Write a list of all the things you think will be needed in your OS, then think about the order to build them in and rearrange your list accordingly. There are many parts of your OS which you shouldn't rush into without working out how you really ought to do them - a lot of people paint themselves into corners and then have masses of work to do redoing everything a better way, so if you're in any doubt about something, discuss your plan here to see if that part of your design is likely to cause you problems later on.

You mention pseudocode, and the answer's yes: design your OS in normal language (e.g. "Boot machine", "Get into 32-bit or 64-bit protected mode", "Design/find a mechanism to do multitasking"). Just set out your plans in that manner and expand things into more detailed plans as you build each component of your OS.

What are you wanting to do with your OS that will be better than anything else that's already out there? If nothing, then you're already set on writing someone else's OS.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
User avatar
DavidCooper
Member
Member
Posts: 1150
Joined: Wed Oct 27, 2010 4:53 pm
Location: Scotland

Re: OS design plan

Post by DavidCooper »

berkus wrote:You missed the word Operative, David. While it is possible to use this word (e.g. similar to Executive), the general consensus is to call them Operating Systems.
Didn't even saw that. Hope I answered the wright question and that it wasn't actually about sumthing far mower technical witch I've never heard of.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: OS design plan

Post by arming »

thanks for the english corrections :mrgreen: (I hope I'll pass the First Certificate Exam [-o< )

I'll try XMIND to draw diagrams.
User avatar
DavidCooper
Member
Member
Posts: 1150
Joined: Wed Oct 27, 2010 4:53 pm
Location: Scotland

Re: OS design plan

Post by DavidCooper »

arming wrote:thanks for the english corrections :mrgreen: (I hope I'll pass the First Certificate Exam [-o< )
I've accidentally set an exam for you in my previous post - correct it if you can.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c

MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: OS design plan

Post by arming »

DavidCooper wrote:
arming wrote:thanks for the english corrections :mrgreen: (I hope I'll pass the First Certificate Exam [-o< )
I've accidentally set an exam for you in my previous post - correct it if you can.
No, I can't :mrgreen: .

Well, I'm going to try it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: OS design plan

Post by Solar »

arming wrote:I'll try XMIND to draw diagrams.
Unless you actually intend to use those very early-design diagrams in documentation later, don't bother. Chances are your design will change, especially since you give the expression of not having done much design work before.

Thus, a piece of paper and a pencil will do just fine.

Imagine you're telling someone how a certain piece of your OS works, and how it interacts with other parts. You'll want to scetch down some boxes and lines and stuff. Do just that.

At some later point, you will probably want to learn about some "standard" ways to draw this stuff (like e.g. UML), but for the beginning, pen & paper are quite enough to put things into context. I never used graph software during the (early) design phase, only at later points (for persistent documentation, CASE modelling, or communication).
Every good solution is obvious once you've found it.
arming
Member
Member
Posts: 38
Joined: Sat Dec 10, 2011 6:23 am

Re: OS design plan

Post by arming »

If I want to post my diagram (first I'm going to do the diagram with pencil and paper and then I'm going to pass it to XMIND), in which board have I to post it? And in which format?
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: OS design plan

Post by VolTeK »

turdus wrote:paper, pencil. Believe me, the best
Smart man there.

Or notepad. Believe me, it saves most of the "store in your head" portions of the work and while your probably not use to it, start getting use to it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: OS design plan

Post by Solar »

arming wrote:If I want to post my diagram (first I'm going to do the diagram with pencil and paper and then I'm going to pass it to XMIND), in which board have I to post it? And in which format?
OS Design & Theory is fine. Post it as graphics, i.e., JPG, GIF, PNG, PDF.
Every good solution is obvious once you've found it.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: OS design plan

Post by turdus »

GhostXoPCorp wrote: Or notepad.
If you mean notepad.exe by that, I disagree. You cannot draw diagrams and arrows with it.
CrypticalCode0
Member
Member
Posts: 81
Joined: Wed Nov 09, 2011 2:21 am
Location: Behind a keyboard located in The Netherlands

Re: OS design plan

Post by CrypticalCode0 »

Code: Select all

.   ^
.   |
.<- + ->
.   |
.   v
ANSII art FTW! ;)
Post Reply