AMD64 port

Noah yan noah.yan at gmail.com
Wed Jul 4 09:46:51 PDT 2007


I have a quick and offline discussion with Matt about the status of
AMD64 port; and I am starting doing the port. My first task is to get
the kernel source compiled for the 64-bit target. Not sure who else
are currently or interested in working on this and we should
coordinate on the efforts.
Noah

---------- Forwarded message ----------
From: Matthew Dillon <dillon at apollo.backplane.com>
Date: Jul 3, 2007 3:26 PM
Subject: Re: Dfly AMD64 port
:Hi Matt,
:
:that is great and I already have a dual-xeon (32bit) machine installed
:with the latest dflybsd. I have another machine AMD Athlon 64 desktop
:too for this. but i may use a simulator (just approved a license of
:using simics) first.
:
:a cross-build setup and toolchain are probably the first i need to
:make ready.  i tend to test and port bit by bit on a new target, that
:is apparently not the good approach. in general, what the major step
:should be?
:
:Noah
   #1 would be to get the kernel to actually compile with the compiler
   set to a 64 bit target.  This involves creating a platform and cpu
   target for the kernel build.  If you look at a typical DragonFly
   kernel config file you see these lines at the top:
       platform        pc32
       machine         i386
       machine_arch    i386
   The virtual kernel build has these lines:

       platform        vkernel
       machine         i386
       machine_arch    i386
   An AMD64 build would have something like:

       platform        pc64
       machine         amd64
       machine_arch    amd64
   You would then create a skeleton /usr/src/sys/platform/pc64
   infrastructure and a skeleton /usr/src/sys/cpu/amd64 infrastructure,
   just putting in dummy code until you can get the thing to build,
   and set the compiler options to specify a 64 bit target in the
   Makefiles.
   #2 would be to figure out what kind of memory map we want for 64 bit
   mode.  There are certain restrictions due to the way the 64 bit
   page table works.  This needs to be determined because the kernel is
   not relocated when it is loaded.  The first thing locore has to do
   is create the initial mapping of the kernel via the MMU and turn on
   the MMU.
   #3 would be to get the kernel's locore working.  i.e. the memory map
   bootstrap.  Do you have a machine with a serial port that you can just
   stuff bytes out of with outb ?  That's the easiest way to tell if
   lo-boot code is actually getting run.
   After that the primary task is going to be to write the PMAP code for
   the 64 bit kernel.
                                       -Matt





More information about the Users mailing list