64-bit programming

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.
Post Reply
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

64-bit programming

Post by matthias »

I was working on my OS, and I was wondering if I could make a 64-bit OS. But I had a small problem. I needed an 64-bit assembler. Luckily I found one: yasm :) But where can get GOOD information how 64bit-assembly works? And how can I get DJGPP to compile in 64-bit code?
The source of my problems is in the source.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: 64-bit programming

Post by JAAman »

get the reference manuals from Intel and AMD (both not one or the other as each manual has its advantages and there are some differences between Intels x86-64 and AMDs)

download them both in PDF format and order the books also on there website

intels PDFs can be downloaded at <a href="http://developer.intel.com/design/pentium4/manuals/index_new.htm#sdm_vol1">http://developer.intel.com/design/pentium4/manuals/index_new.htm#sdm_vol1 </a>

and the hard copies can be ordered at <A href="http://appzone.intel.com/literature/Search.asp?site=developer&LNavFile=TRUE">http://appzone.intel.com/literature/Search.asp?site=developer&LNavFile=TRUE</a>
just search for the document numbers of the PDF file



Intel docs are in 4 books(used to be 3 when i ordered mine but i just ordered the new ones)
and AMDs are in 5 books i suggest dowloading <b>AND</b> ordering <b>both</b>
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: 64-bit programming

Post by JAAman »

oh ya there all FREE!!

Intel is VERY good at providing complete documentation on everything free on there website
User avatar
matthias
Member
Member
Posts: 158
Joined: Fri Oct 22, 2004 11:00 pm
Location: Vlaardingen, Holland
Contact:

Re: 64-bit programming

Post by matthias »

thanks,

but I will need a lot of time to read them all :(
but I think this is going to work :p
The source of my problems is in the source.
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: 64-bit programming

Post by Legend »

Well, for the 64 bit mode for the Athlon 64 for example, there is not much difference to IA32 assembly anyway. But of course they are significant, but especially when you read that something is missing in long mode, you might still want to know what is gone ;)
*post*
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: 64-bit programming

Post by JAAman »

there are a few differences:
segmentation is gone
hardware multitasking is gone
single-byte INC and DEC are gone (replaced with REX prefix)
and a couple other instructions are not allowed
Legend
Member
Member
Posts: 195
Joined: Tue Nov 02, 2004 12:00 am
Contact:

Re: 64-bit programming

Post by Legend »

I know those ;)

This is already a step, true, but not what I would call significantly so that anyone who knows IA32 assembly could not work on the Athlon!
*post*
DruG5t0r3
Member
Member
Posts: 29
Joined: Thu Mar 24, 2005 12:00 am
Contact:

Re: 64-bit programming

Post by DruG5t0r3 »

Intel actually gave me the full set of books about x86-32 CPUs for free and delivered to my door...I won't give you the URL since Intel won't like me...but still I'm sure if you look, you'll find it.
<h2>-OSdev addict</h2>
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: 64-bit programming

Post by carbonBased »

DruG5t0r3 wrote:Intel actually gave me the full set of books about x86-32 CPUs for free and delivered to my door...I won't give you the URL since Intel won't like me...but still I'm sure if you look, you'll find it.
There's nothing secret about this... Intel and AMD have been giving out process (and other) documentation for free for quire some time. It's in their own best interests to publish this information, otherwise no one would be able to write apps/OSs for their OS.

Intel's docs can be found on: http://developer.intel.com/

AMD's architecture is more easily found through google. A search for x86-64 yeilded exactly what you'd want, as the first item:
http://www.amd.com/us-en/Processors/Dev ... 44,00.html

Personally, I think AMDs architecture is the way to go, and it'll be the first 64-bit architecture I support for my OS. Esp. considering I have no ia64 emulator.

--Jeff
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: 64-bit programming

Post by carbonBased »

btw, I think I'm confusing the issue here... I was first thinking of the 64-bit architecture developed by Intel & HP (which I was under the impression was labelled ia64), while this thread may be talking about the newer "ia32e"

Since ia32e is really just intel's implementation of x86-64 (which AMD developed, and even helped Intel "redevelop") I'll always develop for AMD first... I think they deserve a lot of support, especially from this community. Anyone that remembers http://www.x8664.org/ from the start knows that AMD has been very forthcomming to the open source community.

--Jeff
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: 64-bit programming

Post by bubach »

If you want a small, good assembler that could easily be ported to your own OS i recommend fasm. The newest stable version 1.60 is 64-bit compatible.
It also has a great forum for any questions related to the assembler or os-dev.

Download: http://flatassembler.net/download.php
Documentation: http://flatassembler.net/docs.php
Announcement: http://board.flatassembler.net/topic.php?t=3232
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
Post Reply