Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_cursor_from_file: LoadCursorFromFile: bad file type: 512 #80

Open
maikebing opened this issue Nov 24, 2021 · 10 comments
Open

load_cursor_from_file: LoadCursorFromFile: bad file type: 512 #80

maikebing opened this issue Nov 24, 2021 · 10 comments

Comments

@maikebing
Copy link

oad_cursor_from_file: LoadCursorFromFile: bad file type: 512
load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur
KERNEL>InitGUI: Count not init mouse cursor!
KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.

@maikebing
Copy link
Author

高低位的问题。
因为 512 的二进制是 0010 0000 0000

2 的二进制是 0010

@maikebing
Copy link
Author

在我修改 了
大小端转换后,

load_cursor_from_file: LoadCursorFromFile: bad cursor image width (-1) and height (-1)
load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur

@maikebing
Copy link
Author

平台是 loongarch64

@maikebing
Copy link
Author

mips64 的机子就没这问题

@VincentWei
Copy link
Owner

Please check the endianess.

@maikebing
Copy link
Author

重置了龙芯版的统信系统, 重新安装了所有环境, 编译并启动后提示

GUI>LFRDR: failed to initialize default renderer's private info.
KERNEL>InitGUI: failed to init LF Manager!
KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.

然后在 src/gui/lf_manager.c:864 设置断点,
if (rdr->init && 0 != rdr->init (rdr)) {
(gdb) p rdr->init
$1 = (int (*)(PWERENDERER)) 0xfff7c09c78
(gdb) p rdr->init(rdr)
$2 = -1
即 rdr->init(rdr) 返回-1 .

@maikebing
Copy link
Author

尝试了, 如果 禁用掉 cursor 不编译, 则 会出现上面的问题, 如果启用 -cursor 则 会 依旧出现


load_cursor_from_file: LoadCursorFromFile: bad file type: 512
load_cursor_from_file: LoadCursorFromFile: failed when loading cursor from /usr/local/share/minigui/res/cursor/d_arrow.cur
KERNEL>InitGUI: Count not init mouse cursor!
KERNEL>InitGUI: initialization failed; please check your MiniGUI configuration or resource.

@maikebing
Copy link
Author

# lscpu | grep -i byte
Byte Order:          Little Endian

# dpkg-architecture | grep -i end
DEB_BUILD_ARCH_ENDIAN=little
DEB_HOST_ARCH_ENDIAN=little
DEB_TARGET_ARCH_ENDIAN=little

@VincentWei
Copy link
Owner

应该是缺少对龙芯架构的处理导致的,在 common.h 中增加 defined(__loongarch__) 即可。

相关修改已添加到 ref-5-0 分支,可以试试 rel-5-0 上的代码。

@maikebing
Copy link
Author

好的, 我尝试一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants