-
Notifications
You must be signed in to change notification settings - Fork 23
Decouple Linux VT #72
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
Conversation
jserv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the routine twin_vt_setup from the file backend/fbdev.c to the proposed backend/linux_vt.c and wrap the controls related to <linux/vt.h>.
jserv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since most virtual terminal operations are brief, use static inline functions for the implementation. This means placing the function body directly in the header linux_vt.h.
|
The ioctl we would like to wrap in this task:
|
backend/linux_vt.h
Outdated
| int fd; | ||
|
|
||
| char vt_dev[30] = {0}; | ||
| snprintf(vt_dev, 30, "/dev/tty%d", vt_num); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 30?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially, we used 30 as a conservative size. Using the command find /dev/ -name "tty*", we get results like /dev/ttyXX. Therefore, 11 is also a suitable size.
backend/linux_vt.h
Outdated
| return fd; | ||
| } | ||
|
|
||
| static inline int twin_vt_set(int fd, int mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is confusing to have similar function names, twin_vt_set and twin_vt_setup. Can you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the clarity of this function needs to be improved. Here are a few options for this function name:
- twin_vt_apply_mode
- twin_vt_configure_mode
- twin_set_vt_mode
Or let me know the better choices. I will rename this function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the clarity of this function needs to be improved.
How about twin_vt_mode?
Move Linux VT into separate files to enable developers to use it in other backends, such as Linux DRM.
|
Thank @Bennctu for contributing! |
Move Linux VT into separate files to enable developers to use it in other backhands, such as Linux DRM.