[haiku-development] Re: Haiku network booting and packagefs
- From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Fri, 01 Apr 2016 06:36:59 +0000
My problem is that I don't have time to read from the on-screen debug
output before reboot, and the last page of text is not in the buffer
accessible from the boot menu after a reboot. Since the machine I'm
using doesn't have a serial port, I can't capture the logs using
that.
I forced the screen size for on-screen debug output to only 5 lines, this
allowed me to "step" through the log messages in a more fine grained way.
Unfortunately, I did not learn much more.
The crash seems to happen during or right after the loading of filesystem
images from the root filesystem (after mounting packagefs). I initially
suspected that the boot filesystem handlers may be overwritten by the ones in
the image, but KDiskDeviceManager properly handles this case and does not
reload already present filesystems.
A tedious, but working strategy to find the exact location of the triple
fault is to bisect the
code by adding an infinite loop.
I wanted to try this, but the KDiskDeviceManager is run twice (first for the
boot archive, then for the root filesystem), so I will need something a bit
more complex than just an infinite loop (I guess I can add a static variable to
count how many times the function has been executed already).
do we have a way to send the logs on UDP broadcast or some other
thing over the network?
Unfortunately not (yet). Having an alternative to serial debugging would be
very useful, though.
I tried to implement this in a form similar to
http://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/debugger/bochs ;
(replacing the out to a fixed port with writing to an UDP socket, of course).
I added my module to the boot archive and added a symlink in boot/, but as far
as I can tell the module init was never called before my reboot problem. Is
there another place where I should plug for this to work, or a way to force
loading the module early? Do I need to make my module depend on the network
stack (since it uses sockets) and how do I accomplish that? Is it safe to just
try creating a socket (and retry each time debug_puts is called, until it
succeeds)?
Or any other way I could get the logs?
There's the debug syslog feature. It doesn't always work on all computers. If
it doesn't for you,
you could try a different (greater?) base address [1].
This works on my machine, but I'm not sure the very last logged messages are
always available after reboot. Sometimes the log was ending earlier than what I
saw with on-screen debug paging. I'm not sure why this would happen.
--
Adrien.
Other related posts: