How to debug kernel written in c++? - c++

I am developing my kernel in C++.
So can any one please explain me step by step
How to debug a kernel?
I am using Linux OS and GCC and NASM for building my kernel.
Ans for testing kernel i am using genisoimage and virtualbox 4.x
Help Me.
Thank you.

I would recommend bochs as an emulator, it comes with some debugging capabilities.

Related

programming and running crystal on windows

I need to work with crystal on windows. Does anyone know about an environment for windows?
And how to I run the files I wrote - if for example for now I'm writing in notepad?
thank you!
In the wiki, there is a guide on working with Crystal on Windows: https://github.com/crystal-lang/crystal/wiki/Porting-to-Windows
However, Windows support is very limited for now, but it's taken some steps lately.
The ongoing efforts for porting to Windows are tracked in https://github.com/crystal-lang/crystal/issues/5430 As you can see, many basic features are still pending. Right now, you probably will not be able to compile any useful program on Windows.
But you can very easily develop on Windows in a Linux environment using Windows Subsystem for Linux. Instructions are in the docs: https://crystal-lang.org/docs/installation/on_bash_on_ubuntu_on_windows.html

Does Trace32 support linux 4.x awareness?

I'm using linux kernel 4.9 and Trace32 debugger.
I want to use linux-awareness debug mod, but Trace32 client has only linux-awareness for 2.x and 3.x.
Could I use linux-awareness 4.x?
Thanks for your answer :)
The Linux-3.x kernel awareness from Lauterbach works also for Linux-4.x

Profling R,C++,Fortran Mix

I am on an odyssey trying to profile an R package for CPU time that contains a mix of R, C++ and Fortran code. I have tried lots of things that all failed. Has anybody done this before and was successful? No matter with what OS. I have OS X as native OS and Ubuntu and Windows 7 in a virtual machine. If necessary, I can also natively install any OS.
On Mac OS X Instruments work fine. However, it is important to make sure that the -fomit-frame-pointer is not turned on. For details see this question and the accepted answer. Also, it is important to compile the packages on the same machine that will be used for profiling to get the source code and not only the disassembly in Instruments.

Should I compile D program on Linux for windows?

Is there any way to compile a D program under linux for a windows operating system?
The easiest way to do this would probably be to run the windows version of dmd under wine. You could set up a cross compiler, but that'll be a lot of extra hassle for the same effect.
Answer to your first question ("Should I ..."): It depends mainly on your development environment. If you work exclusively on Linux, then it is a good idea to setup cross-compiler and build Windows applications on Linux.
Answer to the second question ("Is there..."): Yes, there is - by using a cross-compiler capable of targeting Windows platform.
Both GDC and LDC can be built so they can target Windows 32bit or 64bit straight from your Linux box. You can find hundreds of resources on this topic on the Internet. Writing a guide how to build GDC cross-compiler is time-consuming, but if you somehow fail to do it on your own I will write a simple step-by-step guide how to do this.

cross compiling with Eclipse on linux and eclipse on windows?

I am pretty much new to embedded device programming world so pardon my ignorance if any.
I am cross compiling a C++ program on arm architecture with eclipse on ubuntu.
Then i have to burn the code and see the output with the device that has a linux kernel in it.
Then i came across a tutorial about cross compiling C++ program on arm architecture with eclipse on Windows. So my question is, Can i run this program (from windows) on my embedded device which has a linux kernel in it????
Thanks
A
If you are using a cross compiler, then the answer is yes. It should produce a linux libraries and executive file. You might need to adjust the files parameters (like set permissions and execute flag).
Yes.
eclipse is a great tool, especially when coupled with gcc. You can definitely use a ready-built compiler to extend eclipse as long as that compiler is available for Windows.
Here is a link to some documentation on how to change the toolchain in an eclipse project -
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build_toolchain.htm