I am a developer from the 'Frugalware Linux' distribution. I have been trying to use the syslinux lua module to support more dynamic menu generation at runtime for our distributed ISO images, as Grub2 is not very configurable for this. For example, I need raw access to the PCI bus information to configure the video output kernel boot parameters for specific hardware. Specifically, 'vga=' has to be used to get a framebuffer for cards that lack KMS. But, you must use 'video=' for KMS capable hardware. Thus, I could really use a better system than what I do now, which is to forcefully disable KMS and rely on the generic vesa framebuffer. I have been working on patches to extend the PCI and VESA modules in the lua module. First, I need access to the full PCI information. It doesn't expose the device class that is available in the C API. I have written a patch for this, but I don't know if it meets the code standards for this project. Second, I need to have a workingstdin when in VESA mode. As it stands, io.read() fails when in VESA mode. Itappears to be because of the dev_rawcon_r being the assigned input console. IfI modify the source to use dev_stdcon_r, it works as it does outside of VESA mode. However, I need to have raw access to the stdin if I am to design a menu drawing system in lua using ANSI control sequences because I need input control over arrow keys and such. Third, I need to get access to the cell dimensions. I have already written a patch for this which exposes the cell dimensions through the VESA module. I only need this if I have to write the menu drawing myself. Lastly, I could instead use the menu library API I saw in the C API, but it's not available at all for use in the LUA module. I have not the experience to easily do this myself. Any advice on how I can address these issues?
James Buren <ryu0 at ymail.com> writes:> First, I need access to the full PCI information. It doesn't expose > the device class that is available in the C API. I have written a > patch for this, but I don't know if it meets the code standards for > this project.Post them here, and hopefully somebody will tell.> Second, I need to have a working stdin when in VESA mode. As it > stands, io.read() fails when in VESA mode. It appears to be because of > the dev_rawcon_r being the assigned input console. If I modify the > source to use dev_stdcon_r, it works as it does outside of VESA > mode. However, I need to have raw access to the stdin if I am to > design a menu drawing system in lua using ANSI control sequences > because I need input control over arrow keys and such.I don't get how you'd use both modes together. Anyway, I added a simple binding to the get_key() function in a patch series posted here last week (subject: Upgrade to Lua 5.2.2, add filesystem module and get_key binding). Start at https://gist.github.com/wferi/6989458 if interested. It works without changing the console mode.> Third, I need to get access to the cell dimensions. I have already > written a patch for this which exposes the cell dimensions through the > VESA module. I only need this if I have to write the menu drawing > myself. Lastly, I could instead use the menu library API I saw in the > C API, but it's not available at all for use in the LUA module. I have > not the experience to easily do this myself.I thought about adding a Lua binding to libmenu.c32, but on one hand I'd have no immediate use for that, and on the second I wanted to get some feedback before committing too much work to the approach prototyped in the mentioned patch series. Sadly, I haven't got any reaction yet. -- Cheers, Feri.
Ferenc Wagner <wferi at niif.hu> writes:> James Buren <ryu0 at ymail.com> writes: > >> Lastly, I could instead use the menu library API I saw in the C API, >> but it's not available at all for use in the LUA module. I have not >> the experience to easily do this myself. > > I thought about adding a Lua binding to libmenu.c32https://github.com/wferi/syslinux/commit/7fc1d268b8e6996a86b41f966e10edb8db401f9e binds enough of libmenu.c32 to implement simple.c in Lua as https://gist.github.com/wferi/7136863#file-simplemenu-lua -- Regards, Feri.
Seemingly Similar Threads
- syslinux lua support
- pull request: upgrade to Lua 5.2.3, automatic Linux boot menu and cmenu binding
- Upgrade to Lua 5.2.2, add filesystem module and get_key binding
- Upgrade to Lua 5.2.2, add filesystem module and get_key binding
- Upgrade to Lua 5.2.2, add filesystem module and get_key binding