www. O S N E W S .com
News Features Interviews
BlogContact Editorials
.
Operating system: from 0 to 1
By Thom Holwerda on 2017-02-14 22:37:09

Probably you asked yourself at least once, how an Operating System (OS) was written from the ground up? You probably have spent years programming, but still understand operating system as a collection of abstract concepts, not how to implement an operating system in actual code. In your mind, somehow the operating system can magically control the underlying hardware and do what you want through the higher level API of your favorite programming language. You wish to understand the details, but for some reason, it seems too difficult because regardless how much you learn, it is never enough. You may feel that you are missing an important piece of the puzzle, and get stuck. However, deep inside you still want to write an operating system without a crystal clear understanding. After all, you are a software engineer, and an operating system is a software. You should know your software better than anyone else!

If that is the case, this book is for you. By going through this book, you will be able to find the missing piece that is essential and enable you to implement your operating system, from scratch!

A free detailed book about writing your first operating system.

 Email a friend - Printer friendly - Related stories
.
Read Comments: 1-10 -- 11-14
.
Like a commercial operating system
By BlueofRainbow on 2017-02-15 02:35:11
Like a commercial operating system, it is released feature incomplete and critical device drivers missing.

Humor aside, it will be interesting to see its developmental journey and compare it with that of current hobby operating systems.
Permalink - Score: 2
.
Its interesting, but limited
By missingxtension on 2017-02-15 03:05:47
How about they just pick up LFS (Linux From Scratch), or just boot of al old FreeBSD where you have to create all your slices and make from there.
Permalink - Score: 1
.
RE: Its interesting, but limited
By Brendan on 2017-02-15 03:37:20
Hi,

> How about they just pick up LFS (Linux From Scratch), or just boot of al old FreeBSD where you have to create all your slices and make from there.

There's a massive difference between learning how to do something yourself (and being able to think of and/or understand all the possible different ways of doing something), and "cut & paste stuff you don't understand".

The latter just means that you'll be screwed later (as soon as something goes wrong, or as soon as you try to extend or improve or change what you don't understand).

It's also the beginning of a slippery slope that leads to "Why not install Ubuntu and replace the boot splash screen image with your own, and just tell people you wrote an OS?"

- Brendan
Permalink - Score: 6
.
RE[2]: Its interesting, but limited
By MarkHughes on 2017-02-15 07:46:43
"There's a massive difference between learning how to do something yourself (and being able to think of and/or understand all the possible different ways of doing something), and "cut & paste stuff you don't understand". "

Exactly, I'm a coder and have long mulled the idea of writing a simple OS, The only reason is to give me a better understanding of what happens. It has to be 100% written by me otherwise it totally fails as an exercise.

Will have a read at this book after I'm done looking into assembly language (which you need to know a bit of for starting up an OS apparently)
Permalink - Score: 1
.
Good beginning
By ThomasFuhringer on 2017-02-15 08:35:16
Nice compilation, but I guess most of the material is also available on sites like http://wiki.osdev.org/Main_Page, albeit less structured.

And it is centered on x86 architecture.
For the beginner, tipping their toe into the pond of OS development, it might be better to dabble with e.g. the Raspberry Pi. It is a less baroque architecture and you sooner get to do the more interesting stuff such as process management rather than spending a massive amount of time on the boot process and memory segmentation.
Permalink - Score: 4
.
RE[3]: Its interesting, but limited
By Lennie on 2017-02-15 12:38:42
> Will have a read at this book after I'm done looking into assembly language (which you need to know a bit of for starting up an OS apparently)

If you look in the Linux kernel, you'll see how much ASM code they use. Last time I looked they had been able to reduce it quiet a bit.

Here is main() for x86/amd64:

https://git.kernel.org/cgit/linux...
Permalink - Score: 2
.
RE: Like a commercial operating system
By dionicio on 2017-02-15 14:56:40
And no like-able hardware to play this on :)
Permalink - Score: 2
.
Comment by drcouzelis
By drcouzelis on 2017-02-15 15:13:13
Oh! Your post reminds me of one of the most incredible books I've ever read! "Code: The Hidden Language of Computer Hardware and Software", by Charles Petzold.

From a review I wrote:
> The author says he always struggles with how to describe this book, and I do too when telling people about it. It’s about how computers work, but it’s written in a unique way as to make it all seem so simple. The book starts with a story about two young boys living next to each other who want to communicate with each other after bedtime, so they start using flashlights to send simple messages to each other. The book then builds, slowly, logically, story by story, little by little, step by step, until by the final chapter you have “built” a fully functioning modern computer.

The book is very engaging in the beginning but slowly starts to drag around the middle until chapter 17 (out of 25) where the author writes, “By the end of this chapter we’ll have invented a machine we can legitimately call a computer“. Oh my gosh, that chapter literally took my breath away, it was that exciting. The rest of the book was fun as well.

The book not only talks about the technical aspects of computers but also the history, explaining who invented what, where, when, why, and how.


It was amazing! :)
Permalink - Score: 4
.
RE[4]: Its interesting, but limited
By FlyingJester on 2017-02-16 18:43:12
If you consider "knowing ASM" to be closely related to knowing about calling conventions, registers and register saving policies, methods of managing the stack manually, and knowing about the privileged instructions, then you absolutely cannot avoid knowing ASM to write an OS.

It is absolutely required to set up virtual memory, perform context switches, make system calls, and respond to interrupts at the very least. Even if you reduce the ASM to just a line or two for each of these operations (except for context switching, that necessarily requires more), you need to know what is happening well enough that you could write the whole thing in ASM.
Permalink - Score: 2
.
RE[4]: Its interesting, but limited
By Megol on 2017-02-16 22:17:04
> > Will have a read at this book after I'm done looking into assembly language (which you need to know a bit of for starting up an OS apparently)

If you look in the Linux kernel, you'll see how much ASM code they use. Last time I looked they had been able to reduce it quiet a bit.
<snip>


... quite a bit.

(Sorry, pet peeve (*^_^*) )
Permalink - Score: 2

Read Comments 1-10 -- 11-14

No new comments are allowed for stories older than 10 days.
This story is now archived.

.
News Features Interviews
BlogContact Editorials
.
WAP site - RSS feed
© OSNews LLC 1997-2007. All Rights Reserved.
The readers' comments are owned and a responsibility of whoever posted them.
Prefer the desktop version of OSNews?