History log of /haiku/src/system/boot/platform/bios_ia32/debug.cpp
Revision Date Author Comments
# 68d37cfb 30-Dec-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix definition of PAGESIZE and B_PAGE_SIZE

On sparc, the minimal page size we can use is 8K. Since B_PAGE_SIZE and
PAGESIZE defines were hardcoded to 4K, this resulted in a lot of
confusion in all code trying to manipulate pages.

- Remove cpu.h from headers/private/kernel/arch/*. It dates back from
NewOS and was not used anymore since our kernel uses B_PAGE_SIZE
(PAGE_SIZE was the only thing defined in this header).
- Add posix/arch/*/limits.h with the arch specific page size and include
it from the main limits.h.
- Adjust bios_ia32/debug.cpp which was the only place using the
PAGE_SIZE constant from the deleted headers.
- Change OS.h to define B_PAGE_SIZE to be the same as POSIX PAGESIZE.
- Define PAGESIZE in the build header if the host OS doesn't.

Change-Id: I8c3732cf952ea3c2f088aa16d216678fbf198b96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3558
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 2d697067 27-Jan-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Further cleanup/optimization of system_time

On gcc4, we can use the __rdtsc builtin. On gcc2, provide a similar
inline-able version of rdtsc, and remove the rdtsc function written in
assembly, saving a call/ret on every call.

There has been some discussion about performance, but note that this is
only bootloader code, it is not used when the system is up and running,
therefore performance is not that critical.


# 8540ec24 19-Jan-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Save previous session's debug syslog during boot

Add boot loader debug menu option "Save syslog from previous session
during boot". If enabled (defaults to true), the previous session's
debug syslog data is copy to a separate buffer and passed to the
kernel, which writes it back to the file /var/log/previous_syslog.
As long as Haiku still boots, this should now be the most convenient way
to retrieve the output from a kernel crash.


# 33def425 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: bios IA32: Add optional timestamps to debug output


# 62d36f98 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Removed the addr_t conversion operators from FixedWidthPointer which makes comparison against NULL work properly.


# d8efc6ca 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changes to kernel_args to make it identical for x86 and x86_64.

* Added a FixedWidthPointer template class which uses 64-bit storage to hold
a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
within it. This is necessary due to different alignment behaviour for
32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
the x86_64 kernel and the loader, excluding the preloaded_image structure
which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.


# 5e78920c 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added platform_debug_get_log_buffer() which returns the debug log buffer and
its size.
* Added "Display current boot loader log" item to the "Debug Options" boot
loader menu. It displays what the boot loader has logged so far. Might be
interesting for early boot issues when serial debugging is not possible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42134 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e8aa19c 10-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* The boot loader does now set up an IDT that allows it to catch processor
exceptions (page faults and the like). The handler dumps possibly interesting
information (registers, a (numerical) stack trace) to the serial output, and,
if possible, also to the screen. That should help debugging boot loader
crashes.
* For the IDT the boot loader sets up for the kernel the descriptors are set up
the same way, so until the kernel initializes the IDT itself (arch_init()) the
facility is still in place and can thus catch very early kernel boot crashes.
Unfortunately the on-screen output doesn't seem to work anymore at that point,
so the output only goes to the serial port...
* ... and to the debug syslog -- dprintf() does now append it there after
debug_cleanup() has been called. Seems to work fine in qemu, but when I tested
it on real hardware the debug syslog was gone.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b110c63 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Postpone clearing the debug syslog buffer signature to the time when going
to start the kernel with the option disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8d25a30c 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the location for the debug syslog buffer from 16 MB to 63 MB. On my
machine the previous location was overwritten, probably by GRUB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35817 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 28a2172c 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel:
* The kernel syslog ring buffer is no longer emptied by the syslog sender
thread. Instead we only drop the oldest data from the buffer when we're
writing to it and there's not enough free space in it.
Advantages: We drop old data rather than the most recent data when the buffer
is full. The "syslog" KDL command has more data available now. So the odds
are that kernel syslog messages not written to disk yet are at least still
in the kernel buffer.
* Changed dprintf_no_syslog() semantics: Now it writes to the syslog, but
doesn't notify the syslog sender thread.

boot loader:
* Added the ring_buffer implementation and a dummy user_memcpy().
* bios_x86: Moved the syslog stuff from serial.{cpp,h} to debug.{cpp.h}.
* Moved the debug options from the "Select safe mode options" menu to a new
"Select debug options" menu.
* Added option "Enable debug syslog" to the new menu (ATM available on x86
only). It allocates a 1 MB in-memory buffer for the syslog for this session
in such a way that it can be accessed by the boot loader after a reset.
* Added item "Display syslog from previous session" to the new menu, doing
what its name suggests.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35816 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8540ec2446d1fda22904ace548570b73d91f4726 19-Jan-2014 Ingo Weinhold <ingo_weinhold@gmx.de>

