View Single Post
  #2  
Old March 20th 04, 10:22 PM
Ben Pope
external usenet poster
 
Posts: n/a
Default

Matt Strum wrote:
Hello all!

Is there any assembler that I can get that supports AMD64? I have been
looking at writing a hobby OS.


You want to write an OS in assembler?

What features would you like it to have?

Why would you use assembler? That sounds like a whole lot of work to end up
with an OS that is non-portable, hard to maintain, hard to write, slow to
write and at the end of the day, probably slower than code generated by say,
gcc.

Yes, it IS possible to write code that is more efficient in assembler than c
or C++, but you need to have a pretty good idea of how the target CPU works.
Most modern compilers will have a much better idea of which variables to
stick in registers than you, they will likely have a better understanding of
the CPU than you and will allow you to write code in much less time.
However, it is usually much better to write some c, profile it and then
optimise particular functions in assembler should you feel the need.

Average lines of code written per day is largely independent of the language
used, but one line of C++ could equate to somewhere between 1 and several
hundred lines of assembler, depending on the libraries you use.

I believe that this arch. is the future so
I figure I will write the ASM optimized for it. I have used M68000
programming, so I will need to update my skills!


Hmm. I wonder what the comparisons are for instruction set size and number
of addressing modes. I would think that it's considerable.

Is there any advantage you can see of building an OS specifically for the
AMD64 arch. from the ground up.


Not really. Use Linux.

As Intel has jumped on this, my OS could
also run on Intel machines. I, of course, will include 64-bit mode by
default.

Any opinions? I just ordered the AMD64 programmers manuals on CD so they
should come soon! Thank you!


Good luck.

I think you're insane if you want to write your own OS. Linux is widely
available and supports AMD64. Development tools are widely available for
Linux. Applications are widely available. Support is widely available.

Do you believe I could write parts of the OS much different than current
operating systems figuring that I am writing specifically for 64-bit?


Different? Yes. Better? Maybe, but only if you are targeting something
very specific.

I am reading a lot of things out there for writing operating systems
and they talk about the big changes and advantages from using 32-bit
protected mode. I want to have something that is specifically for 64-bit
mode!


Sounds to me like you are taking on too much - I don't think you realise
quite whets involved. Anyway, if you do get this OS up and running, why
should I choose an OS without any supporting applications, over say, Linux?

Linux fully supports AMD64 and the best part is that it is written in a
portable language c/C++. Nearly everything is open source, so you can
recompile it to support your CPU. Take a distro like Gentoo - if you want,
you can compile EVERYTHING that will ever get run on your OS, from the
kernel and drivers through to your email client and news reader.

I think you should write down the drawbacks of an OS such as Linux and see
where you could improve on them. If you still think that you should start
from the ground up, rather than patching the Linux kernel source you are
probably mad or have far too much spare time. :-p

Ben
--
A7N8X FAQ: www.ben.pope.name/a7n8x_faq.html
Questions by email will likely be ignored, please use the newsgroups.
I'm not just a number. To many, I'm known as a String...