Linux Kernel Assistance Tool
This project is tested from linux kernel v5.0.2.
KAT help you to develop and analyze linux kernel code conveniently.
KAT provide File tree, Tag list, Explorer for you.
KAT’s objective is many people use linux kernel source code usefully and
conveniently in various environments which is to be used various text editors
and IDEs through local and remote accesses.
Currently, It is developed for only linux kernel. But perhaps it’ll be improved
to provide useful development environment with various IDEs and text editors for
many projects containing linux kernel. (I call it Plug-in Development
Environment)
I don’t prepare auto installer yet. Please do as follows first.
linux/Makefile
Append kat
into no-dot-config-targets
no-dot-config-targets := clean mrproper distclean \
cscope gtags TAGS tags help% %docs check% coccicheck \
$(version_h) headers_% archheaders archscripts \
kernelversion %src-pkg \
kat
Append kat.ref
into MRPROPER_FILES
MRPROPER_FILES += .config .config.old .version \
Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
signing_key.pem signing_key.priv signing_key.x509 \
x509.genkey extra_certificates signing_key.x509.keyid \
signing_key.x509.signer vmlinux-gdb.py \
kat.ref
Append the following line into help:
@echo ' kat - Generate kat file for editors'
Append the kat
into following block
tags TAGS cscope gtags kat: FORCE
$(call cmd,tags)
linux/scripts/tags.sh
Append function definition dokat()
between all_kconfigs() and docscope()
dokat()
{
(echo "
"; \
echo "
"; \
all_target_sources; \
echo "
"; \
all_kconfigs) > kat.ref
}
Append caller of dokat
into case scope
case "$1" in
"cscope")
docscope
;;
"gtags")
dogtags
;;
"tags")
rm -f tags
xtags ctags
remove_structs=y
;;
"TAGS")
rm -f TAGS
xtags etags
remove_structs=y
;;
#################### Append under text ######################
"kat")
# ignore sound and drivers
ignore="$ignore ( -path ${tree}drivers ) -prune -o"
ignore="$ignore ( -path ${tree}sound ) -prune -o"
dokat
;;
#############################################################
esac
Append Vundle plugin in .vimrc
.
If you don’t know Vundle you can visit here in order to use.
Plugin 'tot0rokr/kat'
and install.
:PluginInstall
First, you should make kat.ref
from Makefile
where $PWD
are in linux
directory.
$ make kat
$ make ARCH=$(ARCH) kat # make ARCH=arm64 kat
Second, execute Vim
.
$ vim
and, you could see loading and making kat.database which is in order to be fast
loading.
You can customize variables if you want.
Variable | Default | Description |
---|---|---|
g:KATUsing | 1(True) | 0(False) is not using KAT. Otherwise(True), KAT is used |
g:KATUsingFileTree | 1(True) | 0(False) is not using Filetree. Otherwise, used |
g:KATUsingTagList | 1(True) | 0(False) is not using Taglist. Otherwise, used |
g:KATUsingExplorer | 1(True) | 0(False) is not using Explorer. Otherwise, used |
g:KATCreateDefaultMappings | 1(True) | If this value is 0(False), don’t use default key-mapping |
g:KATSizeFileTree | 30 | Filetree’s window width size |
g:KATSizeTagList | 30 | Taglist’s window width size |
g:KATSizeExplorer | 8 | Explorer’s window height size |
You can customize command key-mapping.
Target | Default | Description |
---|---|---|
\ |
- | Open the Filetree window |
\ |
- | Close the Filetree window |
\ |
\]f | Toggle the Filetree window |
\ |
- | Open the Taglist window |
\ |
- | Close the Taglist window |
\ |
\]t | Toggle the Taglist window |
\ |
- | Open the Explorer window |
\ |
- | Close the Explorer window |
\ |
\]e | Toggle the Explorer window |
\ |
\]s | Open the Explorer window and show Tag definition under the cursor |
Target | Default | Description |
---|---|---|
\ |
\ |
Open a file under the cursor |
Filetree’s abbreviations is shown in Filetree by pushing ?
Target | Default | Description |
---|---|---|
\ |
\ |
Go to a Tag under the cursor |
Taglist’s abbreviations is shown in Taglist by pushing ?
Target | Default | Description |
---|---|---|
\ |
\ |
Open a file which a Tag under the cursor in, and go to the tag |
\ |
\ |
If found tags is multiple, you can choose one by pushing Key |