Save previous session's debug syslog during boot

Add boot loader debug menu option "Save syslog from previous session
during boot". If enabled (defaults to true), the previous session's
debug syslog data is copy to a separate buffer and passed to the
kernel, which writes it back to the file /var/log/previous_syslog.
As long as Haiku still boots, this should now be the most convenient way
to retrieve the output from a kernel crash.


# 33def4258ee66c2d0a2a28c8374f5562c4e3f00a 08-Oct-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

boot loader: bios IA32: Add optional timestamps to debug output


# 62d36f98331067e472188f6c020c2ccd808f48cf 22-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Removed the addr_t conversion operators from FixedWidthPointer which makes comparison against NULL work properly.


# d8efc6caf6babe278c48e8aa3277376fb68ff455 21-Jun-2012 Alex Smith <alex@alex-smith.me.uk>

Changes to kernel_args to make it identical for x86 and x86_64.

* Added a FixedWidthPointer template class which uses 64-bit storage to hold
a pointer. This is used in place of raw pointers in kernel_args.
* Added __attribute__((packed)) to kernel_args and all structures contained
within it. This is necessary due to different alignment behaviour for
32-bit and 64-bit compilation with GCC.
* With these changes, kernel_args will now come out the same size for both
the x86_64 kernel and the loader, excluding the preloaded_image structure
which has not yet been changed.
* Tested both an x86 GCC2 and GCC4 build, no problems caused by these changes.


# 5e78920c127914641b54a79ce41cb7120b6615fc 12-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* Added platform_debug_get_log_buffer() which returns the debug log buffer and
its size.
* Added "Display current boot loader log" item to the "Debug Options" boot
loader menu. It displays what the boot loader has logged so far. Might be
interesting for early boot issues when serial debugging is not possible.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42134 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e8aa19c638e27939fd6aaa4e2570b2411e15368 10-Jun-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

* The boot loader does now set up an IDT that allows it to catch processor
exceptions (page faults and the like). The handler dumps possibly interesting
information (registers, a (numerical) stack trace) to the serial output, and,
if possible, also to the screen. That should help debugging boot loader
crashes.
* For the IDT the boot loader sets up for the kernel the descriptors are set up
the same way, so until the kernel initializes the IDT itself (arch_init()) the
facility is still in place and can thus catch very early kernel boot crashes.
Unfortunately the on-screen output doesn't seem to work anymore at that point,
so the output only goes to the serial port...
* ... and to the debug syslog -- dprintf() does now append it there after
debug_cleanup() has been called. Seems to work fine in qemu, but when I tested
it on real hardware the debug syslog was gone.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42092 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6b110c63fdfb8119069914e0c43267fb92414994 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Postpone clearing the debug syslog buffer signature to the time when going
to start the kernel with the option disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35823 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8d25a30c3f091ad9654918fd149db1a66082626b 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the location for the debug syslog buffer from 16 MB to 63 MB. On my
machine the previous location was overwritten, probably by GRUB.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35817 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 28a2172c3f19a34e31ba20085148e5428544823a 11-Mar-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

kernel:
* The kernel syslog ring buffer is no longer emptied by the syslog sender
thread. Instead we only drop the oldest data from the buffer when we're
writing to it and there's not enough free space in it.
Advantages: We drop old data rather than the most recent data when the buffer
is full. The "syslog" KDL command has more data available now. So the odds
are that kernel syslog messages not written to disk yet are at least still
in the kernel buffer.
* Changed dprintf_no_syslog() semantics: Now it writes to the syslog, but
doesn't notify the syslog sender thread.

boot loader:
* Added the ring_buffer implementation and a dummy user_memcpy().
* bios_x86: Moved the syslog stuff from serial.{cpp,h} to debug.{cpp.h}.
* Moved the debug options from the "Select safe mode options" menu to a new
"Select debug options" menu.
* Added option "Enable debug syslog" to the new menu (ATM available on x86
only). It allocates a 1 MB in-memory buffer for the syslog for this session
in such a way that it can be accessed by the boot loader after a reset.
* Added item "Display syslog from previous session" to the new menu, doing
what its name suggests.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35816 a95241bf-73f2-0310-859d-f6bbb57e9c96