-
Notifications
You must be signed in to change notification settings - Fork 92
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
Porting Nano-X to NuttX #85
Comments
I would recommend to get Nano-X to work on a standard Linux system first and shorten the makefile to avoid that all the examples are build. Then give it a try on NuttX. Look at the config file and turn off everything you can first, to see if it compiles at all. Then turn on the options step by step. |
After getting Nano-X running on a Linux desktop (preferably using the src/Config/config.linux-fb configuration file copied to src/config, or using X11 using src/Config/config.linux-X11), the next steps would be to look at the screen, keyboard and mouse drivers and determine how to best write new ones for NuttX. These drivers are in the src/drivers directory. At first, skipping mouse and keyboard input and only getting a screen driver working would be simplest. The Linux framebuffer driver is src/drivers/scr_fb.c. Some quite old but useful architecture information is available on the microwindows.org website: http://www.microwindows.org/microwindows_architecture.html. There is also documentation in the https://github.com/ghaerr/microwindows/tree/master/doc directory. |
I was thinking about Nano-X and our SuiTk based on it to be ported to NuttX. I have years of experience with Nano-X or better lower GD Microwindows layer porting to H8S sysless, iMX1 sysless and iMX1 on RTEMS. We have even added VESA bios based drivers to RTEMS mainline and then used it for Microwindows demos. Me, my students and company for which I provide consultations use and contribute to NuttX mainline intensively. They use NuttX include graphic (LVGL). That is, I have interest in Nano-X on NuttX, we have lot of experience on all sides. Problem is the time. But I hope that we can provide at least some help, code review etc. By the way, I am at Embedded World in Nuremberg now, so if somebody has interest in these and other topic than we can be reached there OSADL has kindly provided us space (hall 4, booth 4-168) to present some of our univesity projects. |
It took me a long time to get a screen driver to work. To test the Makefile, you can use my scr_null.c driver together with the kbd_null.c and mou_null.c drivers. This way you can see if it compiles at all. |
I tested it on a Linux machine. It compiles when we disable a few options, but the apps don't work at all. When I tried the same with an X11 config file, it doesn't even compile. ubuntu :23.04 disbled options HAVE_BMP_SUPPORT = N HAVE_PNG_SUPPORT = N HAVE_PCF_SUPPORT = N HAVE_FREETYPE_2_SUPPORT = N config file :config.linux-fb
X11 config file :config.linux-X11
|
Try changing to the non-scancode keyboard driver in your config file. Change KEYBOARD=SCANKBD to
This means the client can't connect to the named pipe
You then won't have to use
This is caused by a new default of a GCC option (
|
Hello @ppisa, Nice to hear from you, its been a long time! :)
Wow, SuiTk is pretty cool, I never knew about it. Nice using the Microwindows
I've looked at LVGL, it's a very nice library with its own compositor and large widget set, IIRC. For this project, porting Nano-X to NuttX, it would be helpful to more fully understand the nature of how the applications would run on NuttX (client/server, bound-in direct graphics library calls, etc), whether a window system is needed, and what APIs are desired, things like that. That is, unless the idea is just a basic port of Microwindows and Nano-X to NuttX. As you know, with a lower level framebuffer, it should be quite straightforward to port Microwindows/Nano-X to another OS, tools and whatnot outstanding. I ported to a "new" 32-bit OS called Fiwix in a few days (see 606bfb0 for details, this could help @shijogeorge24). A new screen driver based heavily on Linux framebuffer was written, with some small changes to the mouse and keyboard drivers, and the port was done. I'm much less familiar with NuttX, and unable to advise on make systems, compilers and OS APIs as I have not ever run it. Have fun at Embedded World! Thank you! |
sic
Hi @ghaerr, just like Linux, NuttX has many options: originally Mr. Greg Nutt create a NX Server (similar to X Server idea for Unix, but using message queue instead of network/sockets), more info: https://nuttx.apache.org/docs/latest/components/nxgraphics/index.html Later on NuttX gained framebuffer driver support, similar to Linux framebuffer: https://nuttx.apache.org/docs/latest/components/drivers/special/framebuffer.html There is also something called lcd_dev that I don't know exactly how it work, but seems to be char device that lets to control LCD displays directly: https://nuttx.apache.org/docs/latest/components/drivers/special/lcd.html I think for simplicity and easy to implement, it should be better add support to microwindows/Nano-X over framebuffer. A fun fact is that some years ago Greg ported (rewrote in C++) the "first" WM for Unix, the TWM: https://www.flickr.com/photos/79703543@N00/52404700603/in/dateposted-public/ unfortunately NX Server and TWM didn't get too much usage by the community because people normally prefer eyes-candy interface! :-) |
Hello @acassis,
I would suggest starting the Nano-X port without client/server, as discussed above first. But if NuttX lacks sockets, then there would be a bit more coding involved to setup the client/server data stream using a message queue. We can get into that later if needed.
Nice documentation. Nano-X also supports emulated frame buffers and has both an emulated framebuffer driver and and framebuffer emulator running on X11. It uses a named pipe to transfer screen chunks and mouse/keyboard data from the graphics application. We probably don't need that for the NuttX port unless its graphics subsystem uses framebuffer emulators a lot, which sometimes comes in handy for building applications on the desktop rather than directly on the target at first. However Nano-X gets around that problem by allowing alternate screen/mouse/keyboard drivers to be linked into the same application with no other changes, allowing for desktop and/or target development.
Great, I would suggest having someone familiar with NuttX framebuffer API replace the equivalent calls in the Linux FB driver in drivers/scr_fb.c.
Nano-X could support direct I/O to LCD but I don't recommend that due to the speed issues encountered, since Nano-X keeps bitmaps and offscreen pixmaps in native framebuffer format for speed, which have to be converted for non-FB hardware.
Agreed!
Well, the same could be said about Microwindows/Nano-X except that sometimes its more important to have small, fast binaries that run well on embedded hardware at the expense of huge graphics libraries with their lovely graphics :) |
I was planning to port nano-x to Nuttx
The text was updated successfully, but these errors were encountered: