Operating Systems - Tutorial?

Started by
51 comments, last by cdoty 16 years, 10 months ago
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]
Advertisement
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.
Sounds very interesting, I will definitely read them : )
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
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!!!
Quote:Original post by Skeezix
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!!!


All software mentioned so far is free. NASM, Bochs, and PartCopy can all be found for free on the internets (NASM and Bochs, I believe, are at SourceForge).

@Crypter - I'm guessing PartCopy works on XP, but it would be nice if you could include how to make Bochs load an raw image-file, rather than copying the bytes to a floppy disk. This makes it easier for people who don't have a floppy disk. And it's not hard.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
It's maybe also worth discussing how to modify the bochs configuration file to alter its response to panics (i.e. halt and print information, rather than simply print CPU_HALT repeatedly until you hit Ctrl+C).
[TheUnbeliever]
There are already plenty of OS development articles out there (OSDev.org and Bona Fide OS Development immediately spring to mind) already. Besides, this is a game development website, so... but, if you want to write tutorials on the subject, more power to you.

Quote:Original post by Crypter
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.

If you are talking about Bran's Kernel Development Tutorial, I think it goes far enough to get you started, but not too far to force a particular design on you.
The problem with complete step by step tutorials is, the reader is forced to use whatever design the article writer decides on. I don't want to write an OS to copy someone elses design, I want to do so because I have my own design. Instead, the existing tutorials focus on particular topics, which can be slotted into your own individual design. There are seperate tutorials available which discuss the merits of various designs.

EDIT: Saw this post regarding the above:
Quote:Original post by Crypter
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.

That site is more than a single tutorial. It's a colelction of tutorials, articles and other resources related to OS development. How could you possibly say it doesn't go very far? It covers everything from the very basic, to advanced topics such as GUI's, multiprocessor systems and multiple hardware architectures! I would say you would find it extremely difficult to compete with this.

Looking at your website, I notice that you have a number of articles written on writing a bootloader. I think this is a bad idea. The bootloader is not an important part of writing an OS. You should skip it and teach how to write a multiboot compatible kernel instead. Using grub is useful to know and ultimately more powerful than any bootloader most could write themselves. Also, writing a bootloader does little for your actual OS, other than taking time and effort which would be better spent on your kernel. An article explaining what bootloaders do would be good, because if you write a kernel you should know this, but I feel it is not important to actually write your own.

Personally, I would suggest the best thing to do would be to contribute to the OS Development Wiki instead. It has much greater potential to teach people about all areas of OS development in detail (without skipping over alternative approaches for the sake of a step by step tutorial, you could even leave the alternatives for other people to fill in).

Having said all that, if you do write these tutorials, I will be interested in reading them anyway. I am always interested to learn more and so far your style does seem approachable (haven't read the articles yet, but from glancing at them they look decent enough).

Thats my opinion anyway.

[Edited by - issch on June 10, 2007 6:18:25 AM]
I agree with the above poster, certainly in that I think contributing to the OSDev Wiki would be possibly more helpful than writing a tutorial.
[TheUnbeliever]
Quote:
@Crypter - I'm guessing PartCopy works on XP, but it would be nice if you could include how to make Bochs load an raw image-file, rather than copying the bytes to a floppy disk. This makes it easier for people who don't have a floppy disk. And it's not hard.

Of course :) Its actually rather simple. Just change:
floppya: 1_44=a:, status=inserted

to:
floppya: 1_44=Floppy.img, status=inserted 

Where Floppy.img is the boot image.

The Virtual Floppy Disk (VFD) software is used to emulate a virtual floppy drive
for PCs that dont have floppy drives (Like me :) ). It also allows you to
easily add files to it (Like the kernel) through Windows Explorer.

Finally,you can use VFD to save the final floppy as an image file that you
can use with Bochs.


Quote:
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!!!

As others have mentioned, all of the software listed is indeed free.

I can add Bloodshed's compilier to the list of supporting compiliers
on the first page though -- that way I could see if [we] could set up
Bloodshed for the kernel, along with the other listed compiliers.

Quote:
It's maybe also worth discussing how to modify the bochs configuration file to alter its response to panics (i.e. halt and print information, rather than simply print CPU_HALT repeatedly until you hit Ctrl+C).

The configuation file in the tutorial does just that[smile]

When you execute Bochs, whenever you press the Power button, Bochs
logs all error and info messages to a file "OSDev.log", that should be
in the same directory as Bochs.

Here is the lines:
# logging and reporting -----------------------------------------------log:         OSDev.log             # All errors and info logs will output to OSDev.logerror:       action=report info:        action=report


Quote:
If you are talking about Bran's Kernel Development Tutorial, I think it goes far enough to get you started, but not too far to force a particular design on you.

Yep. And that tutorial has one of the worst drscriptions of the GDT I have ever
read.

The problem with most tutorials is that they dont go into detail. They do
not explain "why" and "how" things are done, instead the just explain "What to
do".

What differneates my series from the rest is that mine is aimed toward
beginners. It also explaines everything in great detail.

Quote:
Also, writing a bootloader does little for your actual OS, other than taking time and effort which would be better spent on your kernel.

Actually, the bootloader is independent of the OS, so yes, I do agree.
However, I fell that by using an existing bootloader, it will make
things harder to understand, as it is an abstraction layer.

Also, I have seen alot of people wanting to move away from grub in writing
their own bootloader and having alot ot trouble with it.

By understanding bootloaders in depth, one can learn how everything is
structured in great detail, not to mention, there own bootloader[smile]

----------------------

Just in case anyone is curious, the next tutorial is almost ready.
This tutorial goes over FAT12 in depth, Rings of Assembly Language,
reading sectors off disk, and loading and executing Stage2.

It might be the last time we see the bootloader.

Stage2 will then take control, switch into 32 bit mode and provide
basic exception handling. Afterwords, it will load and execute our
32 bit C kernel.

This is what Im planning, anyway [smile]

This topic is closed to new replies.

Advertisement