-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I had some time today. I have PCI SATA RAID (fake raid) with Silicon Image chip
on it. The option rom runs fine but SeaBIOS complains that EBDA was relocated. I
fixed that in the patch. Also I fixed the stuff so now I get:

Inspecting possible rom at f1200000 (vd=31141095 bdf=00000530)
Copying option rom from f1200000 to 000ca000
Running option rom at 0000ca00:00000003
Changing serial settings was 00000003/00000002 now 00000003/00000000
Option rom at 0000ca00:00000003 attempted to move ebda from 00009fc0 to 00009f80
$PnP at 000cb220
Running BCV 000031c7
Running option rom at 0000ca00:000031c7
Option rom at 0000ca00:000031c7 attempted to move ebda from 00009fc0 to 00009f80
Adding IPL
Press F12 for boot menu.

Select boot device:

1. Floppy
2. Hard Disk
3. CD-Rom
4. Floppy [05:30-0 ST3250310AS         ]

Jump to int19
enter handle_19:
  NULL
Booting from Floppy [05:30-0 ST3250310AS         ]...
fail check_drive:384(00000080):
  a=00000201 b=00000000 c=00000001 d=00000000 si=00000000 di=00000000
  ds=00000000 es=000007c0 ip=0000e7e9 cs=0000f000 f=00000002 r=00007b5e
Boot failed: could not read the boot disk

enter handle_18:
  NULL

The WIP patch is attached. I had no time to investigate why it does not actually
boot. Maybe next time.

Rudolf
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklIQAcACgkQ3J9wPJqZRNXPCgCePij8Nodva+Qmw8DUdBd6GosO
uskAn1PWHYmsJqDgjDYTKSH4zYd5d+27
=mBQO
-----END PGP SIGNATURE-----
Index: seabios/src/biosvar.h
===================================================================
--- seabios.orig/src/biosvar.h	2008-12-16 21:35:35.708371665 +0100
+++ seabios/src/biosvar.h	2008-12-16 21:43:18.739372246 +0100
@@ -289,15 +289,16 @@
     struct ipl_s ipl;
 } PACKED;
 
-#define EBDA_SIZE DIV_ROUND_UP(sizeof(struct extended_bios_data_area_s), 1024)
-#define BASE_MEM_IN_K (640 - EBDA_SIZE)
 
+#define SEG_EBDA GET_BDA(ebda_seg)
+#define EBDA_SIZE_SEABIOS DIV_ROUND_UP(sizeof(struct extended_bios_data_area_s), 1024)
 // Accessor functions
 #define GET_EBDA(var) \
     GET_FARVAR(SEG_EBDA, ((struct extended_bios_data_area_s *)0)->var)
 #define SET_EBDA(var, val) \
     SET_FARVAR(SEG_EBDA, ((struct extended_bios_data_area_s *)0)->var, (val))
