Difference between revisions of "Toro Kernel"
From Lazarus wiki
Jump to navigationJump to searchm (→Building) |
|||
Line 13: | Line 13: | ||
* on start qemu can complain about unknown or raw format of ".img" file. | * on start qemu can complain about unknown or raw format of ".img" file. | ||
: One might find the script files to build the Qemu recognizable image file formats: BuildVHDX.cmd and/or BuildVMDK.cmd | : One might find the script files to build the Qemu recognizable image file formats: BuildVHDX.cmd and/or BuildVMDK.cmd | ||
+ | ====Lazarus==== | ||
+ | Lazarus can be configured in the following manner. | ||
+ | |||
+ | Open ''Run->Run Parameters...'' and specify QEmu as the host application. | ||
+ | |||
+ | On the command-line parameters specify ''-hda'' parameter, that should point to the produced image file. | ||
+ | |||
+ | Normally this would be an output file with .img extension. | ||
==Debugging== | ==Debugging== |
Revision as of 07:54, 24 August 2019
A dedicated kernel for multi-threading applications
On Windows
It's possible to develop Toro Kernel microservices on Windows.
Building
- you'll need to have cross-compile linux binary utils
- those could be acquired from fpcup or fpcupdeluxe (https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/download/crosslibs_v1.1/CrossLibsLinuxx64.zip)
- the project contain "build" utility complication as well. The utiltiy produces an image from the resulting .elf file
Running QEMU
- install QEmu for Windows
- run the system specifying the built image
qemu-system-x86_64 -hda HelloWorldMicroservice.img
- on start qemu can complain about unknown or raw format of ".img" file.
- One might find the script files to build the Qemu recognizable image file formats: BuildVHDX.cmd and/or BuildVMDK.cmd
Lazarus
Lazarus can be configured in the following manner.
Open Run->Run Parameters... and specify QEmu as the host application.
On the command-line parameters specify -hda parameter, that should point to the produced image file.
Normally this would be an output file with .img extension.
Debugging
QEmu provides a built-in support for GDB remote debuggin
Manual
- run QEmu with enabling gdb (-s) and also requesting the QEmu to halt until getting the "continue" signal from gdb (-S)
qemu-system-x86_64 -s -S -hda HelloWorldMicroservice.img
- The expected result is that Qemu window will halt with the message that "vga" system has not been initialized yet (and doing nothing)
- -s - configures the default remote GDB mode for the use of TCP socket for port 1234
- run the debugger, and provide the previously complied binary file as its gdb target. (The file is needed to load debugging information)
gdb HelloWorldMicroservice
- after that run the remote target command
(gdb)> target remote localhost:1234
- The command makes gdb connect to the specified address. In which case this would be Qemu running locally at port 1234.
- setup the debugging information (i.e. breakpoints, etc)
- The debugging information in the compiled binary contains the information necessary to work with binary during debugging.
- Example
(gdb)> b HelloWorldMicroservice.pas:250
- sets a breakpoint HelloWorldMicroservice at the line that outputs "ToroService: listening on port xxxx ..."
- "continue" the process.
(gdb)> continue
See Also
- https://github.com/torokernel/torokernel - sourcecode
- https://torokernel.io - the official website
- https://www.qemu.org/download/#windows - QEmu Windows download