Geert Stappers
2016-May-12 17:45 UTC
[syslinux] syslinux vs isolinux - com32 serial port output problem
On Thu, May 12, 2016 at 06:16:46PM +0200, Good Old Idea via Syslinux wrote:> On Thu, May 12, 2016 at 02:29:52PM +0000, Janz, Burt via Syslinux wrote: > > I have a need to display text to COM2 before loading a kernel. > > The easiest way to do this was to invade menu.c32 (menumain.c) and > > add a function to send the string out to the serial port just before > > the selected menu "label" is executed. In menumain.c, my function is > > called just before 'if (cmdline)'. > > > > > > The code I wrote to initialize the hardware and send individual > > characters to COM2 works as expected when I boot from a USB drive > > (syslinux): the text is seen on COM2. However, when I boot from the > > CD, I don't see any output on COM2.? > > > > > > syslinux.cfg and isolinux.cfg are identical. menu.c32 executes > > properly on the CD, so I'm assuming that I have all the needed com > > module support on the CD. > > > > > > In both cases, the system boots up as expected. The only difference > > appears to be the missing output on COM2 when booting from a CD. Yes, > > I have tried this using different CD drives. I have even tried this > > on a couple of different systems (a "final ship" and an open-frame > > "test fixture"). > > > > > > Any ideas? > > > > Be part of the community that you consult. > Subscribe to the mailinglist.Thank you for doing so. Welcome to this project. Back to ideas: Tell more about the code that was added. How it was build. Not that I have profound knowledge of Syslinux code base, but thing I can tell is that sharing which function call was used, will help. What I guess that is wrong, is mixing modules from different builds. Groeten Geert Stappers Member of the usual suspects, does non-subscribe-postings-approval -- Leven en laten leven
Janz, Burt
2016-May-12 18:14 UTC
[syslinux] syslinux vs isolinux - com32 serial port output problem
Hi Geert, I'm building syslinux 6.04 from scratch to prevent any issues with mismatched com32 modules. This gives me a "pure" set of modules as well as "pure" isolinux and syslinux cores. menu.c32 works perfectly on both the USB and CD boot media: I can move around the menu and select the command that I wish to use. In all cases, both the USB and CD boot properly into the Linux kernel. I cannot plug both a USB and CD into this system at the same time, so I'm quite sure that I'm booting from the correct media. For that matter, the BIOS even says "Boot from CD" and displays the isolinux-debug.bin messages before the menu appears - but only when booting from CD. The problem manifests itself as a failure to send characters to COM2 only when booting the CD. If you look inside com32/menu/menumain.c right near the bottom of the file, you'll see "if (cmdline)" IIUC that's where the fully formatted command line is handed off from the menu to "execute()". I added a "send_rdu_message()" function directly before "if (cmdline)". My "send_rdu_message()" sets up the serial port (loads the speed divisor, enables the port, etc) and then pumps characters one at a time to the serial port (via "outb(ch,COM2+THR)". This works properly when I boot the system from the USB drive. Since I'm using the same menu.c32 file on both USB and CD, there should be no difference: I should see the characters on COM2 whether booting USB or CD. So my question is this: is there something operationally different in the way isolinux.asm calls menu.c32? And could this be at the core of my problem? Thanks! \burt
Geert Stappers
2016-May-12 21:05 UTC
[syslinux] syslinux vs isolinux - com32 serial port output problem
On Thu, May 12, 2016 at 06:14:31PM +0000, Janz, Burt via Syslinux wrote:> On Thu, May 12, 2016 at 07:45:08PM +0200, Geert Stappers via Syslinux wrote: > > > > Tell more about the code that was added. How it was build. > > > > > > Not that I have profound knowledge of Syslinux code base, > > but thing I can tell is that sharing which function call was used, > > will help. > > > > What I guess that is wrong, is mixing modules from different builds. > > > > Hi Geert,Hello Mailinglist,> I'm building syslinux 6.04 from scratch to prevent any issues with > mismatched com32 modules. This gives me a "pure" set of modules as > well as "pure" isolinux and syslinux cores. > > menu.c32 works perfectly on both the USB and CD boot media: I can > move around the menu and select the command that I wish to use. > In all cases, both the USB and CD boot properly into the Linux > kernel. I cannot plug both a USB and CD into this system at the > same time, so I'm quite sure that I'm booting from the correct media. > For that matter, the BIOS even says "Boot from CD" and displays the > isolinux-debug.bin messages before the menu appears - but only when > booting from CD. > > The problem manifests itself as a failure to send characters to COM2 > only when booting the CD. > > If you look inside com32/menu/menumain.c right near the bottom of the > file, you'll see "if (cmdline)" IIUC that's where the fully formatted > command line is handed off from the menu to "execute()". I added a > "send_rdu_message()" function directly before "if (cmdline)".--- a/com32/menu/menumain.c +++ b/com32/menu/menumain.c @@ -1151,6 +1151,8 @@ int main(int argc, char *argv[]) local_cursor_enable(false); printf("\033[?25h\033[%d;1H\033[0m", END_ROW); + send_rdu_message(); + if (cmdline) { uint32_t type = parse_image_type(cmdline);> My "send_rdu_message()" sets up the serial port (loads the speed > divisor, enables the port, etc) and then pumps characters one at a time > to the serial port (via "outb(ch,COM2+THR)".Acknowledge. (so no "printf" function from Syslinux )> This works properly when I boot the system from the USB drive. > > Since I'm using the same menu.c32 file on both USB and CD, there should > be no difference: I should see the characters on COM2 whether booting > USB or CD.Yep, but if it was, we wouldn't have this email thread :-/> So my question is this: is there something operationally different in > the way isolinux.asm calls menu.c32? And could this be at the core of > my problem?I don't known. I wonder if CDROM-drive interrupt is on the same IRQ as COM2? Groeten Geert Stappers -- Leven en laten leven
Gene Cumm
2016-May-13 10:05 UTC
[syslinux] syslinux vs isolinux - com32 serial port output problem
On Thu, May 12, 2016 at 2:14 PM, Janz, Burt via Syslinux <syslinux at zytor.com> wrote:> Hi Geert, > > I'm building syslinux 6.04 from scratch to prevent any issues with mismatched com32 modules. This gives me a "pure" set of modules as well as "pure" isolinux and syslinux cores.6.04 hasn't seen a full release, only the pre1 pre-release.> menu.c32 works perfectly on both the USB and CD boot media: I can move around the menu and select the command that I wish to use. In all cases, both the USB and CD boot properly into the Linux kernel. I cannot plug both a USB and CD into this system at the same time, so I'm quite sure that I'm booting from the correct media. For that matter, the BIOS even says "Boot from CD" and displays the isolinux-debug.bin messages before the menu appears - but only when booting from CD.I'm guessing physically the machine has 1 USB port and you're using a USB-CD drive. This shouldn't be an issue but may be suspect. Tried any machines with an IDE/SATA CD drive? Considered modifying linux.c32 instead and calling it? This would allow you to test without ever loading menu.c32 isolinux-debug.bin is for debugging the loading of isolinux.bin, not items later in the boot process like ldlinux.c32, the config or menu.c32. -- -Gene
Possibly Parallel Threads
- syslinux vs isolinux - com32 serial port output problem
- syslinux vs isolinux - com32 serial port output problem
- syslinux vs isolinux - com32 serial port output problem
- syslinux vs isolinux - com32 serial port output problem
- Syslinux 5.10pre1 - Failed to load COM32 file .c32