Eric,
I'm using version 2.0 of mkelfImage.
I used syslinux under the standard BIOS to test the kernel.
I applied the patch you supplied and it appear the problem is that
The kernel command line is not getting set.
In the initialize_linux_params function in linux-i386/convert-params, I
put debug code to print the command line
(info->real_mode->command_line). After it should be initialized, but it
appear to be empty.
Thanks,
Joey Nelson
Design Engineer
JoeScan
www.joescan.com
509-332-3644
-----Original Message-----
From: eth...@li...
[mailto:eth...@li...] On Behalf Of
Eric W. Biederman
Sent: Tuesday, April 08, 2003 4:22 PM
To: Joey Nelson
Cc: 'Etherboot developers list'
Subject: Re: [Etherboot-developers] Problem with LinuxBios (latest cvs),
Etherboot 5.1.7 - ide_disk, mkelfimg 2.0
"Joey Nelson" <jo...@jo...> writes:
> Hello,
>
> I've very nearly got this all going on my Geode GX1 based system.
Interesting you have shortened mkelfImage to mkelfimg. Which
version are you running anyway?
> It get all the way to loading the linux kernel elf image from a
compact
> flash and the last thing printed is:
> Firmware type: LinuxBIOS
The Fimware type: LinuxBIOS is printed by the code prepend to the kernel
by mkelfImage. So you image loaded.
Which means the image loaded. And I don't expect this disk support
LBA48
mode so the recent fix to get that working should not be your issue.
> I've tested this same kernel under the syslinux boot loader on the
same
> system with the same command line and it works fine with a serial
> console.
syslinux works under LinuxBIOS?
Even if you did not test under LinuxBIOS if it works under another
BIOS the kernel still should be quite close.
> I use the following line to make my kernel.elf image.
> mkelfimg --kernel=/usr/src/linux/i386/boot/bzImage \
> --output=kernel.elf \
> --command-line="console=ttyS0,38400n8 root=/dev/hda2"
>
> Any suggestions on what I should be checking.
Last time I saw something like this I traced it down to the kernel
dying early in bootup before it could initialize the serial console.
Attached is a patch against 2.4.17 but with a little tweaking the code
should work on any kernel. It gives very serial console output so
you can see what the kernel is actually doing.
Eric
diff -uNrX linux-exclude-files
/mnt/hda1/home/eric/projects/linux/linux-2.4.17/arch/i386/boot/compresse
d/misc.c linux-2.4.17.jay/arch/i386/boot/compressed/misc.c
---
/mnt/hda1/home/eric/projects/linux/linux-2.4.17/arch/i386/boot/compresse
d/misc.c Mon Nov 12 10:59:43 2001
+++ linux-2.4.17.jay/arch/i386/boot/compressed/misc.c Fri Mar 1
13:00:15 2002
@@ -161,6 +161,32 @@
{
free_mem_ptr = (long) *ptr;
}
+
+/* Base Address */
+#define TTYS0 0x3f8
+#define TTYS0_LSR (TTYS0+0x05)
+#define TTYS0_TBR (TTYS0+0x00)
+
+static void ttys0_tx_byte(unsigned byte)
+{
+ /* Wait until I can send a byte */
+ while((inb(TTYS0_LSR) & 0x20) == 0)
+ ;
+ outb(byte, TTYS0_TBR);
+ /* Wait until the byte is transmitted */
+ while(!(inb(TTYS0_LSR) & 0x40))
+ ;
+}
+static void puts_serial(const char *str)
+{
+ int c;
+ while( ( c = *str++ ) != '\0') {
+ if (c == '\n') {
+ ttys0_tx_byte('\r');
+ }
+ ttys0_tx_byte(c);
+ }
+}
static void scroll(void)
{
@@ -171,7 +197,7 @@
vidmem[i] = ' ';
}
-static void puts(const char *s)
+static void puts_video(const char *s)
{
int x,y,pos;
char c;
@@ -206,6 +232,12 @@
outb_p(0xff & (pos >> 9), vidport+1);
outb_p(15, vidport);
outb_p(0xff & (pos >> 1), vidport+1);
+}
+
+static void puts(const char *s)
+{
+ puts_serial(s);
+ puts_video(s);
}
static void* memset(void* s, int c, size_t n)
diff -uNrX linux-exclude-files
/mnt/hda1/home/eric/projects/linux/linux-2.4.17/arch/i386/kernel/setup.c
linux-2.4.17.jay/arch/i386/kernel/setup.c
---
/mnt/hda1/home/eric/projects/linux/linux-2.4.17/arch/i386/kernel/setup.c
Fri Dec 21 10:41:53 2001
+++ linux-2.4.17.jay/arch/i386/kernel/setup.c Mon Feb 25 17:15:39 2002
@@ -779,12 +779,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
-------------------------------------------------------
This SF.net email is sponsored by: ValueWeb:
Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
No other company gives more support or power for your dedicated server
http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
_______________________________________________
Etherboot-developers mailing list
Eth...@li...
https://lists.sourceforge.net/lists/listinfo/etherboot-developers
|