On Mon, Jan 17, 2011 at 09:13:47PM +0100, Marc Bertens wrote:
> Kevin,
>
> This is the final patch for Kconfig for SeaBIOS.
>
> Tested-by Marc Bertens <mbertens(a)xs4all.nl>
> Signed-off Marc Bertens <mbertens(a)xs4all.nl>
>
> Its now all in one big patch, it has now one config.h file. This should
> be straight forward.
Thanks. Unfortunately, it's still too big for the mailing list.
Can you post this in two patches - one that adds the tools/kconfig/
…
[View More]files, and one that modifies the SeaBIOS files (Makefile, src/*). I
can put the tools/kconfig/ part on the web, and we can discuss the
seabios parts on the mailing list.
Some comments on that patch:
The patch seems to be missing src/Kconfig.
[...]
> +#elif CONFIG_NAME_QEMU
> +/* the Q-Emu name was selected */
> +#define CONFIG_APPNAME "QEMU"
> +#define CONFIG_CPUNAME8 "QEMUCPU "
> +#define CONFIG_APPNAME6 "QEMU "
> +#define CONFIG_APPNAME4 "QEMU"
> +
> +#elif CONFIG_NAME_COREBOOT
> +/* the Coreboot name was selected */
> +#define CONFIG_APPNAME "Coreboot"
> +#define CONFIG_CPUNAME8 "CRBTCPU "
> +#define CONFIG_APPNAME6 "COREBT"
> +#define CONFIG_APPNAME4 "CRBT"
This adds new names - which is a topic in itself. Lets have the
first kconfig patch just add in the basic capabilities, and then we
can add new features on top of it. I suggest leaving the names hard
coded in config.h for now - setting them via kconfig can be a follow
up patch.
Thanks for working on this.
-Kevin
[View Less]
Kevin,
I put in the code the following addition, its not a clean way of doing I
think, but it works :-)
Below the boot log (partially) that shows that piece of code. Maybe you
can figure out
how to do it the clean way.
Marc
diff --git a/src/boot.c b/src/boot.c
index 05fb3dd..b57c8c0 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -97,13 +97,17 @@ find_prio(const char *glob)
static char *
build_pci_path(char *buf, int max, const char *devname, int bdf)
{
+static int last_bdf = 0;
// …
[View More]Build the string path of a bdf - for example: /pci@i0cf8/isa@1,2
char *p = buf;
int parent = pci_bdf_to_bus(bdf);
+ dprintf(1, "buf=%p max=%d name=%s bdf=%d parent=%d PCIpaths=%p\n"
+ , buf, max, devname, bdf, parent, PCIpaths);
if (PCIpaths)
parent = PCIpaths[parent];
int parentdev = parent & 0xffff;
- if (parent & PP_PCIBRIDGE) {
+ if (parent & PP_PCIBRIDGE && last_bdf != bdf ) {
+ last_bdf = bdf;
p = build_pci_path(p, max, "pci-bridge", parentdev);
} else {
if (parentdev)
Searching CBFS for prefix floppyimg/
Found CBFS file fallback/romstage
Found CBFS file fallback/coreboot_ram
Found CBFS file fallback/payload
Found CBFS file
handle_08
|1ffd4000| pmm_free 0x1ffd3000 (detail=0x1ffd5760)
\1ffd3000/ End thread
|1ffd4000| pmm_free 0x1ffefee0 (detail=0x1ffd5820)
|1ffd4000| pmm_free 0x1ffee000 (detail=0x1ffd57f0)
|1ffd4000| pmm_free 0x1ffefed0 (detail=0x1ffd57c0)
|1ffd4000| pmm_free 0x1ffefec0 (detail=0x1ffd5790)
|1ffd4000| pmm_free 0x1ffd5880 (detail=0x1ffd58a0)
|1ffd2000| pmm_free 0x1ffd4000 (detail=0x1ffd5850)
\1ffd4000/ End thread
|1ffd2000| ata_reset exit status=50
handle_08
|1ffd2000| send_cmd : read error (status=51 err=04)
|1ffd2000| pmm_malloc zone=0x000f5284 handle=ffffffff size=40 align=10
ret=0x000fd5e0 (detail=0x1ffd58a0)
|1ffd2000| pmm_malloc zone=0x000f528c handle=ffffffff size=80 align=10
ret=0x1ffd5820 (detail=0x1ffd5870)
|1ffd2000| ata1-0: WDC WD800JB-22JJC0 ATA-6 Hard-Disk (74 GiBytes)
|1ffd2000| buf=0x1ffd2c5c max=256 name=* bdf=57 parent=0
PCIpaths=0x1ffd5900
|1ffd2000| buf=0x1ffd2c5c max=256 name=pci-bridge bdf=121 parent=0
PCIpaths=0x1ffd5900
|1ffd2000| buf=0x1ffd2c5c max=256 name=pci-bridge bdf=121 parent=0
PCIpaths=0x1ffd5900
|1ffd2000| Searching bootorder
for: /pci-root@79/pci@i0cf8/pci-bridge@f,1/pci-bridge@f,1/*@7,1/drive@1/disk@0
|1ffd2000| pmm_malloc zone=0x000f528c handle=ffffffff size=20 align=10
ret=0x1ffd57d0 (detail=0x1ffd57f0)
|1ffd2000| Registering bootable: ata1-0: WDC WD800JB-22JJC0 ATA-6
Hard-Disk (74 GiBytes) (type:2 prio:103 data:fd5e0)
|1ffd2000| ata_detect resetresult=600d
|1ffd2000| powerup iobase=170 st=50
|1ffd2000| powerup iobase=170 st=0
|1ffd2000| ata_detect ata1-1: sc=55 sn=aa dh=b0
|1ffd2000| send_cmd : DRQ not set (status 00)
pmm_free 0x1ffd2000 (detail=0x1ffd56d0)
\1ffd2000/ End thread
All threads complete.
-------- Forwarded Message --------
From: Marc Bertens <mbertens(a)xs4all.nl>
To: Kevin O'Connor <kevin(a)koconnor.net>
Cc: seabios(a)seabios.org
Subject: Re: [SeaBIOS] Question about linker building seabios
Date: Wed, 19 Jan 2011 20:17:34 +0100
Kevin,
I put in that extra debug line in you put on pastebin, and it seems that
it deadloops there, see my boot log http://pastebin.com/B3fXSXAZ
Marc
On Mon, 2011-01-17 at 15:09 -0500, Kevin O'Connor wrote:
> On Mon, Jan 17, 2011 at 08:58:41PM +0100, Marc Bertens wrote:
> > It stops at 1989
> >
>
> Does the following fix it for you?
>
> --- a/src/pci.c
> +++ b/src/pci.c
> @@ -194,7 +194,7 @@ pci_path_setup(void)
> PCIpaths = malloc_tmp(sizeof(*PCIpaths) * 256);
> if (!PCIpaths)
> return;
> - memset(PCIpaths, 0, sizeof(PCIpaths));
> + memset(PCIpaths, 0, sizeof(*PCIpaths) * 256);
>
> int roots = 0;
> int bdf, max;
>
>
> > Marc
> >
> > On Mon, 2011-01-17 at 14:47 -0500, Kevin O'Connor wrote:
> >
> > > On Mon, Jan 17, 2011 at 07:35:25PM +0100, Marc Bertens wrote:
> > > > Hmmm, not completely true i'm afraid. When booting a cold systen it will
> > > > not come up.
> > > > When i switch to my fallback rom it boots, now i switch back to the
> > > > image that was not
> > > > booting and now it boots just fine.
> > > >
> > > > So i was a little premature with my earlier mail.
> > > >
> > > > I added the boot log in pastebin http://pastebin.com/g83qwpnj
> > >
> > > That log shows SeaBIOS succesfully booting. Do you have a log where
> > > seabios fails?
> > >
> > > -Kevin
> >
> >
_______________________________________________
SeaBIOS mailing list
SeaBIOS(a)seabios.org
http://www.seabios.org/mailman/listinfo/seabios
[View Less]
On Mon, Jan 17, 2011 at 08:58:41PM +0100, Marc Bertens wrote:
> It stops at 1989
>
Does the following fix it for you?
--- a/src/pci.c
+++ b/src/pci.c
@@ -194,7 +194,7 @@ pci_path_setup(void)
PCIpaths = malloc_tmp(sizeof(*PCIpaths) * 256);
if (!PCIpaths)
return;
- memset(PCIpaths, 0, sizeof(PCIpaths));
+ memset(PCIpaths, 0, sizeof(*PCIpaths) * 256);
int roots = 0;
int bdf, max;
> Marc
>
> On Mon, 2011-01-17 at 14:47 -0500, Kevin O'Connor …
[View More]wrote:
>
> > On Mon, Jan 17, 2011 at 07:35:25PM +0100, Marc Bertens wrote:
> > > Hmmm, not completely true i'm afraid. When booting a cold systen it will
> > > not come up.
> > > When i switch to my fallback rom it boots, now i switch back to the
> > > image that was not
> > > booting and now it boots just fine.
> > >
> > > So i was a little premature with my earlier mail.
> > >
> > > I added the boot log in pastebin http://pastebin.com/g83qwpnj
> >
> > That log shows SeaBIOS succesfully booting. Do you have a log where
> > seabios fails?
> >
> > -Kevin
>
>
[View Less]
On Sun, Jan 16, 2011 at 09:38:37PM +0100, Marc Bertens wrote:
> Kevin,
>
> Finally here is the patch for Kconfig build system for SeaBIOS, the
> patch exists out of two files;
> 1. kconfig-for-seabios-patch.1.diff this is the part where the new
> files are added.
> 2. kconfig-for-seabios-patch.2.diff this is the part with the
> changes to the existing files.
Thanks Marc.
Your patch was too large for the mailing list. Can you put future
versions online …
[View More]somewhere or send compressed?
> I hope that you agree with the changes :-) and that the kconfig will
> here to stay....
>
> I loaned the kconfig build system from the coreboot project, maybe there
> are some references there what i missed.
[...]
> +++ b/src/configh.h
> @@ -0,0 +1,248 @@
> +/*
> + * This file is part of the seabios project.
> + *
> + * Copyright (C) 2011 Marc Bertens <mbertens(a)xs4all.nl>
> + * Copyright (C) 2008-2010 Kevin O'Connor <kevin(a)koconnor.net>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; version 2 of the License.
[...]
I really don't like these big copyright banners. I don't see much
point in copyrighting a header file. SeaBIOS is LGPLv3, and all core
files must use that copyright.
This doesn't apply to non-core files copied from other projects, so
doesn't need to be true for tools/kconfig.
Also, your first patch modifies seabios, but I thought you were going
to do that in patch2? I don't see a reason to have old way and new
way in parallel - lets just go right to the kconfig way. The way
you've introduced configh.h, configu.h, and configk.h in addition to
the existing config.h is confusing.
[...]
> --- a/tools/kconfig/Makefile
> +++ b/tools/kconfig/Makefile
> @@ -225,7 +225,7 @@ endif
> $(objk)/gconf.o: $(objk)/.tmp_gtkcheck
>
> ifeq ($(gconf-target),1)
> --include $(objk)/.tmp_gtkcheck
> +include $(objk)/.tmp_gtkcheck
>
> # GTK needs some extra effort, too...
> $(objk)/.tmp_gtkcheck:
> @@ -250,23 +250,23 @@ endif
>
> # --- UNUSED, ignore ----------------------------------------------------------
> ifdef UNUSED
> -$(obj)/zconf.tab.o: $(obj)/lex.zconf.c $(obj)/zconf.hash.c
> +$(obj)/zconf.tab.o: $(srck)/lex.zconf.c $(srck)/zconf.hash.c
Can you explain what this does?
-Kevin
[View Less]
On Sun, Jan 16, 2011 at 09:38:37PM +0100, Marc Bertens wrote:
> I have some problems today testing the patch, i checked out the lastest
> from git, and found out
> that the system was not booting any more. I followed the bisect
> procedure of git and it told me
> that the commit below is the problem. I tested the kconfig with the
> version before this one, and it
> worked fine.
>
> commit d08eb9c968e519a0b1ba63702acb2115ad536318
> Author: Kevin O'Connor <…
[View More]kevin(a)koconnor.net>
> Date: Mon Jan 10 00:48:45 2011 -0500
>
> Add ability to track PCI paths and add to build_pci_path().
>
> Improve device path descriptions of devices on PCI buses.
That's odd. Can you provide the output of seabios (prior to your
patches) with the debug level set to 8?
-Kevin
[View Less]
Hi.
First of all sorry for my bad English. I want to add some code to
seabios. I've add new .c file with one function. I want this code to
be run from Windows running on qemu-kvm.
This function have VISIBLE32FLAT and __attribute((used)) and noinline
prefix. I've add my .c file to FLAT32SRC list. But after compiling
this code is excluded from bios.bin (linker thinks that it will never
used and dismiss it). If I call this function in test mode in _start()
function, then after compilation this …
[View More]code is present in bios.bin. Is
there any way to add independent code to bios.bin without calling
functions in test mode?How to tell linker not to exclude this code?
The second question is how to find the location of this function in
bios.bin. As I understand it does not have the export table, how to
find the beginning of my function?
Thanks in advance.
[View Less]