[haiku-commits] haiku: hrev45820 - src/system/boot/platform/bios_ia32

  • From: alex@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 4 Jul 2013 14:01:14 +0200 (CEST)

hrev45820 adds 1 changeset to branch 'master'
old head: df75e436dde70c3566aaf32b79301a9bf841cb9e
new head: e818b9707ca1fd3c3c019176fae62ef99e46de30
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=e818b97+%5Edf75e43

----------------------------------------------------------------------------

e818b97: Call debug_cleanup() before converting kernel_args to 64-bit 
addresses, fixes #9842.
  
  In debug_cleanup(), if the debug syslog buffer is disabled (the default when
  KDEBUG_LEVEL is 0), then a new buffer is allocated with kernel_args_malloc().
  This is done after kernel_args addresses have been converted to 64-bit, so
  the address the kernel gets will be 32-bit, resulting in the page fault seen
  in #9842. Fixed by moving the call to debug_cleanup() to before
  convert_kernel_args().

                                      [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45820
Commit:      e818b9707ca1fd3c3c019176fae62ef99e46de30
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e818b97
Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Thu Jul  4 11:54:02 2013 UTC

Ticket:      https://dev.haiku-os.org/ticket/9842

----------------------------------------------------------------------------

1 file changed, 5 insertions(+), 3 deletions(-)
src/system/boot/platform/bios_ia32/long.cpp | 8 +++++---

----------------------------------------------------------------------------

diff --git a/src/system/boot/platform/bios_ia32/long.cpp 
b/src/system/boot/platform/bios_ia32/long.cpp
index e672846..d632efc 100644
--- a/src/system/boot/platform/bios_ia32/long.cpp
+++ b/src/system/boot/platform/bios_ia32/long.cpp
@@ -44,7 +44,10 @@ extern uint64 gLongKernelEntry;
 static inline uint64
 fix_address(uint64 address)
 {
-       return address - KERNEL_LOAD_BASE + KERNEL_LOAD_BASE_64_BIT;
+       if(address >= KERNEL_LOAD_BASE)
+               return address - KERNEL_LOAD_BASE + KERNEL_LOAD_BASE_64_BIT;
+       else
+               return address;
 }
 
 
@@ -339,9 +342,8 @@ long_start_kernel()
        long_gdt_init();
        long_idt_init();
        long_mmu_init();
-       convert_kernel_args();
-
        debug_cleanup();
+       convert_kernel_args();
 
        // Save the kernel entry point address.
        gLongKernelEntry = image->elf_header.e_entry;


Other related posts:

  • » [haiku-commits] haiku: hrev45820 - src/system/boot/platform/bios_ia32 - alex