2018年12月3日星期一

Dump QEMU virt machine dts

 Commands:

qemu-system-aarch64 -machine virt,dumpdtb=/tmp/virt.dtb
dtc -I dtb -O dts /tmp/virt.dtb >/tmp/virt.dts 

Example:

/dts-v1/;

/ {
interrupt-parent = <0x8001>;
#size-cells = <0x2>;
#address-cells = <0x2>;
compatible = "linux,dummy-virt";

platform@c000000 {
interrupt-parent = <0x8001>;
ranges = <0x0 0x0 0xc000000 0x2000000>;
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "qemu,platform", "simple-bus";
};

2018年10月25日星期四

binutils nm


"A"
The symbol's value is absolute, and will not be changed by further linking.
"B"
"b"
The symbol is in the uninitialized data section (known as BSS ).
"C"
The symbol is common. Common symbols are uninitialized data. When linking, multiple common symbols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references.
"D"
"d"
The symbol is in the initialized data section.
"G"
"g"
The symbol is in an initialized data section for small objects. Some object file formats permit more efficient access to small data objects, such as a global int variable as opposed to a large global array.
"i"
For PE format files this indicates that the symbol is in a section specific to the implementation of DLLs. For ELF format files this indicates that the symbol is an indirect function. This is a GNU extension to the standard set of ELF symbol types. It indicates a symbol which if referenced by a relocation does not evaluate to its address, but instead must be invoked at runtime. The runtime execution will then return the value to be used in the relocation.
"N"
The symbol is a debugging symbol.
"p"
The symbols is in a stack unwind section.
"R"
"r"
The symbol is in a read only data section.
"S"
"s"
The symbol is in an uninitialized data section for small objects.
"T"
"t"
The symbol is in the text (code) section.
"U"
The symbol is undefined.
"u"
The symbol is a unique global symbol. This is a GNU extension to the standard set of ELF symbol bindings. For such a symbol the dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use.
"V"
"v"
The symbol is a weak object. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the weak symbol becomes zero with no error. On some systems, uppercase indicates that a default value has been specified.
"W"
"w"
The symbol is a weak symbol that has not been specifically tagged as a weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without error. On some systems, uppercase indicates that a default value has been specified.
"-"
The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and the stab type. Stabs symbols are used to hold debugging information.
"?"
The symbol type is unknown, or object file format specific.

2018年10月18日星期四

在Vive Focus上安装2D App

Vive Focus作为一款一体机VR设备,质感还不错。不过由于生态的问题,可用的内容并不多。
如果能引入Android生态中的2D应用感觉会好一些。
但是,截至到目前,消费者版的Vive Focus还不支持2D应用。
具体表现为:可以通过adb install安装APK,但是在home中并没有相应的图标。这样也就无法启动了。当然,可以通过adb shell am start来进行启动,但是每次都要借助PC,还要记包名,就比较痛苦了。
思来想去,决定采用一个比较迂回的方式来解决。
先寻找一个比较简单的2d launcher。
然后通过一个AndroidManifest中包含<category android:name="com.htc.intent.category.VRAPP" />的应用来发送Intent启动之前安装的2d launcher。
实际弄了之后,效果还不错。

Launcher实在github上面找到的一个非常简洁实用的优秀开源项目:
https://github.com/arnabc/simplelauncher
如果想要自己编译的话,可能需要稍微修改一下androidmanifest
<intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <!-- The following two intent-filters are the key to set homescreen    <category android:name="android.intent.category.HOME" />    <category android:name="android.intent.category.DEFAULT" />     -->    <category android:name="android.intent.category.LAUNCHER" />
将主activity的HOME 和 DEFAULT注释掉,添加LAUNCHER。不改可能也行。
感兴趣的同学可以自己试试。
懒得自己编的:https://github.com/SimonTheCoder/simplelauncher/releases/download/init_test/SimpleLauncher-debug.apk

用作启动器的VR应用直接使用了wave vr sdk中的wvr_hellovr。
下载:https://github.com/SimonTheCoder/simplelauncher/releases/download/init_test/app-debug.apk

这个代码稍微有一些改动,就是在hellovr.cpp里面的moveSphereHandler中添加了一个发送intent的反向JNI调用
懒得往git上传了。如果需要的人多的话再说吧。

使用方法:
下载或者编译上面两个apk。
adb install安装之。
启动wvr_hellovr,点击场景中的大球,即可启动simplelauncher。

之后再装个moonlight,工作正常哦!惊不惊喜,意不意外?
https://github.com/moonlight-stream/moonlight-android/releases

2018年10月11日星期四

从命令行手动启动X + xfce4 + fcitx

在更新了ubuntu 18.04之后,由于桌面从unity切回到了gnome。导致window manager也切回了gdm。
之前一直在用xfce4,在更新之后系统直接进入tty0。X Window不启动,自然也就没有桌面环境。
下面是手动启动方法:

准备配置:

进入用户目录:

cd ~

编辑x client启动脚本: 

vi .xinitrc

在脚本中加入如下内容:

export XIM=fcitx
export XIM_PROGRAM=/usr/bin/fcitx
export XIM_ARGS=""
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
export DEPENDS="fcitx"
exec startxfce4
保存并关闭。(vim 命令: “:wq” )

启动X Window:

每次启动后,进入终端,执行startx启动图形系统:
startx

扩展应用:

在Ubuntu中,使用ctrl + alt + F[1-8]来进入tty。使用上面方法可以同时开几个桌面了。同时使用KDE、GNOME、Xfce4是完全可以的。
不过chrome会自动启动到第一个task所在的display。估计需要手动指定display后再启动。

2018年2月10日星期六

WSL tty

优势:
  • 支持中文。默认为utf-8。
  • 支持方向键。
  • 支持vim中方向键。中文也没有问题。
  • 支持颜色。
  • 支持搜索。
  • 支持copy/paste。不过按键是 Ctrl + Ins/Shift + Ins。
  • 速度相当快。
  • .bashrc运行OK。
  • .vimrc运行OK。
  • tmux支持良好。

劣势:
  • 不支持多tab
  • 不支持分屏
  • 快捷键不能更改。
  • 工作时没有ConEmu的那种进度条。

Github
https://github.com/mintty/wsltty



直接在release 中下载最新版,安装即可。目前看来并没有build from source 的需要。