Sign in to follow this  

Operating Systems - Tutorial?

This topic is 3839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everone, I seen quite a few members here that seem to be interested in developing their own operating system. I have been thinking for some time: Why not develope a tutorial for it? There are indeed resources on the internet, but none of the resources are very easy for beginners. I have also seen only *one* step-by-step tutorial on it--and it doesnt go that far. What I am thinking of doing is developing a series of tutorials from the ground up, and from scratch.
  • Bootloaders
  • Kernel initialization and setup
  • Loading and reading FAT12 from BIOS
  • Mixing C and x86 Assembly
  • Filesystems
  • Low and High Level Memory Managers
  • The Kernel
  • Creating a command shell
  • 32bit protected mode, gdt, idt, and ldts
  • A20, keyboard and mouse input
...And more. The basic idea is creating a 32bit (Mabey graphical) operating system from scratch. As this is meant for beginners, I decided to put it here. Who knows, mabey it will be a small gaming OS[grin] If anyone is interested, let me know[smile]

Share this post


Link to post
Share on other sites
sure, it would be very usefull if it was done correctly.

I am not saying that you do not have the correct skills to do it, as I do not know you. Though, I am going to go ahead and ask..."have you created all of this before and know the differences to go about doing it, and the pros and cons of each way?" I hope that didn't sound rude where I am just saying that you do not have the skills. I didn't mean it for it to sound like that.

EDIT: Never mind. I just saw your signature. I take back what I said up above...

Chad

Share this post


Link to post
Share on other sites
Im currently creating a 32bit graphical OS myself, and know how hard it can be.

(Currently rewriting my two stage bootloader for better support for FAT12,
so the disk image can be read by Windows)

Dont worry--alot of the kernel is already written [smile]

Share this post


Link to post
Share on other sites
Im thinking of using NASM and C for simplicity.

It is possible with C++, however C++ is a bit harder to set up
to work properly.

What I mean by this is that you will need to create a workable
envirement for the languages to work in. (For example, defining
the global operators for C++, such as new and delete; allocating
space for ctors and dtors in the memory map, etc...)

C, as being a lower level language then C++, doesnt require
the envirement C++ needs, and hence is easier.

I will be stressing OOP and OOD princables as well as good
coding practices.

Im also thinking of using DJGPP as it is easier and more available
then other methods (Cygwin is less avilable, Visual Studio 2005
can be very tricky to set up for OS development).

If there are any suggestions on these languages (or the use of compiliers),
please let me know.

And thanks for the positive feedback so far! [smile]

Share this post


Link to post
Share on other sites
Just a couple of questions, no offence intended.

I think it's a complicated subject for writing tutorials, people bitch on Windows while there are countless people working on it who know what they're doing.

If you want to write tutorials they have to work on every piece of hardware the users of you're website have. How are you planning to cope with all combinations of different hardware?


  • What sections of the O.S. are you planning to write in Assembly? (My advice: only the bootloader, move away from assembly to some higher level asap.)

  • How are you planning to implement the C/C++ standard library?

  • What executable file format will you be using?

  • What kind of kernel will you make (monolithic, micro-kernel, etc)?

  • Are you planning to create you're own filesystem e.g. MyFS or make it compatible with Linux or MS - Windows?



I really don't mean to be negative, but creating a fully funtioning O.S. is a daunting task. But there's always some inspiration available so have a look!

MenueT OS

Share this post


Link to post
Share on other sites
I would have to say that I consider this approach a bad one. There are many different choices that needs to be made and with a walk-through approach like you propose the user wouldn't be exposed to all the different ideas. It can also very quickly become a copy-paste challenge because the user doesn't understand the rationale behind decisions and are able to make their own decisions (this also happens in the game programming introduction tutorials).

With an approach like what you propose how do you intend to expose your readers to several page replacement algorithms and their implementations? How about different addressing modes like direct addressing, segmentation or paging. How will you expose your readers to the variety of ways of handling addressing and its related algorithms?

I think the proper way to teach people about operating systems is to teach the concepts and start from a higher-level than the bootloader (maybe scheduling, process management or something like that) and then, when people completely understand all the concepts then they can start learning how to implement it, which shouldn't be hard at that point. Therefore I find the approach used by books like Operating system concepts.

There are just so many concepts that you can't hope to cover more than a small fraction using a walk-through tutorial.

Share this post


Link to post
Share on other sites
OS development, cool thing. I've always been interested in that subject but I've never started working on it. I think that is because the lack of good tutorials. Like other people said, most tutorials are all step by step do this, do that. It's never about "why would you do something like that?".

So, definitly a cool thing! I'm very interested to read it :) But I'm wondering if it's something for gamedev.net?

Share this post


Link to post
Share on other sites
Quote:

If you haven't already done or know this site, than take a look.
Bona Fide OS Development

I know about that site. That is the "only one step by step tutorial"
err... tutorial that I know of. And, as previously said, it doesnt
get very far.

Quote:

I think it's a complicated subject for writing tutorials, people bitch on Windows while there are countless people working on it who know what they're doing.

Im not to sure what you mean here. Are you referring to "Linux being more
sutable then Windows"? If so, then I would have to agree.

This is one of the reasons why I plan on developing this on a Windows
platform--to demenstrate how its done.

Quote:

