dmesg (kmsg), a new Kdbg command (patch)

All development related issues welcome

Moderator: Moderator Team

Post Reply
Mna.
Posts: 122
Joined: Thu Dec 02, 2010 3:13 pm

dmesg (kmsg), a new Kdbg command (patch)

Post by Mna. » Sat Feb 05, 2011 2:39 pm

I am now crafting new command for kdbg, called it kmsg, it works if Debugport is SCREEN and prints all the debug log on the screen, with simple pager of KdbpPrint.
The main idea is to allow debugging ReactOS on real hardware without serial cable, at least this to be a step on that path.

Now it looks like:

Code: Select all

kdb:> kmsg
*** KMSG ***
(ntoskrnl\mm\mminit.c:243)           0x80000000 - 0x81000000    Boot Loaded Image
(ntoskrnl\mm\mminit.c:247)           0xB0000000 - 0xB0739000    PFN Database
(ntoskrnl\mm\mminit.c:251)           0xB0739000 - 0xB2D79000    ARMбЁ Non Paged Pool
(ntoskrnl\mm\mminit.c:255)           0xBC000000 - 0xBD000000    System View Space
...
(hal\halx86\generic\legacy\bussupp.c:591) Your machine has a PCI-to-PCI or CardBUS Bridge. PCI devices may fail!
(hal\halx86\generic\legacy\bussupp.c:620) Found parent bus (indicating PCI Bridge). PCI devices may fail!

====== PCI BUS HARDWARE DETECTION =======

--- Press q to abort, any other key to continue ---
00:00.0 Host bridge [0600]:  440BX/ZX/DX - 82443BX/ZX/DX Host [8086:7190] (rev 01)
        Subsystem: Virtual Machine Chipset [15ad:1976]
...
                Hack Flags: 1 (Hack Revision: 0-Your Revision: 8)
        No HackFlags for your chipset's revision!

--- Press q to abort, any other key to continue ---
00:07.1 IDE interface [0101]: Intel Corporation 82371AB/EB/MB PIIX4 IDE [8086:7111] (rev 01)
        Subsystem: Virtual Machine Chipset [15ad:1976]
        Flags: bus master, medium devsel, latency 64
        I/O ports at 1050 [size=16]
etc.

Is it would be OK to integrate this (kmsg) patch, in this form of kmsg command, into the source when I will finish it?
Now I'm correcting the bugs.
Last edited by Mna. on Thu Mar 17, 2011 3:49 pm, edited 1 time in total.

Haos
Test Team
Posts: 2954
Joined: Thu Mar 22, 2007 5:42 am
Contact:

Re: kmsg, a Kdbg new command, request for possible advices

Post by Haos » Sat Feb 05, 2011 8:25 pm

Why not? Please open a bugzilla report and provide a patch.

Mna.
Posts: 122
Joined: Thu Dec 02, 2010 3:13 pm

Re: dmesg, a Kdbg new command (aka kmsg)

Post by Mna. » Thu Mar 17, 2011 3:46 pm

Eventually I formed it as patch (6018).
This is a patch that adds new command dmesg to kdbg.
In short, it is kdbg analog to 'dmesg|more' in *nix

It allows to view already shown, logged messages, but without serial cable and
second terminal, showing them, instead, on screen. /DEBUGPORT=SCREEN key is
required for dmesg to work. It works only in debug versions.

* Navigation keys are: Home, End, PageUp, ArrowUp, and all other keys are PageDown.
* q is quit.

I used to type its older name kmsg, so leaved it as alias: it's so comfortable to type: tab+kkmsg<enter> ;)

Haos
Test Team
Posts: 2954
Joined: Thu Mar 22, 2007 5:42 am
Contact:

Re: dmesg (kmsg), a new Kdbg command (patch)

Post by Haos » Fri Mar 18, 2011 12:50 pm

The patch was assigned to Herve for review.

Mna.
Posts: 122
Joined: Thu Dec 02, 2010 3:13 pm

Re: dmesg (kmsg), a new Kdbg command (patch)

Post by Mna. » Sat Apr 30, 2011 9:26 am

Laid out the iso image for r51500 with dmesg patch applied. Can be downloaded from here: ReactOS-LiveCD-r51500-debug-dmesg_patch.iso.7z.

Send all suffering users here for it :)

P.S. Seems Hervé is busy

hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto » Sun May 01, 2011 1:33 am

When last time I used KDBG, it had one rather annoying "feature". When you press «Enter ↵», it repeats the recently executed command. Which is good, but not always. The debugger should be more smart, it should not repeat the command when you unlikely want to repeat it — certainly, not after long many-page output.
Send all suffering users here for it :)
The patch doesn't look particularly neat. But that's not a critical part of the kernel, so it seems to be ok for it. One thing I would change, however:

Code: Select all

- int linesCnt = (int) ceilf( (float)(prev_p-p-1) / KdbNumberOfColsTerminal );
+ int linesCnt = (KdbNumberOfColsTerminal+prev_p-p-2) / KdbNumberOfColsTerminal;
(and, of course, #include <math.h> becomes unnecessary.)
Seems Hervé is busy
Well, then there is no need to distract him from his peaceful works. The patch is approved with that change. Go ahead, ask Haos or somebody else with write access to the SVN repository to install the patch.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests