How can get the debug information from freeldr?

All development related issues welcome

Moderator: Moderator Team

Post Reply
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

How can get the debug information from freeldr?

Post by objectHuang »

Hi,
I am trying to understand the freeldr module, I read the wiki about the debug, build, but I still was not able to figure out how to enable the debug information from freeldr.
I am not sure what's the exactly step to have a debug build of the reactos which will enable me to debug the freeldr or I mean just send the debug information through the com port (I am using the VMware to redirect the debug out to a txt file)

Thanks in advance.

objectHuang
gabrielilardi
Moderator Team
Posts: 873
Joined: Sat Sep 02, 2006 1:30 am
Location: Italy

Re: How can get the debug information from freeldr?

Post by gabrielilardi »

objectHuang wrote:I am not sure what's the exactly step to have a debug build of the reactos which will enable me to debug the freeldr or I mean just send the debug information through the com port
Hi, to compile a debug build of freeldr you need to define ROS_BUILDMAP=yes (this will create a file to translate addresses to the function in the source) and #DEFINE DEBUG_ALL in debug.c in freeldr, then you can compile freeldr.
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

This can be useful, too.
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

Re: How can get the debug information from freeldr?

Post by objectHuang »

gabrielilardi wrote:
objectHuang wrote:I am not sure what's the exactly step to have a debug build of the reactos which will enable me to debug the freeldr or I mean just send the debug information through the com port
Hi, to compile a debug build of freeldr you need to define ROS_BUILDMAP=yes (this will create a file to translate addresses to the function in the source) and #DEFINE DEBUG_ALL in debug.c in freeldr, then you can compile freeldr.
Thanks a lot! I am going to try that

Xinhua
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

Re:

Post by objectHuang »

hto wrote:This can be useful, too.
I did view the thread very carefully, but for some reason I was not able to try it out, will try again.

Thanks a lot!

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

Post by hto »

objectHuang wrote: I did view the thread very carefully, but for some reason I was not able to try it out, will try again.
Perhaps it was not very clear. Those environment variables are described in Makefile. By default, ROS_AUTOMAKE is makefile.auto, ROS_OUTPUT is output-i386 subdirectory, and ROS_TEMPORARY is obj-i386. This (or ROS_BUILDMAP=yes) is not needed, if all you want is to just receive debug information from the com port. For that, simply comment out #define DEBUG_NONE and uncomment #define DEBUG_ALL or other DEBUG_xxx in boot/freeldr/freeldr/debug.c, and recompile.
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

Re:

Post by objectHuang »

hto wrote:
objectHuang wrote: I did view the thread very carefully, but for some reason I was not able to try it out, will try again.
Perhaps it was not very clear. Those environment variables are described in Makefile. By default, ROS_AUTOMAKE is makefile.auto, ROS_OUTPUT is output-i386 subdirectory, and ROS_TEMPORARY is obj-i386. This (or ROS_BUILDMAP=yes) is not needed, if all you want is to just receive debug information from the com port. For that, simply comment out #define DEBUG_NONE and uncomment #define DEBUG_ALL or other DEBUG_xxx in boot/freeldr/freeldr/debug.c, and recompile.
Actually I did try that, in /boot/freeldr/freeldr/debug.c:

#if DBG

#define DEBUG_ALL
//#define DEBUG_INIFILE
//#define DEBUG_REACTOS
//#define DEBUG_CUSTOM
//#define DEBUG_NONE

Then I use "make bootcd" to get a iso file, then I install it in a VMware machine and set the com redirect file,

but here is the debug output:
(ntoskrnl\kd\kdio.c:220) -----------------------------------------------------
(ntoskrnl\kd\kdio.c:221) ReactOS 0.3.10 (Build 20090729-rUNKNOWN)
(ntoskrnl\kd\kdio.c:222) Command Line: DEBUG DEBUGPORT=COM1 BAUDRATE=115200 SOS
(ntoskrnl\kd\kdio.c:223) ARC Paths: multi(0)disk(0)rdisk(0)partition(1) \ multi(0)disk(0)rdisk(0)partition(1) \ReactOS\
Used memory 523828Kb
(ntoskrnl\mm\mminit.c:284) Start End Type
(ntoskrnl\mm\mminit.c:285) 0x80000000 - 0x80800000 Undefined region
(ntoskrnl\mm\mminit.c:288) 0x80800000 - 0x80E00000 FreeLDR Kernel mapping region
(ntoskrnl\mm\mminit.c:301) 0x87600000 - 0x8DA00000 Paged pool region
(ntoskrnl\ke\i386\kiinit.c:43) Large Page support detected but not yet taken advantage of!
(ntoskrnl\ke\i386\patpge.c:62) Advanced Memory features detected but not yet taken advantage of.
(ntoskrnl\ke\i386\mtrr.c:24) Your machine supports MTRR but ReactOS doesn't yet.
WARNING: KdDebuggerInitialize1 at drivers\base\kdcom\i386\kdbg.c:489 is UNIMPLEMENTED!
WARNING: IoReportResourceUsage at ntoskrnl\io\iomgr\iorsrce.c:700 is UNIMPLEMENTED!
WARNING: IoReportResourceUsage at ntoskrnl\io\iomgr\iorsrce.c:700 is UNIMPLEMENTED!
(drivers\storage\class\ramdisk\ramdisk.c:2310) RAM Disk Driver Initialized
(ntoskrnl\io\iomgr\deviface.c:892) IoRegisterDeviceInterface(): creating symbolic link \??\Root#*PNP0F13#0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd} -> \Device\00000030
.................
(ntoskrnl\io\iomgr\deviface.c:892) IoRegisterDeviceInterface(): creating symbolic link \??\Root#*PNP0501#0000#{86e0d1e0-8089-11d0-9ce4-08003e301f73} -> \Device\0000002e
WARNING: MmPageEntireDriver at ntoskrnl\mm\drvlck.c:88 is UNIMPLEMENTED!
(ntoskrnl\io\iomgr\file.c:414) Using IopParseDevice() hack
(ntoskrnl\vdm\vdmmain.c:25) VME detected but not yet supported
....

I did not see any debug output from freeldr.. did I do anything wrong?

Hope somebody can help me to solve this issue..


Thanks,

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

Re: How can get the debug information from freeldr?

Post by Haos »

Could you paste the part of code below where DEBUG_ALL is defined?
hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

Try make freeldr_clean and/or make setupldr_clean before make bootcd
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

Re:

Post by objectHuang »

hto wrote:Try make freeldr_clean and/or make setupldr_clean before make bootcd
Hi,
Problem solved! I just did what you said.. Thank you very much..
objectHuang
Posts: 6
Joined: Sun Apr 06, 2008 6:56 am

Re: How can get the debug information from freeldr?

Post by objectHuang »

Haos wrote:Could you paste the part of code below where DEBUG_ALL is defined?
Hi,
Thanks.
I just tried that again with "make clean", and I was able to get debug output now!

objectHuang
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests