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

Cannot initialise keyboard #86

Open
ms2010gamer opened this issue May 10, 2024 · 8 comments
Open

Cannot initialise keyboard #86

ms2010gamer opened this issue May 10, 2024 · 8 comments

Comments

@ms2010gamer
Copy link

so I have setup microwindows using the linux-fb config and ran ldd nano-X and copied all of the libs
so that I can run it on a simple linux + busybox os
so it is not mentioning any issues about the framebuffer but it cant initialise the keyboard
if you want more info I can provide some

@ghaerr
Copy link
Owner

ghaerr commented May 10, 2024

You might try building microwindows demos without using shared libraries, that is, as a static binary. This is done by setting SHAREDLIBS=N and SHAREDLINK=N in config.

it cant initialise the keyboard

This is usually because the default is the scan-code enabled keyboard, which may not be present. You can try the simple keyboard by setting KEYBOARD=TTYKBD in config.

Thank you!

@ms2010gamer
Copy link
Author

SHAREDLIBS=N and SHAREDLINK=N was already there and I changed the KEYBOARD=SCANKBD to KEYBOARD=TTYKBD but its still giving me the same error

@ghaerr
Copy link
Owner

ghaerr commented May 10, 2024

It would help to see the error of course and exactly what you're running etc. But if the message is saying "Can't initialize keyboard" then this is probably because the open("/dev/tty", O_RDWR) is failing in src/drivers/kbd_tty.c:

#   define KEYBOARD "/dev/tty"  /* keyboard associated with screen*/

This might also because you don't have root permissions on /dev/tty or the actually tty you're using. In general, root permissions are required for framebuffer access unless device modes are changed.

You can try recompiling with the above changed and/or chmod /dev/tty or the terminal you're on. Also try running sudo. I'd have to see your complete config also to know what you've compiled.

@ms2010gamer
Copy link
Author

ms2010gamer commented May 10, 2024

here is what I use:
Linux 6.8.9 kernel with default config (except the framebuffer)
Busybox 1.36.1 (I am mounted /dev and /sys etc)

here is my config file:
config.txt

also I edited the nx11 makefile so that I can use the local X11

@ghaerr
Copy link
Owner

ghaerr commented May 10, 2024

The config file looks ok. What command are you running?

@ms2010gamer
Copy link
Author

just cd into root and run ./nano-X

@ghaerr
Copy link
Owner

ghaerr commented May 10, 2024

The nano-X server is mean to be run by the runapp shell script, as it alone doesn't do much. However, it will try to open a TTY and report the error you're seeing. It might be easier to run a simpler command, rather than one that requires client/server, like nano-X. A win32 app like ./mwdemo doesn't require client/server.

you should have to copy any shared libs with SHAREDLIBS=N. Go ahead and try the suggestions above about getting the TTY working using sudo or chmod.

@ms2010gamer
Copy link
Author

so I ran mwdemo and same error
also very new to this so all I did was run chmod 777 /dev/tty

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