I've recently created a legacybios v0.2.3 release. For those that wish to test a prebuilt elf file, I've uploaded one at:
http://linuxtogo.org/~kevin/legacybios/bios.bin.elf-0.2.3
The full source code is available via git by pulling the legacybios project at:
The above elf file was created with the following options in config.h changed:
#define CONFIG_COREBOOT 1 #define CONFIG_DEBUG_LEVEL 6 #define CONFIG_DEBUG_SERIAL 1 #define CONFIG_FLOPPY_SUPPORT 0
In order for legacybios to work with coreboot tables, one needs to change the file src/arch/i386/boot/tables.c in coreboot-v2 so that the bios tables are created in high memory. The function write_tables() should be altered so that rom_table_start and rom_table_end point to high memory instead of 0xf0000. For example, I use:
--- arch/i386/boot/tables.c (revision 3366) +++ arch/i386/boot/tables.c (working copy) @@ -42,8 +42,8 @@ unsigned long low_table_start, low_table_end, new_low_table_end; unsigned long rom_table_start, rom_table_end;
- rom_table_start = 0xf0000; - rom_table_end = 0xf0000; + rom_table_start = ((256-32)*1024*1024) - 64*1024; + rom_table_end = rom_table_start; /* Start low addr at 16 bytes instead of 0 because of a buglet * in the generic linux unzip code, as it tests for the a20 line. */ @@ -67,9 +67,10 @@ post_code(0x96);
/* The smp table must be in 0-1K, 639K-640K, or 960K-1M */ - new_low_table_end = write_smp_table(low_table_end); // low_table_end is 0x10 at this point + rom_table_end = write_smp_table(rom_table_end); + rom_table_end = (rom_table_end+1023) & ~1023;
-#if HAVE_MP_TABLE==1 +#if 0 // HAVE_MP_TABLE==1 /* Don't write anything in the traditional x86 BIOS data segment, * for example the linux kernel smp need to use 0x467 to pass reset vector */
rom_table_start = ((256-32)*1024*1024) - 64*1024; rom_table_end = rom_table_start;
Note that by relocating the tables to high memory, legacybios can then copy the appropriate tables back to 0xf0000 for the target operating system to find.
I've successfully booted freedos and linux with legacybios and coreboot-v2 on my via epia-m. I have successfully booted win-xp with legacybios and coreboot-v2 on qemu, but have not had success with win-xp on my epia-m.
-Kevin