If you want to write tutorials they have to work on every piece of hardware the users of you're website have. How are you planning to cope with all combinations of different hardware?


In the early stages, we dont need to worry about this. I test my OS code
on about 4 kinds of computers to insure compatibility... Laptops and PCs.

Quote:

What sections of the O.S. are you planning to write in Assembly? (My advice: only the bootloader, move away from assembly to some higher level asap.)

Only the bootloader, and a thin HAL layer for the kernel providing
routines that must be in assembly. (Like an inp() and outp() routines)

The Kernel will be in C.

Quote:

How are you planning to implement the C/C++ standard library?

...As a seperate library module?

Only when we need to. The standard library is very large, so we most likley
will only provide routines we use, and ideas and suggestions for adding to it.

Quote:

What executable file format will you be using?

Im thinking of using ELF for its simplicity. I have been looking
at PE and MZ though as well.

Quote:

What kind of kernel will you make (monolithic, micro-kernel, etc)?

Im thinking about a microkernel. (It just seems more logical that way to
me[smile])

Quote:

Are you planning to create you're own filesystem e.g. MyFS or make it compatible with Linux or MS - Windows?

One that is compatible with Windows. Because this is a floppy image,
Im thinking of using FAT12.

Quote:

With an approach like what you propose how do you intend to expose your readers to several page replacement algorithms and their implementations? How about different addressing modes like direct addressing, segmentation or paging. How will you expose your readers to the variety of ways of handling addressing and its related algorithms?

Direct addressing and segmentation are failry basic assembly language topics.
Paging, however, is planned to be in the tutorials.

Quote:

I think the proper way to teach people about operating systems is to teach the concepts and start from a higher-level than the bootloader (maybe scheduling, process management or something like that) and then, when people completely understand all the concepts then they can start learning how to implement it, which shouldn't be hard at that point. Therefore I find the approach used by books like Operating system concepts.

This seems like an interesting idea.

Any other suggestions are welcome.

[Edited by - Crypter on June 6, 2007 8:28:38 AM]

Share this post


Link to post
Share on other sites
Quote:

So, definitly a cool thing! I'm very interested to read it :) But I'm wondering if it's something for gamedev.net?

Thats something I was asking myself actually. Its not neccessarily
"game related", however it would fit under "General programming"
or "Platform specific".

I feel alot of new members can learn a great deal of how programs
work and communicate with the system. Understanding how the system
works under the hood in detail might aid in understanding programming
from a deeper perspecitve.

Not to mention, its cool[grin]

Share this post


Link to post
Share on other sites
I've been trying to write a good bootloader and a simple kernel so i know it's a daunting task. Writing a good bootloader takes more time than a simple kernel and you need to know the hardware well. If you think you can write a good tutorial (or a couple of) than i'd glady read it :) But know what you're getting yourself into because writing tutorials is hard since not everyone knows what you know and getting the knowlegde across can be really hard. I wish you the best of luck! :)

Share this post


Link to post
Share on other sites
Hello everyone,

I am looking for responses on both writing style, and layout.

Currently, the series will be hosted on my website.
Also, it is based off the layout of GDNets articals for both
simplicity (Everyone is familiar with them) and the design
itself fits quite nicely.

The first artical is an introduction, and describes what
tools [we] will be using, as well as alternitaves.

Currently, Im planning on support for both DJGPP and Visual
Studio 2005.

I am trying CTar's suggestion, as I too feel it would work rather well.

Artical #1

What do you think? Any questions, comments, suggestions of any kind
can only improve this artical (and the series), so anything is welcome.

Share this post


Link to post
Share on other sites
I guess you will correct spelling and such of the articles later. I've read what you have written and I have absolutely no experience in OS development. I'll be sure to follow along and try to work my way through it and see if I can learn a thing or two.

Great initiative and work. I hope you'll get far.

Share this post


Link to post
Share on other sites
I am also looking forward to reading your articles on OS development. I was looking into it late last year, but I had a load of College work to get done until last week, so I never really picked it up. Anyway, good luck with the writing :D.

Share this post


Link to post
Share on other sites
My Website will hold links to all the tutorials in the series.

The second tutorial is up, however I might not be complete with it yet.

I will do my best to make the tutorial very easy to follow.

If there are any questions or suggestions reguarding the tutorial, please PM or email me and Ill see what I can do[smile]

Share this post


Link to post
Share on other sites
Tutorial 3: Bootloaders

From tutorial 4 onward, things are going to be slowing down simply
because of its complexity (I will be building an actual progressive
OS)

This is also a bump to see if anyone else may be interested.

Any Comments, Questions, or suggestions, please let me know.

Share this post


Link to post
Share on other sites
I must say you write some easy to understand tutorials. I have read the Bona Fide OS Tutorials and yours seem to be on a different level, one that even a complete newbie can comprehend. I like how you start out with the history first and how you explain each line of code thoroughly.

Operating Systems have always intrigued me. Keep up the good work and I can't wait to read more.

- DreamGhost

Share this post


Link to post
Share on other sites
wow what a great idea it is.
i would really be interested on os development.
KEEP UP THE GOOD WORK!!!

PS.
can you please use free softwares (compiler and the likes) in creating the os
so that everyone can start following and will be able to do it.(bloodshed's compiler is good)
tnx!!!

Share this post


Link to post
Share on other sites

This topic is 3839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this