[coreboot] SeaBIOS question and cross compilation fix.
Stefan Reinauer
stepan at coresystems.de
Thu Nov 6 16:00:21 CET 2008
Hi, Kevin,
I am experimenting with v3 and better integration of SeaBIOS and
coreboot. For that, I am copying a SeaBIOS image to the FSEG during
coreboot's VGA init code. In addition I added another 32bit entry point
to SeaBIOS at 0xffc0 (Thus, living at 0xfffc0)
int copy_systembios(void)
{
struct mem_file archive, result;
int ret;
init_archive(&archive);
ret = find_file(&archive, "bios.bin", &result);
if (ret) {
printk(BIOS_WARNING, "No legacy bios found.\n");
return -1;
}
process_file(&result, (void *)0xf0000);
return 0;
}
void run_bios(struct device *dev, unsigned long addr)
{
int i;
void (*init_systembios)(void) = (void *)0xfffc0;
copy_systembios();
init_systembios();
real_mode_switch_call_vga((dev->bus->secondary << 8) |
dev->path.pci.devfn);
}
Now, the entry point looks like this:
diff -ur -x .git seabios2/src/romlayout.S seabios/src/romlayout.S
--- seabios2/src/romlayout.S 2008-11-06 15:46:44.000000000 +0100
+++ seabios/src/romlayout.S 2008-11-01 11:38:06.000000000 +0100
@@ -544,6 +544,18 @@
ORG 0xff54
IRQ_ENTRY_ARG 05
+.code32
+ ORG 0xffc0 // coreboot Entry Point
+ mov $0x3f8, %dx
+ mov $0x44, %al
+ outb %al, %dx // print
+ call _code32__init
+ mov $0x3f8, %dx
+ mov $0x45, %al
+ outb %al, %dx
+ ret
+.code16gcc
+
ORG 0xfff0 // Power-up Entry Point
ljmpw $SEG_BIOS, $post16
And _init looks like this (simplified):
void VISIBLE32
_init()
{
outb('@', 0x3f8);
}
Unfortunately, this does not seem to work. The machine jumps somewhere
else and will triple fault eventually.
The outb to serial console in the assembler entry point work fine. If I
comment out the call to _code32__init, the function also returns nicely.
(printing "DE" on the way. But as soon as I leave the call in, seabios
crashes after printing "D" It does not even print the @.
Any hints?
Also, find attached a patch to allow cross compilation of SeaBIOS and
make it work with systems where /bin/echo does not know the option -e
Stefan
--
coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br.
Tel.: +49 761 7668825 • Fax: +49 761 7664613
Email: info at coresystems.de • http://www.coresystems.de/
Registergericht: Amtsgericht Freiburg • HRB 7656
Geschäftsführer: Stefan Reinauer • Ust-IdNr.: DE245674866
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seabios-make.diff
Type: text/x-patch
Size: 1762 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20081106/4906665d/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20081106/4906665d/attachment.sig>
More information about the coreboot
mailing list