AMD64 OS Development

  • Thread starter Thread starter Matt Strum
  • Start date Start date
M

Matt Strum

Hello all!

Is there any assembler that I can get that supports AMD64? I have been
looking at writing a hobby OS. 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!

Is there any advantage you can see of building an OS specifically for the
AMD64 arch. from the ground up. 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!

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? 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!

Matt Strum
 
Matt said:
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
 
Hello all!

Is there any assembler that I can get that supports AMD64? I have been
looking at writing a hobby OS. 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!

Is there any advantage you can see of building an OS specifically for the
AMD64 arch. from the ground up. 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!

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? 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!
I spent months on an OS for the 6502 and it was only 12K IIRC. MS probably
has close to 1000 people just converting, not writing, winxp to 64 bit,
and they're still in beta after about a year. And that's using a high
level language, not all assembly. So what you are thinking about is
probably just a little too much for one person unless you just want a
basic do nothing OS, or you plan on living a long time.:-)

Oh, as86 comes with the linux distro I use. I assume if you got a 64bit
linux distro, the assembler would support the new 64 bit instruction set.
 
good luck, do what you want to do, hope you have success
of some kind, it should be fun for you.if it's for self-use
then why not.
can you please tell me where you are getting your
AMD64 programmers manuals on cd.
many thanks.


Matt wrote...
I just ordered the AMD64 programmers manuals on CD so they
should come soon! Thank you!
 
He did say "hobby os". If that's what he wants to do to occupy his time,
more power to him. I wonder how the likes of Linux got it's roots planted
in the computer world? I'm sure Mr. Torvalds was told he was insane by a
few people himself.

DougH
 
@newssvr28.news.prodigy.com:


thanks for the info but i live in rainy england, so cdrom versions
do not apply to me.
i have found a link on the AMD site to download the manuals though.
for any other little englanders or dare i mention the word those on
or in mainland *europe*, there i managed to say it but it took alot.
now i have to wash my hands or my mouth out.

for u.k and the german and franco run states.
http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_739_
7044,00.html



for usa and canada...
 
DougH said:
He did say "hobby os". If that's what he wants to do to occupy his time,
more power to him. I wonder how the likes of Linux got it's roots planted
in the computer world? I'm sure Mr. Torvalds was told he was insane by a
few people himself.

Indeed... I wasn't suggesting he didn;t do it, it all depends on how far he
wants to go with it.

I've written a basic os myself, for embedded stuff. Nothing fancy, just a
bt of priority task scheduling and cascaded interrupt handlers to improve
performance. It was good fun, but I wouldn't attempt a full blown OS as
there are many elegant solutions already out there that you can freely
modify. If it were a hobby thing, sure, it'll be excellent experience.

Ben
 
I spent months on an OS for the 6502 and it was only 12K IIRC. MS probably
has close to 1000 people just converting, not writing, winxp to 64 bit,
and they're still in beta after about a year. And that's using a high
level language, not all assembly. So what you are thinking about is
probably just a little too much for one person unless you just want a
basic do nothing OS, or you plan on living a long time.:-)

1000 people working on XP 64-bit ? I have the impression that less
than 10% of that is working on Windows. And they are not the best people
around, as they haven't learned about input validation and other
basic stuff in school.

Apple has always had a much smaller group working on their more
advanced and better OS. And they have had better people. Maybe that
is Microsofts problem. Having the HQ so far away from the best
universities.
 
Wes said:
Oh, as86 comes with the linux distro I use. I assume if you
got a 64bit linux distro, the assembler would support the new
64 bit instruction set.
AMD64 support was added to FreeBSD a while back as well.
The BSD preference for compiling everything with the comfort of
the ports system may better suit a person who wanted to keep an
eye on optimizations etc.
 
Back
Top