Where should I get started?
Where should I get started?
I'm not starting an operating system yet, but how can I practice programming that is similar to coding an operating system so I can be used to the assembly, the (in my opinion overused) preprocessor, and file systems. No code I have seen is like an operating system at all, and I just want to prepare myself to code.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Where should I get started?
It sort of depends on what you already know. How much experience do you have with C/C++/whatever language you intend to write your OS in? The assembly pieces can be made pretty minimal, unless you want to write the whole thing in assembly.
Re: Where should I get started?
I am pretty decent with C++, I know about structs, classes, pointers, loops, reference, such stuff like that, and I am now learning STL.
- NickJohnson
- Member
- Posts: 1249
- Joined: Tue Mar 24, 2009 8:11 pm
- Location: Sunnyvale, California
Re: Where should I get started?
Well, the STL won't help you very much in a kernel environment, since you'd have to implement it yourself; otherwise, it sounds like you have a reasonable amount of C++ knowledge. I started my first OS when I had about a year of C experience, and was able to get at least some stuff working. The trickiest parts of kernel development are sort of idiosyncratic to kernel development, and depend as much on your ability to read complex hardware documentation as on your coding skill. You may not quite be ready yet, but the fact that you acknowledged that you might not be shows you are more sane than a lot of people who try.
I would personally recommend attempting this tutorial. It's pretty good, although it has many known bugs (mostly later on) and some pretty major design flaws. IMO, one of the more useful effects of following it is just getting a working development environment and a screen printing function. It uses C; if you want to use C++, you'll need some additional runtime support, which is explained on the wiki under C++ Barebones.
I would personally recommend attempting this tutorial. It's pretty good, although it has many known bugs (mostly later on) and some pretty major design flaws. IMO, one of the more useful effects of following it is just getting a working development environment and a screen printing function. It uses C; if you want to use C++, you'll need some additional runtime support, which is explained on the wiki under C++ Barebones.
-
- Member
- Posts: 141
- Joined: Thu Jun 17, 2010 2:36 am
Re: Where should I get started?
Just from the way you described your knowledge, it sounds like you're still learning the basics. You can learn everything about C\C++ fairly quickly, but to get to a point where you're actually decent at using them is another thing entirely. When I look at the code I wrote when I was learning C++, pretty much everything about it makes me go "what the hell was I thinking?!". Even 3 years after beginning to learn C++ I can still find myself struggling to find ways to do things efficiently.iris wrote:I am pretty decent with C++, I know about structs, classes, pointers, loops, reference, such stuff like that, and I am now learning STL.
I'm not saying you should have X amount of experience before you think about writing an OS, but having a firm grasp on C is basically assumed by any material on the Wiki, as well as most other places. The more inexperienced you're, the buggier the code you write will be, which is a big issue when writing a kernel as debugging is much more difficult. You'll also have to be much more self sufficient, because finding help on kernel code is much more difficult than normal stuff.
There really is no harm in trying though. You might end up with nothing to show off, but you will learn A LOT if you apply yourself. If you're interested, I'd suggest reading through JameM's tutorial and see if you can keep up. If you understand it, than I'd setup an environment (Cygwin\Bochs\Qemu\GCC\etc) and see if you can get everything working. When I started OS development I had zero experience with the GNU toolchain, which made things extremely difficult for me. In retrospect, I'm glad I stuck through it though, because familiarity in the GNU toolchain has helped me a lot in other areas.
Whatever you do, good luck (you'll need it ).
Re: Where should I get started?
DOS programming is probably the best training for OS-dev. It's 16 bit which is perfect for the real mode Assembly bits needed in the boot loader, but you could also use C with a DOS extender to get more knowledge.
Re: Where should I get started?
Yeah, I was planning on a DOS. I understand a lot so far, that bootloader executes kernel, kernel executes the features, or GUI if you have one.
-
- Member
- Posts: 63
- Joined: Sat Apr 28, 2012 9:41 am
- Location: Earth -> Asia
Re: Where should I get started?
You could try Brans Kernel Development Tutorial for its simplicity.If you are very very very very new to kernel development, brokernthorn osdevelopment tutorials will help you.If you want to a Unix or a Linux based kernel, JamesM will take a trip to x86 Unix Cloan.Also there are tutorials here too.
Anyone has a idea of making a ntfs bootsector?if yes PM me , plz.
Re: Where should I get started?
Before I start the tutorials, I just have one question. Should I run my DOS via partition? Or through a VB. Oh, and how do I install NASM through Ubuntu? Thanks.
~iris
~iris
Re: Where should I get started?
Type "sudo apt-get install nasm" at the command line.iris wrote:Oh, and how do I install NASM through Ubuntu?
Re: Where should I get started?
That's one way of letting people know what you think about NASM. I would personally recommend fasm, but yasm is "ok".berkus wrote:sudo apt-get install yasmiris wrote:Oh, and how do I install NASM through Ubuntu? Thanks.
Re: Where should I get started?
hmm, i think there is some very small differences you might have to make, like use16/use32 and org 0x300 instead of [BITS 16]/[BITS 32] and [ORG 0x300] for example. but all in all, it took like 2 minutes to fix so nothing serious at all.
you might still argue that it's not good enough, but fasm has many other advantages, it's very easy to port, self assembling, small, very quick to add support for all the newest op-codes (some even before the cpu is released), very advanced macro support. btw, i would bet that there's macros out there to make it 100% nasm compatible.
you might still argue that it's not good enough, but fasm has many other advantages, it's very easy to port, self assembling, small, very quick to add support for all the newest op-codes (some even before the cpu is released), very advanced macro support. btw, i would bet that there's macros out there to make it 100% nasm compatible.
Re: Where should I get started?
Thanks, I really thought I was going to use virtual box as a testing evironment, but bochs seems better.
Re: Where should I get started?
Are pointers used in OS design? I've been wondering, I'm assuming yes, of course, but just wanted to confirm. Also, what are some good IDE's?
- AndrewAPrice
- Member
- Posts: 2303
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Where should I get started?
The definition of a pointer:iris wrote:Are pointers used in OS design? I've been wondering, I'm assuming yes, of course, but just wanted to confirm.
At some point in your OS you'll have to access various locations in memory - so pointers are required.Wikipedia wrote:In computer science, a pointer is a programming language data type whose value refers directly to (or "points to") another value stored elsewhere in the computer memory using its address
Eclipse, NetBeans, Emacs, Vim, Visual Studio, CodeBlocks, UltraEdit, KDevelop, the list goes on..iris wrote:Also, what are some good IDE's?
Last edited by AndrewAPrice on Thu May 24, 2012 1:43 pm, edited 1 time in total.
My OS is Perception.