I am new and need help please.

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.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: I am new and need help please.

Post by Troy Martin »

How will I know, that I know assembly like the back of my hand?
I'm the resident high-rank real mode assembly geek here, I'll quiz you :)

Seriously, you'll feel confident enough to take on a small project when you're ready.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post by Love4Boobies »

casualasm wrote:I have always wanted to construct my own operative system for personal reasons.
Operating! Operating system! :P

My suggestion is that you learn a higher-level language. Why? Assembly is great but a project written in it is hard to maintain. It's much more understandable by anyone to spot bugs (or anything else) in C/C++ or whatever other high-level language you might prefer. Besides, coding will be faster. As for the assembly part, I suggest reading the Intel manuals - the official documentation that describes exactly how Intel 64 and IA-32 CPUs work, what you can do with them and their instruction set (i.e. assembly opcodes).

Good luck and enjoy OSDeving! :mrgreen:
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
casualasm
Posts: 7
Joined: Mon Jan 19, 2009 10:37 am

Re: I am new and need help please.

Post by casualasm »

Love4Boobies wrote:
casualasm wrote:I have always wanted to construct my own operative system for personal reasons.
My suggestion is that you learn a higher-level language. Why? Assembly is great but a project written in it is hard to maintain. It's much more understandable by anyone to spot bugs (or anything else) in C/C++ or whatever other high-level language you might prefer. Besides, coding will be faster. As for the assembly part, I suggest reading the Intel manuals - the official documentation that describes exactly how Intel 64 and IA-32 CPUs work, what you can do with them and their instruction set (i.e. assembly opcodes).
Just to get things straight; Intel 64 is the architectural name for when you buy a 64-bit CPU in the electronic store, right? And IA-32 is the common 32-bit CPU... Or am I wrong?

So if I plan on making my OS in only IA-32, I won't have to learn Intel 64, right?
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: I am new and need help please.

Post by Troy Martin »

Yep.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: I am new and need help please.

Post by JohnnyTheDon »

It will still work on Intel 64 processors. Intel 64 processors act exactly like IA-32 processors until you do the Long Mode Enable Dance.
User avatar
GeniusCobyWalker
Member
Member
Posts: 65
Joined: Mon Jan 12, 2009 4:17 pm

Re: I am new and need help please.

Post by GeniusCobyWalker »

If you want an example heres one:
http://forum.osdev.org/viewtopic.php?f=1&t=18955
Full Knowledge in:
GML, Ti-Basic, Zilog Z80 Assembly, SX28 Assembly and Blender
Experience in:
C++,OpenGl,NDS C++,Dark Basic,Dark Basic Pro,Dark Gdk and PSP Coding
Using:
Ubuntu ,GEdit ,NASM ,GCC ,LD ,Bochs
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post by Love4Boobies »

GeniusCobyWalker wrote:If you want an example heres one:
http://forum.osdev.org/viewtopic.php?f=1&t=18955
Not wanting to be rude or anything but please stop spamming around with your half-baked copy & paste kernel, alright? Just a bunch of stuff you got from the Internet that you didn't even put together right. It has nothing to do with what we are discussing and you are confusing the OP.
Last edited by Love4Boobies on Tue Jan 20, 2009 4:33 pm, edited 1 time in total.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: I am new and need help please.

Post by JamesM »

casualasm wrote:
Love4Boobies wrote:
casualasm wrote:I have always wanted to construct my own operative system for personal reasons.
My suggestion is that you learn a higher-level language. Why? Assembly is great but a project written in it is hard to maintain. It's much more understandable by anyone to spot bugs (or anything else) in C/C++ or whatever other high-level language you might prefer. Besides, coding will be faster. As for the assembly part, I suggest reading the Intel manuals - the official documentation that describes exactly how Intel 64 and IA-32 CPUs work, what you can do with them and their instruction set (i.e. assembly opcodes).
Just to get things straight; Intel 64 is the architectural name for when you buy a 64-bit CPU in the electronic store, right? And IA-32 is the common 32-bit CPU... Or am I wrong?

So if I plan on making my OS in only IA-32, I won't have to learn Intel 64, right?
Make sure you don't confuse "Intel 64" and "IA-64". IA-64 is "Itanic" (Itanium), and is a different beastie all together!
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: I am new and need help please.

Post by Troy Martin »

