[haiku-bugs] Re: [Haiku] #6310: Haiku x86_64 kernel port

  • From: "mmlr" <trac@xxxxxxxxxxxx>
  • Date: Fri, 17 Sep 2010 09:16:20 -0000

#6310: Haiku x86_64 kernel port
----------------------------+-----------------------------------------------
  Reporter:  nmentley       |         Owner:  axeld
      Type:  enhancement    |        Status:  new  
  Priority:  normal         |     Milestone:  R1   
 Component:  System/Kernel  |       Version:       
Resolution:                 |      Keywords:       
Blocked By:                 |   Has a Patch:  1    
  Platform:  x86-64         |      Blocking:       
----------------------------+-----------------------------------------------

Comment (by mmlr):

 I've attached Nathans work as of the end of the GSoC coding period here.
 The following is a quote of his mail explaining the different parts. I've
 put all of the patches in this ticket as that seems more straight forward.
 Please anyone feel free to review/commit as I won't have the time for the
 foreseeable future.

 {{{
 I have the majority of the code written out... based on the x86
 code for obvious reasons, but with parts taken out... like vm86 and so
 on. I have most of the assembly converted to x86_64 equivalent code, but
 not all of it. It proved to be a more difficult challenge that I
 expected. Like I said earlier. There are sections of the kernel that
 just aren't finished. SMP is nonexistent and paging isn't taking
 advantage of the top level paging directory. Furthermore I can't get the
 system to successfully jump into long mode if I setup the code inside
 haiku_loader instead of initializing long mode after jumping to the
 kernel.

 I've included 6 patch files. The 64bit_safe_kernel.patch just changes a
 few lines of code in non arch specific source files that weren't
 originally 64bit safe. For example assumptions that pointers would fit
 nicely in uint32s... Also typecasting to get FixedWidthPointers working
 were common as well.

 The buildsystem.patch sets x86_64 to use the bios_ia32 platform. It adds
 a /build/jam/BootloaderRules file filled with bootloader rules instead
 of having (if _BOOT_MODE) inside of the KernelRules. It also includes
 all the jamfiles for haiku_loader that would get changed by the
 BootloaderRules. The patch also includes the linker scripts for x86_64.
 I'm still using Target_Kernel_PIC_Linkflags to set the minimum paging
 size of the kernel to 4kb. I'm manually passing PIC_LINKFLAGS in the
 kernel jam file instead of using Target_Kernel_Linkflags. I'm not sure
 why just using Target_Kernel_Linkflags is failing, but the
 Kernel_Pic_Linkflags is just a temporary work around.

 The system.headers.patch is simply just the x86_64 headers. There are a
 few changes to a few x86 header files, but those were just to allow both
 x86_64 and x86 to run on the same bios_ia32 platform. Similar
 arch_kernel_args are needed and the GDT file structure needed to be
 changes to allow toggling between setting up a 32bit or 64bit gdt. One
 oddity is headers/private/kernel/boot/arch.h. Instead of just adding the
 5 additional lines. svn diff deletes the whole file and rewrites it. I
 can't figure out why.

 The x86_64_support_source.patch contains x86_64 libroot files that are
 used by haiku_loader x86_64 and kernel_x86_64. This patch also includes
 a few changes to haiku_loader that were suggested by Ingo in response to
 the last time I posted patches.

 The x86_64_kernel_sources.finished.patch is a patch of files that I feel
 are the more complete part of the kernel code. Almost all the c++ code
 is included in that patch. The smp and paging code isn't in this patch.

 The x86_64_kernel_sources.unfinished.patch contains files that aren't as
 finished as the rest. Alot of the assembly is here. A lot of the files
 in this folder only have a few parts in need of repair.
 }}}

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6310#comment:2>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: