Thread: Re: [Etherboot-developers] patch for i82559 on-board eepro100.c
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: <ke...@us...> - 2003-04-08 00:01:28
|
>In order to get the eepro100 netbooting on my onboard eepro100 I found the >mail below[1] and I made the patch below for etherboot-5.0.9 to do the >same, and yeh for me it works.. > >I was transmitting the first packet for DHCP and then hanging hard, > >Dave. > >[1] http://beowulf.es.embnet.org/listarchives/linux-eepro100/1999/06/0032.html Thanks, I'll apply to both 5.0 and 5.1. Looks like you solved a long standing mystery. |
|
[Etherboot-developers] Problem with LinuxBios (latest cvs), Etherboot 5.1.7 - ide_disk, mkelfimg 2.0
From: Joey N. <jo...@jo...> - 2003-04-08 23:08:11
|
Hello, I've very nearly got this all going on my Geode GX1 based system. 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 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. 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. Thanks, Joey Nelson |
|
From: <ebi...@ln...> - 2003-04-08 23:20:21
|
"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/compressed/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/compressed/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
|
|
From: Joey N. <jo...@jo...> - 2003-04-09 22:32:50
|
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 |
|
From: <ebi...@ln...> - 2003-04-09 22:43:08
|
"Joey Nelson" <jo...@jo...> writes: > Eric, > > I'm using version 2.0 of mkelfImage. You might want to try version 2.3... ftp://ftp.lnxi.com/pub/src/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. I bet you have the RH7 broken binutils/gas bug, that puts junk at the end of assembly files. Definitely try the latest mkelfImage. If it errors out with an internal error than your binutils are broken. That is the only thing I can think of that would eat the command line. A double check would be to run strings on kernel.elf to make certain the command line is in there. Eric > 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 |
|
From: Timothy L. <tl...@ro...> - 2003-04-09 23:20:37
|
> > I applied the patch you supplied and it appear the problem is that > > The kernel command line is not getting set. > > Would this also affect the option-129 "NIC=xxxxxx" for isa cards? I was just testing 5.1 3c509 and 3c515 and the ltsp kernel complained that it could not detect the nic and to set NIC= in the dhcpd.conf file. It is set. Tim |
|
From: <ebi...@ln...> - 2003-04-09 23:48:01
|
"Timothy Legge" <tl...@ro...> writes: > > > I applied the patch you supplied and it appear the problem is that > > > The kernel command line is not getting set. > > > > > Would this also affect the option-129 "NIC=xxxxxx" for isa cards? I was > just testing 5.1 3c509 and 3c515 and the ltsp kernel complained that it > could not detect the nic and to set NIC= in the dhcpd.conf file. It is > set. Totally different issue. Unless the ltsp kernel started using mkelfImage, instead of the more standard mknbi/mkelf that comes with etherboot. mknbi/mkelf enter the kernel at it's 16bit entry point. mkelfImage enters the kernel at it's not really supported 32bit entry point. Eric |
|
From: Joey N. <jo...@jo...> - 2003-04-10 01:10:23
|
Eric, I tried version 2.3 and it whines Internal errors and magic numbers. So it appears to be a binutils problem. For a temporary work around I'm using an old version in the LinuxBios cvs. It is working well enough to get me going. Thanks, Joey Nelson -----Original Message----- From: eth...@li... [mailto:eth...@li...] On Behalf Of Eric W. Biederman Sent: Wednesday, April 09, 2003 3:44 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: > Eric, > > I'm using version 2.0 of mkelfImage. You might want to try version 2.3... ftp://ftp.lnxi.com/pub/src/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. I bet you have the RH7 broken binutils/gas bug, that puts junk at the end of assembly files. Definitely try the latest mkelfImage. If it errors out with an internal error than your binutils are broken. That is the only thing I can think of that would eat the command line. A double check would be to run strings on kernel.elf to make certain the command line is in there. Eric > 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 ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com _______________________________________________ Etherboot-developers mailing list Eth...@li... https://lists.sourceforge.net/lists/listinfo/etherboot-developers |