On Sat, Aug 01, 2015 at 12:58:40PM +0000, Tal Lubko via Syslinux wrote:> Hi > > I would like SYSLINUX to get input from UART and act accordingly. > For example, I want to choose what rootfs to load according to the sequence received from UART. > So I'd like to know if SYSLINUX a the infrastructure for doing thisYes, Syslinux supports serial ports a.k.a. UARTS. Since the very begining of the project.> and if it maybe some reference for it.http://www.syslinux.org/wiki/index.php/Doc/syslinux search there ( `CTRL-F` ) for keyword 'SERIAL' Feel free to convert your exprience into feedback to us, the Syslinux project. Groeten Geert Stappers -- Leven en laten leven
Hi Geert Thanks for your help. What I'm planning to do is to write COM32 image that will open UART channel and wait for input (until timeout arrives). In case input arrives, it will parse and validate it and act accordingly. My solution doesn't involve user interaction. I've searched the page you've sent me and it talks about serial console and I'm not sure I can use it for my needs. So what I'd like to know is, does Syslinux supports UART in COM32 image? Thanks again, Tal ----- Original Message ----- From: Geert Stappers via Syslinux <syslinux at zytor.com> To: syslinux at zytor.com Cc: Sent: Saturday, August 1, 2015 5:35 PM Subject: Re: [syslinux] interacting with UART On Sat, Aug 01, 2015 at 12:58:40PM +0000, Tal Lubko via Syslinux wrote:> Hi > > I would like SYSLINUX to get input from UART and act accordingly. > For example, I want to choose what rootfs to load according to the sequence received from UART. > So I'd like to know if SYSLINUX a the infrastructure for doing thisYes, Syslinux supports serial ports a.k.a. UARTS. Since the very begining of the project.> and if it maybe some reference for it.http://www.syslinux.org/wiki/index.php/Doc/syslinux search there ( `CTRL-F` ) for keyword 'SERIAL' Feel free to convert your experience into feedback to us, the Syslinux project. Groeten Geert Stappers -- Leven en laten leven _______________________________________________ Syslinux mailing list Submissions to Syslinux at zytor.com Unsubscribe or set options at: http://www.zytor.com/mailman/listinfo/syslinux
On Sat, Aug 1, 2015 at 4:56 PM, Tal Lubko via Syslinux <syslinux at zytor.com> wrote:> Hi Geert > > > Thanks for your help. > What I'm planning to do is to write COM32 image that will open UART channel and wait for input (until timeout arrives). > In case input arrives, it will parse and validate it and act accordingly. > My solution doesn't involve user interaction.You can always think of the UART as the "user".> I've searched the page you've sent me and it talks about serial console and I'm not sure I can use it for my needs.Creativity.> So what I'd like to know is, does Syslinux supports UART in COM32 image?There's two easy options in my opinion, depending on the data you're feeding or can feed via the UART. 1) menu.c32 in serial mode. Using the shortcut keys to select a label then providing an <enter> keystroke, it'll work. Set DEFAULT or ONTIMEOUT, TIMEOUT, SERIAL, CONSOLE, and create LABELs with MENU LABELs containing '^' for the shortcuts. 2) Custom COM32 with character-based read() calls to stdin, setting stdin/stdout with the SERIAL and CONSOLE directives, with calls to syslinux_run_command(). I'd recommend avoiding direct IO calls to the UART in a custom COM32. It's generally unnecessary and embedding ASM looks pretty ugly and not remotely portable. -- -Gene
Tal Lubko via Syslinux <syslinux at zytor.com> writes:> What I'm planning to do is to write COM32 image that will open UART > channel and wait for input (until timeout arrives). In case input > arrives, it will parse and validate it and act accordingly.> My solution doesn't involve user interaction.This is exactly what the Syslinux command interpreter does, if it's configured to use a serial console.> My solution doesn't involve user interaction.Your "user" is anything that feeds the serial input to Syslinux. Whether it cares about the output from Syslinux, does not really matter (unless it blocks Syslinux with flow control).> I've searched the page you've sent me and it talks about serial > console and I'm not sure I can use it for my needs.If you can prescribe what the other end sends though the serial line in the various cases, you can issue arbitrary Syslinux commands on the boot prompt, and you're pretty much done. If the other end sends stuff the command interpreter (or menu.c32) can not digest, you can write a custom COM32 module which reads from the "standard console" stdin (be it an AT keyboard or a serial line), and implement your own parsing and business logic inside that. Or you can write a Lua script to do the same, and then you don't even need to compile anything.> So what I'd like to know is, does Syslinux supports UART in COM32 > image?I think generically it does not. But there's nothing to stop you from reprogramming the UART syslinux_serial_console_info() points you at. Or another one. -- Regards, Feri.