where to start?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
missdeer

where to start?

Post by missdeer »

hi,
i just wanna design and implement an OS,i know C and a little about 8086 assemble,i have read some books about OS design and implementation,but where shall i start to write a new OS,boot?kernel?or anywhere else?
thanks a lot.
jrfritz

Re:where to start?

Post by jrfritz »

Ok...before I say anthing about kernels...

[glow=red,2,300]People...PLEASE do not make this just like the other "where do I start thread"! That was just nuts![/glow]


Ok...now...

What OS are you going to use for OS development?

Also, I sugesst you use someones bootsector, and use it to load your kernel.

I have some example source if you would like...but it only installes on Linux. ( but people here know how to install it to a floppy using windows too )

Now...floppy I said? yea...for learning you can just make some binary files with the GNU GCC compiler...either DGJPP on Windows or GCC on linux. NASM from http://nasm.sourceforge.net is a good assembler...since you need some assembly in OS dev...you copy your files to the floppy...in other words...for starting your OS you put your OS on a floppy like DOS...instead of crashing your HD ;)
DarylD

Re:where to start?

Post by DarylD »

Couple of hints that helped me:

Use grub for the bootloader, don't be messing about
trying to write a bootsector and bootloader yet, its just not worth it. You will find plenty of examples on the net, how to.

Write to video memory at strategic points in your code, just write a letter A or B for example in the top left so you know how far youre code got.

Don't just test in bochs or VMWare, test on a real PC too.

Write your asm startup code first, this then boots a c kernel. Start with your memory manager, it will help keep a grip on things.
missdeer

Re:where to start?

Post by missdeer »

hi Tom,
i have already know whatever you said,but still thanks all the same.
i hope that you tell me,for example,first make a bootloader,then kernel,and so on.

thanks again.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:where to start?

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 8:29 pm, edited 1 time in total.
Whatever5k

Re:where to start?

Post by Whatever5k »

As for using somebody else's BootSector, i don't recommend this, make your own
No, that's not my oppinion. I use GRUB and yet I know how to make a boot loader. But it isn't worth the effort and just kills time. Go on with the more interesting part of Operating System. Have a look at [1].

1. http://www.gnu.org/software/grub/
Tim

Re:where to start?

Post by Tim »

Perica Senjak wrote:Using somebody else's code is the worst thing you can do, by making your own you learn
I disagree with this too, quite strongly.

OK, I agree that writing a boot sector teaches you:
  • 16-bit real-mode assembly. But you're going to use 32-bit protected mode, aren't you?
  • How to write code to fit within 512 bytes. But why did you spend all that money on getting 512MB of RAM?
  • How to use the BIOS disk routines. But you're going to write your own 32-bit drivers, right?
  • How to write a really small and simple FAT driver. But it's a lot easier to make a better, more elegant FAT driver when you're not restrained by 16 bit code or the 512 byte limit.
  • Things you'll virtually never need to know again, like real-mode address formation (how many people keep asking what the difference between ORG 0 and ORG 7C00 is?), the A20 gate (an IBM hack to keep compatibility with 20-year-old software), and just how long it takes just to write some code to switch to protected mode.
Yep, writing a boot sector is a learning experience -- just not a valuable one. Incidentally, I did have my own boot loader for a while, but I switched to GRUB when I kept finding just as many bugs in my boot loader code as I did in my OS code.
Curufir

Re:where to start?

Post by Curufir »

Tim Robinson wrote: Yep, writing a boot sector is a learning experience -- just not a valuable one.
I disagree, but then again I have before and will again :). I've posted my reasons for people writing a bootsector first in other threads and most of those reasons have very little to do with actual bootsector code.

This is one argument I'm not gonna win however, so I'd say use GRUB like everyone else and save yourself the effort.
Post Reply