Ronald G Minnich <[EMAIL PROTECTED]> writes:

> RE the linuxbios table. One question, I followed part of the discussion on
> kernel. Werner Almesberger at some point mentioned text tables. It sort of
> looks like the sparc code knows how to parse open boot type tables. Eric
> I'm wondering if that makes any sense -- textual tables instead of the
> initialized structures. Just curious what you thought of that.

Well I don't think openboot/openfirmware has text based tables but
I may be wrong there.  My honest opinion is that we are probably best
off defining our own table structures, and doing the corresponding kernel
patches.  That way we don't have other people's legacy junk getting
in the way :)

Of course defining our own tables does take a little more thought...

If it ever makes sense we can export multiple tables.

> I'm still trying to get etherboot going (which Bharat was doing last
> week) and even with vmlinux it still stops at:
> 
> Firmware type: linuxBIOS

Which is from convert_params.c
 
> This is a 2.4.17 kernel that boots fine from flash on the l440gx. I get no
> messages at all. Any hints welcome :-)

Hunch.  Which loader are you using in the case that works, the old
linux loader.  So when you run mkelfImage are you actually passing it
a command line? 

And you have a patched mkelfImage, but you shouldn't need that for loading
from etherboot.  So the non patched version might be worth trying.

And for additional debugging help I have attached a patch that enables
early serial console support.  Which should at least get some output
out.

Eric


diff -uNrX linux-exclude-files linux-2.4.14/arch/i386/kernel/setup.c 
linux-2.4.14.eb4.1/arch/i386/kernel/setup.c
--- linux-2.4.14/arch/i386/kernel/setup.c       Thu Nov  8 13:43:40 2001
+++ linux-2.4.14.eb4.1/arch/i386/kernel/setup.c Wed Nov 28 11:45:33 2001
@@ -768,12 +768,89 @@
        }
 }
 
+#if 1
+#include <linux/console.h>
+#include <asm/io.h>
+
+static void ttys0_write(struct console *console, const char *str, unsigned len);
+
+static struct console minimal_serial_console = {
+       write: ttys0_write,
+       flags: CON_ENABLED,
+       next: NULL,
+};
+
+/* Base Address */
+#define TTYS0 0x3f8
+/* Data */
+#define TTYS0_RBR (TTYS0+0x00)
+#define TTYS0_TBR (TTYS0+0x00)
+/* Control */
+#define TTYS0_IER (TTYS0+0x01)
+#define TTYS0_IIR (TTYS0+0x02)
+#define TTYS0_FCR (TTYS0+0x02)
+#define TTYS0_LCR (TTYS0+0x03)
+#define TTYS0_MCR (TTYS0+0x04)
+
+#define TTYS0_DLL (TTYS0+0x00)
+#define TTYS0_DLM (TTYS0+0x01)
+/* Status */
+#define TTYS0_LSR (TTYS0+0x05)
+#define TTYS0_MSR (TTYS0+0x06)
+#define TTYS0_SCR (TTYS0+0x07)
+
+#define TTYS0_BAUD 9600
+#define TTYS0_DIV  (115200/TTYS0_BAUD)
+
+static void ttys0_init(void)
+{
+       /* disable interrupts */
+       outb(0x0, TTYS0_IER);
+       /* enable fifo's */
+       outb(0x01, TTYS0_FCR);
+       /* Set Baud Rate Divisor to TTYS0_BAUD */
+       outb(0x83, TTYS0_LCR);
+       outb(TTYS0_DIV & 0xFF,   TTYS0_DLL);
+       outb((TTYS0_DIV >> 8) & 0xFF, TTYS0_DLM);
+       outb(0x03, TTYS0_LCR);
+
+}
+static void ttys0_tx_byte(unsigned byte)
+{
+       while((inb(TTYS0_LSR) & 0x20) == 0)
+               ;
+       outb(byte, TTYS0_TBR);
+}
+static void ttys0_write(struct console *console, const char *str, unsigned len)
+{
+       static int firsttime = 1;
+       int c;
+       if ((console->next) || (console_drivers != &minimal_serial_console))
+               return;
+       if (firsttime) {
+               firsttime = 0;
+               ttys0_init();
+       }
+       while(len--) {
+               c = *str++;
+               if (c == '\n') {
+                       ttys0_tx_byte('\r');
+               }
+               ttys0_tx_byte(c);
+       }
+}
+
+#endif
+
 void __init setup_arch(char **cmdline_p)
 {
        unsigned long bootmap_size, low_mem_size;
        unsigned long start_pfn, max_pfn, max_low_pfn;
        int i;
 
+#if 1
+       console_drivers = &minimal_serial_console;
+#endif
 #ifdef CONFIG_VISWS
        visws_get_board_type_and_rev();
 #endif

Reply via email to