Jump to content

OS dev

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
Hey all.
I've already posted it twice. It's either something's wrong with my connection, or admins are in bad mood.

I'm officially canceling my IDE because I'm not enjoying high-level programming. Instead, I want to learn assembly to develop an OS. Let's start simple - 32 vs 64 bit. I want the OS to be used in the near future, so I guess I'll go with 64. Any suggestions/opinions? I need to make the right choice.

Also... General info about assembly? I've just read a bit about it, and it just confused me even more. I'm gonna use Gentoo Linux as my workstation. Which assembly should I chose? Again, I'm using Gentoo Linux, I've never used any kind of assembly before, I'm a C programmer, and I'm most likely going with 64 bit processors.

That's all I need, point me to the right direction.
Thanks. :glare:

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts
There is a de-facto resource for OS development located at this page:
Expanded Main Page - OSDev Wiki

You can do much of it in C, but you will require a bootloader in assembly, preferrably with NASM. Dargueta has a nice tutorial on this in the Assembly tutorials section.

Quote

and I'm most likely going with 64 bit processors.
64-bit operating systems use a 64-bit extension of the x86 intel arch (x86-64), so you will need to learn a lot of x86 intel assembly.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
Yeah I know that website, it's very helpful :)
And C is too. It never disappointed me(well, it did when it comes to windows forms, but I don't need that). I'm glad I've chosen it as my programming language.

About the processor - I didn't know that. But still, You don't tell me you opinion. I want to know which option is better.

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts
There is not a "better one" except the better one to suit your needs, your wording was a bit hard to understand. If you wish to use 64-bit capabilities you may just use the 64 bit versions of the 32 bit operations. You will not be able to compile a 16 bit program or use 16 bit libraries as that is dropped in long mode, that is the only real difference in 64-bit applications in that low level assembly.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
Won't they stop producing 32 bit like they did with 16 and 8?

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#6
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts

AdvMutant said:

Won't they stop producing 32 bit like they did with 16 and 8?
You can run a 16 bit operating system fine on your processor, It is just 64 bit operating systems run in long mode and do not natively support 16 bit processes (unless under compatability mode). It shouldn't matter what your operating system uses, a 64 bit operating system will just be confusing for you in the end, you will need to learn too much to even think about starting because there aren't really any guides to build them. Your system will not need to utilize numbers up to 2^63-1 likely, so it is pointless to take months studying those registers just for the sake of making it 64 bit. And yes, it will take many months to get the bootloader done without a guide.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#7
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
So I'm going 32 bit. As about assembly, should I chose Netwide Assembly?

Posted Image
There is no problem that cannot be solved by the use of high explosives.


#8
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts
There are two common assemblers of that type, FASM (flat assembler) is often used for its simplicity apparently for OS dev work and NASM (netwide assembler) which appears to have more examples such as in our assembly section. We have a set of tutorials; within one part (9A and further) includes a boot loader in NASM of which you can run a hello world OS in a x86 emulator or on floppy, it starts here: http://forum.codecal...ge-part-9a.html
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#9
AdvMutant

AdvMutant

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 438 posts
(hopefully)I'll use NASM.
Thanks :)

Posted Image
There is no problem that cannot be solved by the use of high explosives.