-
+#define EBDA_SIZE GET_EBDA(size)
+#define BASE_MEM_IN_K (640 - (EBDA_SIZE * 1024))
 
 /****************************************************************
  * Bios Config Table
Index: seabios/src/config.h
===================================================================
--- seabios.orig/src/config.h	2008-12-16 21:34:23.391372356 +0100
+++ seabios/src/config.h	2008-12-16 21:38:09.723370197 +0100
@@ -102,7 +102,7 @@
 
 // Important real-mode segments
 #define SEG_BIOS     0xf000
-#define SEG_EBDA     0x9fc0
+#define SEG_EBDA_SEABIOS 0x9fc0
 #define SEG_BDA      0x0000
 
 // Segment definitions in protected mode (see rombios32_gdt in romlayout.S)
Index: seabios/src/optionroms.c
===================================================================
--- seabios.orig/src/optionroms.c	2008-12-16 21:29:49.307371164 +0100
+++ seabios/src/optionroms.c	2008-12-17 00:25:34.263370284 +0100
@@ -25,8 +25,8 @@
     u8 size;
     u8 initVector[4];
     u8 reserved[17];
-    u16 pcioffset;
-    u16 pnpoffset;
+volatile    u16 pcioffset;
+volatile    u16 pnpoffset;
 } PACKED;
 
 struct pci_data {
@@ -45,7 +45,7 @@
     u16 reserved;
 } PACKED;
 
-struct pnp_data {
+    struct pnp_data {
     u32 signature;
     u8 revision;
     u8 len;
@@ -100,9 +100,9 @@
 
     debug_serial_setup();
 
-    if (GET_BDA(ebda_seg) != SEG_EBDA)
-        BX_PANIC("Option rom at %x:%x attempted to move ebda from %x to %x\n"
-                 , seg, offset, SEG_EBDA, GET_BDA(ebda_seg));
+    if (GET_BDA(ebda_seg) != SEG_EBDA_SEABIOS)
+        dprintf(1, "Option rom at %x:%x attempted to move ebda from %x to %x\n"
+                 , seg, offset, SEG_EBDA_SEABIOS, GET_BDA(ebda_seg));
 }
 
 // Verify that an option rom looks valid
@@ -143,7 +143,7 @@
 
 // Add a BEV vector for a given pnp compatible option rom.
 static void
-add_ipl(struct rom_header *rom, struct pnp_data *pnp)
+add_ipl(struct rom_header *rom, struct pnp_data *pnp, u8 type)
 {
 #define ebda ((struct extended_bios_data_area_s *)MAKE_FARPTR(SEG_EBDA, 0))
 
@@ -153,11 +153,13 @@
     if (! CONFIG_BOOT)
         return;
 
+    dprintf(1, "Adding IPL\n");
+
     if (ebda->ipl.count >= ARRAY_SIZE(ebda->ipl.table))
         return;
 
     struct ipl_entry_s *ip = &ebda->ipl.table[ebda->ipl.count];
-    ip->type = IPL_TYPE_BEV;
+    ip->type = type;
     ip->vector = (FARPTR_TO_SEG(rom) << 16) | pnp->bev;
 
     u16 desc = pnp->productname;
@@ -341,13 +343,29 @@
             callrom(rom, OPTION_ROM_INITVECTOR, 0);
             continue;
         }
-        // PnP rom.
-        if (pnp->bev)
-            // Can boot system - add to IPL list.
-            add_ipl(rom, pnp);
-        else if (pnp->bcv)
-            // Has BCV - run it now.
-            callrom(rom, pnp->bcv, 0);
+	/* rebuild the PNP block, init migh have change that */
+	pnp = get_pnp_rom(rom);
+
+	/* for further details check BIOS Boot Specification */
+	while (pnp) {
+			dprintf(1, "$PnP at %p\n",pnp);
+
+		if ((pnp->bev) && (!pnp->bcv))
+		        add_ipl(rom, pnp, IPL_TYPE_BEV);
+
+		if ((!pnp->bev) && (pnp->bcv)) {
+			dprintf(1, "Running BCV %x\n",pnp->bcv);
+        	    callrom(rom, pnp->bcv, 0);
+		        add_ipl(rom, pnp, pnp->type_lo);
+		}
+
+		if (pnp->nextoffset)
+			pnp = (struct pnp_data *) (((u8 *) pnp) + pnp->nextoffset);
+		else
+			pnp = NULL;
+	}
+
+
     }
 }
 
Index: seabios/src/post.c
===================================================================
--- seabios.orig/src/post.c	2008-12-16 21:34:08.740371820 +0100
+++ seabios/src/post.c	2008-12-16 22:06:22.676370086 +0100
@@ -19,7 +19,6 @@
 #include "bregs.h" // struct bregs
 
 #define bda ((struct bios_data_area_s *)MAKE_FARPTR(SEG_BDA, 0))
-#define ebda ((struct extended_bios_data_area_s *)MAKE_FARPTR(SEG_EBDA, 0))
 
 void
 __set_irq(int vector, void *loc)
@@ -78,9 +77,11 @@
 static void
 init_ebda()
 {
+    struct extended_bios_data_area_s *ebda;
+    ebda = (struct extended_bios_data_area_s *) MAKE_FARPTR(SEG_EBDA_SEABIOS, 0);
     memset(ebda, 0, sizeof(*ebda));
-    ebda->size = EBDA_SIZE;
-    SET_BDA(ebda_seg, SEG_EBDA);
+    ebda->size = EBDA_SIZE_SEABIOS;
+    SET_BDA(ebda_seg, SEG_EBDA_SEABIOS);
     SET_BDA(ivecs[0x41].seg, SEG_EBDA);
     SET_BDA(ivecs[0x41].offset
             , offsetof(struct extended_bios_data_area_s, fdpt[0]));
@@ -150,6 +151,9 @@
 static void
 init_boot_vectors()
 {
+    struct extended_bios_data_area_s *ebda;
+    ebda = (struct extended_bios_data_area_s *) MAKE_FARPTR(SEG_EBDA, 0);
+
     if (! CONFIG_BOOT)
         return;
     dprintf(3, "init boot device ordering\n");
Index: seabios/src/boot.c
===================================================================
--- seabios.orig/src/boot.c	2008-12-17 00:33:56.784373541 +0100
+++ seabios/src/boot.c	2008-12-17 00:34:14.687369545 +0100
@@ -35,7 +35,7 @@
 
     /* print product string if BEV */
     char *far_description = GET_EBDA(ipl.table[bootdev].description);
-    if (type == 4 && far_description != 0) {
+    if (far_description != 0) {
         char description[33];
         /* first 32 bytes are significant */
         memcpy_far(MAKE_FARPTR(GET_SEG(SS), description), far_description, 32);
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to