Subject: fix for serial boot in bios-1.06

From: Nicolas Pitre <[email-masked]>
Date: Wed, 1 Dec 1999 12:24:47 -0500 (EST)

Unfortunately, the serial boot is subtily broken in bios-1.06.

Here is a patch in attachment that fixes the problem.

Enjoy!

Nicolas
diff -urN 1.06/bios/drivers/char/ry.c bios/drivers/char/ry.c
--- 1.06/bios/drivers/char/ry.c	Sun Nov 28 16:16:51 1999
+++ bios/drivers/char/ry.c	Wed Dec  1 12:07:31 1999
@@ -41,7 +41,7 @@
 
 static void tx( int c )
 {
-  while (*((volatile int *)(SERBASE + 0x18)) & 8);
+  while (*((volatile int *)(SERBASE + 0x18)) & (1<<5));
   *((volatile int *)(SERBASE)) = c;
 }
 
@@ -51,9 +51,9 @@
   unsigned int expire = centisecs + timeout * 100;
 
   while( centisecs <= expire ){
-    if ( ! *((volatile unsigned int *)(SERBASE + 0x18)) & 16) {
+    if ( ! (*((volatile int *)(SERBASE + 0x18)) & (1<<4)) ) {
       c = *((volatile int *)(SERBASE));
-      return c;
+      return c & 0xff;
     }
   }
   return TIMEOUT;
@@ -193,10 +193,11 @@
 {
   int res;
 
-  printf ("Now send file with ymodem...\n" );
+  printf( "\nNow send file with y-modem (^X to abort) ...\n" );
   pout = (unsigned long *)load_addr;
   res = wcreceive();
-  printf( "Transfer %s, press any key.\n", 
+  wait_cs( 50 );
+  printf( "\nTransfer %s, press any key.\n", 
           (res == OK) ? "complete" : "failed" );
   getc();
   return res;
@@ -208,7 +209,7 @@
 }
 
 struct bootdev boot_serial = {
-        "serial",
+        "serial port",
         serial_dummy,
         serial_dummy,
         serial_load,