Itanium is kind of, well, unsupported and different, therefore it's hard to find compilers for it. I suggest not messing with the Itanium architecture.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post by Love4Boobies »

GCC supports the Itanium. But ever since the AMD64 specification (which Intel followed for their Intel 64 architecture) they dropped support for it on the desktop market - it's only available for high-end workstations and servers AFAIK. AMD came up with AMD64 because the Itanium had only limited backward compatibility with the existing IA-32 architecture, and we know how important that is in the real world (unfortunately). Intel had no choice; it's all business, right?

The Itanium is in some ways superior to the AMD64 and Intel 64. One of its philosophies is that more work should be done by the compiler, not the hardware, so there are mechanisms through which the CPU hints the compiler, something that is unthinkable for the x86_64. Also, its instruction set is a monster :) It's worth taking the time to go through the manuals after you get a good understanding of how normal PCs work :D
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: I am new and need help please.

Post by Dex »

LordMage wrote:If you want to do ASM only I would study DexOS, I think it is open-source and ASM, there is also MenuetOS, it's cool and fits on a floppy. you could look at thier code to see how certain things are done.
Yes, you got it right LordMage, it's open-source and full ASM.
casualasm
Posts: 7
Joined: Mon Jan 19, 2009 10:37 am

Re: I am new and need help please.

Post by casualasm »

Ok, so i've looked at the DexOS sourcecode. Mainly the kernel.

Only thing is, I get confused on what exactly to read inside OS. Like, should I start studying the coding for the kernel?
And another question: The kernel is executed at the beginning of the code, right? So,

format MZ
use16

Are the first instructions to be executed upon kernel execution, right?

But what exactly is the very first thing that is executed when I start from stratch. I mean, is that the bootloader code?

Creating my own OS is starting to scare me alittle, because I don't have any particular knowledge about hardware. Like where the BIOS starts or what architecture to go for. And when I do find an architecture, I need to read through the entire manual to know what interrupts it has and how data is processed in it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: I am new and need help please.

Post by Love4Boobies »

Hmm... Telling from your post, you don't know assembly. First, learn assembly. Then, take a look on the OSDev wiki. Check out the tutorials there, esp. the Bare Bones and the ones related to boot loaders. I'm too lazy to provide links, but you will find them easily. Those are a good point to start.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: I am new and need help please.

Post by Firestryke31 »

With the architecture, I'd suggest real mode x86, and eventually work your way up to protected mode x86. For hardware knowledge I'd suggest a quick glance through the wiki. If you don't understand something, read something else and come back to it later. If you do real mode x86 you have the BIOS interrupts, so I'd suggest doing a Google search for "Ralph Brown's Interrupt List," which is awesome because it gives you every BIOS interrupt practically ever, and tells you what you need to do to set it up, and what the interrupt does when you call it. It's layout is a little confusing, but once you figure it out it sticks to it pretty well.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: I am new and need help please.

Post by Dex »

casualasm wrote:Ok, so i've looked at the DexOS sourcecode. Mainly the kernel.

Only thing is, I get confused on what exactly to read inside OS. Like, should I start studying the coding for the kernel?
And another question: The kernel is executed at the beginning of the code, right? So,

format MZ
use16

Are the first instructions to be executed upon kernel execution, right?

But what exactly is the very first thing that is executed when I start from stratch. I mean, is that the bootloader code?

Creating my own OS is starting to scare me alittle, because I don't have any particular knowledge about hardware. Like where the BIOS starts or what architecture to go for. And when I do find an architecture, I need to read through the entire manual to know what interrupts it has and how data is processed in it.
Here's some pointers, first the
format MZ
use16
are not instructions as such, they tell fasm, that we are using 16bit code and we want it output as a MZ exe.
Next the bootloader part is not in the kernel, the bootloader is placed on to the first sector and loads a mz exe off the disk called "kenel32.exe", it will load any mz exe called this name.
(You will find the bootloader in the boot folder and the file "boot16.bin" and "boot16.asm"
This makes it easy to update the kernel just by deleting the old "kernel32" and add the new one just like any other file.
As as been pointed out your best start with realmode and forget about kernels and such to start with.
Just start by using a exe bootloader ( like bootprog )and coding bootable programs, this will teach you how to code without any API to help you.
Before i even came close to coding my kernel, i had coded many bootable games, a bootable cdplayer, bootable demos.
See the 512byte compo for ideas.
Post Reply