Page 1 of 1

Help me please.....

Posted: Sun Aug 17, 2003 2:25 pm
by bbnose
Now, I'm am a VB programmer and have taken an interest in OS programming. I would like a 'from the beginning' explanation of how I could build an OS from scratch. I do know some C.

Anything and everything will help, thanks.
Brett ???

Re:Help me please.....

Posted: Sun Aug 17, 2003 2:55 pm
by Therx
Steps to world domination (or not) ;D

1. Learn C (full understanding of pointers etc. is required)
2. Learn the basics of assembly
3. Plan what you want your OS to do in detail
4. Research the topics required
5. Start coding
6. Debug
7. Goto Step 5
8. If you get here something's wrong

Good Links:-
http://www.osdever.net/
http://my.execpc.com/~geezer/osd/
http://therx.sf.net/osdev/
http://www.nondot.org/~sabre/os/
http://www.osdev.org/osfaq2/

Topics to Start with:-
GRUB, Multiboot etc.
32bit Protected Mode
GDT, IDT
Paging, Segentation
Memory Management
Device Management
Software/Hardware Multitasking

I before you ask you CAN NOT make an OS in VB enless you first write a windows clone for that VB app to run on. (no don't try that)

Hope this helps

Pete

PS Although its useful to understand how to set up pmode, I don't recommend getting caught up writing a boot sector when there is GRUB out there.

Re:Help me please.....

Posted: Mon Aug 18, 2003 2:11 am
by Pype.Clicker
Pete (aka Therx) wrote:
I before you ask you CAN NOT make an OS in VB enless you first write a windows clone for that VB app to run on. (no don't try that)
Oh, and as Windows is itself (kinda) an OS, it would be a unsolvable problem ;)

Ok Got it.

Posted: Mon Aug 18, 2003 9:12 am
by bbnose
Ok, I've followed your checklist and have learned C overnight. Also, I have learned some assembly code. It's not that difficult in my mind, but still it's confusing because of the many ways of using a command. Now, I'm not asking for code, but would like some good pointers on how and what needs to be in place to write a boot. You said that you didn't think that I should try that, yet I could not use someone elses code to make my OS run. So, I want to do my best at creating a booter. How do you do this and when it's done, how do I copy it to a blank harddrive over a floppy? It seems that these simply answers could be found, but I have looked all over the internet and nothing......
Why use C anyway? I don't know how a computer like this can run a C segment of code if there are no OS's to control it?

And by the way, I was not even considering using VB for an OS. I understand that(sadly) it is only supported on Windows.

Brett

Re:Ok Got it.

Posted: Mon Aug 18, 2003 10:23 am
by Tim
bbnose wrote:You said that you didn't think that I should try that, yet I could not use someone elses code to make my OS run.
Why not? Experience tells me that, if you jump straight in at the boot loader stage, you'll get disillusioned pretty quickly. Use GRUB and get on with the real work of making an OS.
Why use C anyway? I don't know how a computer like this can run a C segment of code if there are no OS's to control it?
C has minimal runtime requirements (it needs a stack, and that's about it). Remember compiled C code is machine code, just the same as assembled assembly code.

Re:Help me please.....

Posted: Mon Aug 18, 2003 11:08 am
by Pype.Clicker
C can be compiled, so C can be turned into a flat pure binary file.
In addition, C require a very little runtime support, so it is easy to make it run even in the absence of an OS (provided that you don't use libraries, but just functions you write, which isn't true for C++)

All this (and more) should be explained in the FAQ.

Re:Help me please.....

Posted: Mon Aug 18, 2003 12:09 pm
by Tux
You forgot 1 link.

www.google.com

Use " to make the searches more exact.
Type in "osdev tutorials" with the quotations and it wiill remove the junk. There are more tricks to google. But that is the most useful one. It also works on yahoo BTW.

And btw, recompile a lot. By doing this. You can figure out what made your kernel go insane out of nowhere saving you the trouble. ???

Keep things simple. The simpler your code is, the easier it is for people to help you.

Something in C you may or may not know, .h files function as .inc in asm. Yes, you CAN put functions in them. Linking .o files makes the kernel bigger BTW. I would use #include's.

Don't abuse the forum. These people are devoted to understanding OSes and they are hooked to them. No, don't try making a forum drama. They take things seriously.
(BTW guys, Linux and Windows tied, which was the plan) ;D

DON'T GIVE UP!! Keep asking for help. Yes, OSdev ain't fully all fun. It's a lot of determination.

Restarting your kernel is a sign of determination, not a sign of failure BTW.

Good Luck!!

Re:Help me please.....

Posted: Mon Aug 18, 2003 12:25 pm
by Tim
Tux wrote:Restarting your kernel is a sign of determination, not a sign of failure BTW.
That's right -- software development is one of the few areas where you don't fully know the specifications to the problem until you've implemented the solution. You will learn as you go along, and several times you'll learn that the code you've already written is wrong.