Kernel & Hardware Services - Things To Try
From Symbian Developer Community
Now that you've built an image for QEMU, let's tinker with it.
Modifying ESHELL
Let's modify ESHELL to print a banner on startup.
First go to the right source directory.
cd x:\sf\os\kernelhwsrv\userlibandfileserver\fileserver\etshell
Now edit ts_edshl.cpp and add extra TheConsole->Printf() commands to the start of CShell::DoBanner(), e.g.
void CShell::DoBanner()
{
TheConsole->Printf(_L(" ###### ######## ######## ####### ##### "));
TheConsole->Printf(_L("##### #######\r\n## ## ## ## ##"));
TheConsole->Printf(_L(" ## ## ## ## ## ## ##\r\n## ##"));
TheConsole->Printf(_L(" ## ## ## ## ## ## ## "));
TheConsole->Printf(_L(" ##\r\n ###### ###### ###### ####### ##"));
TheConsole->Printf(_L(" ## ## ## ########\r\n ## ## ## "));
TheConsole->Printf(_L(" ## ## ## ## ## ##\r\n"));
TheConsole->Printf(_L("## ## ## ## ## ## ## #"));
TheConsole->Printf(_L("# ## ## ##\r\n ###### ######## ######## #"));
TheConsole->Printf(_L("######## ##### ##### #######\r\n\n"));
Rebuild the executable.
sbs -b bld.inf -c armv5.rvct4_0
Rebuild the ROM image.
cd x:\sf\os\kernelhwsrv\kernel\eka\rombuild rom --variant=syborg --inst=armv5 --build=udeb --type=tshell --name=x:\epoc32\rom\syborgBanner.img
Use QEMU to run the resulting ROM image.
qemu-system-arm.exe -M x:\sf\os\QEMU\baseport\syborg\syborg.dtb -kernel x:\epoc32\rom\syborgBanner.img
Build an executable and add it to the ROM image
We'll use one of the e32test examples, t_y2k.exe (yes, we checked for the Millennium bug!).
cd \sf\os\kernelhwsrv\kerneltest\e32test\group sbs -b bld.inf -p t_y2k.mmp -c armv5.test.rvct4_0
This builds just the t_y2k "project" from the bld.inf file, which generates armv5\udeb\t_y2k.exe and armv5\urel\t_y2k.exe.
Create a new OBY file by copying and editing tshell.oby.
cd \sf\os\kernelhwsrv\kernel\eka\rombuild copy tshell.oby myrom.oby
Edit myrom.oby and add a new line to the end:
file=\epoc32\release\##MAIN##\##BUILD##\t_y2k.exe sys\bin\t_y2k.exe
Now build the new ROM, using myrom instead of tshell, and run it
rom --variant=syborg --inst=armv5 --build=udeb --type=myrom --name=\epoc32\rom\syborg.img cd \symbian-qemu-0.9.1\bin arm-none-symbianelf-qemu-system -M \sf\adaptation\qemu\baseport\syborg\syborg.dtb -kernel \epoc32\rom\syborg.img
In the shell, you can now run the new additional executable by typing its name - t_y2k
Running the e32 and f32 test suite
This section walks you through the process of building and running the e32tests for the Symbian Virtual Platform. This is a suite of tests which validate the eka2 kernel. The basic steps are
1. Compile the tests
- cd \sf\os\kernelhwsrv\kerneltest\e32test\group
- sbs -b bld.inf -c armv5.test.rvct4_0 -k -j 4
- sbs -b bld.inf -c armv5.test.rvct4_0 -k ROMFILE
2. Create a ROM based on those tests
- cd \sf\os\kernelhwsrv\kernel\eka\rombuild
- rom -v syborg -i armv5 -t e32tests --name \epoc32\rom\syborg_e32tests.img
- You get errors, do the following steps to fix the problem
- Edit e32tests.oby to remove the "#ifndef VARIANT_PATH" bit at the end, then run the "rom" command again - it will fail.
- Copy the generated rom.oby file to saved_rom.oby
- Edit the generated oby files to convert "sys/bin/" to "sys\bin\", and "/sys\bin" to "sys\bin", and similar errors which produce "Diagnostic warnings".
- Edit the lines which deliver e32test.auto.bat and e32test.manual.bat so that the destination path is "test\xxx" instead of "test/xxx"
- Type "rombuild -type-safe-link -S saved_rom.oby" to try again
- If you get complaints about specific files, comment out the line with "REM" and try again (there are no missing files using updated_kernelhwsrv.zip!)
3. Use QEMU to run the image
- cd \symbian-qemu-0.9.1\bin
- arm-none-symbianelf-qemu-system -M \sf\adaptation\qemu\baseport\syborg\syborg.dtb -kernel \epoc32\rom\syborg_e32tests.img -serial file:e32tests_log.txt The "-serial" option lets you re-direct the serial console output. In this case it is redirected to a file e32tests_log.txt in the current dir.
4. Run those tests
- runtests z:\test\e32test.auto.bat
- This logs the test results (pass/fail) using RDebug::Print - you can see the RDebug output in Syborg by pressing Ctrl-Alt-3 to switch to the "serial0 console". Press Ctrl-Alt-1 to get back to the Symbian Platform display. ALternatively, use the "- serial" option when running QEMU, as described above.
5. For F32 all these step are similar, need to be repeated in the context of f32.
Comments
Sign in to comment…

