* [PATCH 0/2] x86 minor fixes and questions @ 2013-11-08 18:30 Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 1/2] scripts/setupmbr: fix documentation Thomas Petazzoni ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: Thomas Petazzoni @ 2013-11-08 18:30 UTC (permalink / raw) To: barebox Hello, Here are two minor fixes for the x86 support. The first patch avoids linking problems on recent gcc versions, and the second one fixes the documentation. Also, I've tested the x86 support under Qemu, it starts fine. Thanks to the bios disk driver, it detects one hard disk drive. However, since the driver doesn't set num_blocks, the disk size is zero, and no partition can be detected. Is this bios disk driver supposed to work to read the entire hard drive, access a filesystem and load the kernel image, or is the x86 support generally too limited for this at the moment? Thanks, Thomas Thomas Petazzoni (2): scripts/setupmbr: fix documentation arch/x86: fix link with recent gcc arch/x86/Makefile | 3 ++- scripts/setupmbr/setupmbr.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) -- 1.8.1.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] scripts/setupmbr: fix documentation 2013-11-08 18:30 [PATCH 0/2] x86 minor fixes and questions Thomas Petazzoni @ 2013-11-08 18:30 ` Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 2/2] arch/x86: fix link with recent gcc Thomas Petazzoni 2013-11-11 7:57 ` [PATCH 0/2] x86 minor fixes and questions Sascha Hauer 2 siblings, 0 replies; 5+ messages in thread From: Thomas Petazzoni @ 2013-11-08 18:30 UTC (permalink / raw) To: barebox The documentation says setupmbr should be used with the image named 'barebox', but it should instead be done with the 'barebox.bin' image. Attempting to use setupmbr on the ELF barebox image simply fails: $ ./scripts/setupmbr/setupmbr -s 32 -m ./barebox -d disk.img No MBR signature found barebox image seems not valid: Bad MBR signature Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- scripts/setupmbr/setupmbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c index 918fbe3..0060c2e 100644 --- a/scripts/setupmbr/setupmbr.c +++ b/scripts/setupmbr/setupmbr.c @@ -666,10 +666,10 @@ and populating the root filesystem for example) to make it useful. In the next step, @a barebox gets installed to this boot media: @verbatim -[jb@host]~> scripts/setupmbr/setupmbr -s 32 -m ./barebox -d /dev/sda +[jb@host]~> scripts/setupmbr/setupmbr -s 32 -m ./barebox.bin -d /dev/sda @endverbatim -This command writes the @a barebox image file './barebox' onto the device +This command writes the @a barebox image file './barebox.bin' onto the device @p /dev/sda. The @p -s option will keep the persistant storage sectors free and untouched -- 1.8.1.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] arch/x86: fix link with recent gcc 2013-11-08 18:30 [PATCH 0/2] x86 minor fixes and questions Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 1/2] scripts/setupmbr: fix documentation Thomas Petazzoni @ 2013-11-08 18:30 ` Thomas Petazzoni 2013-11-11 7:57 ` [PATCH 0/2] x86 minor fixes and questions Sascha Hauer 2 siblings, 0 replies; 5+ messages in thread From: Thomas Petazzoni @ 2013-11-08 18:30 UTC (permalink / raw) To: barebox Due to unwind tables being generated by recent versions of gcc by default, the x86 Barebox link fails with: ld: section .eh_frame loaded at [00000000000197c4,000000000001f31f] overlaps section .barebox_initcalls loaded at [00000000000197c4,0000000000019833] Passing -fno-unwind-tables -fno-asynchronous-unwind-tables avoids this problem. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> --- arch/x86/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 518b37f..a78fa22 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -5,7 +5,8 @@ machine-y := i386 TEXT_BASE = $(CONFIG_TEXT_BASE) -CPPFLAGS += -march=i386 -m32 -DTEXT_BASE=$(TEXT_BASE) +CPPFLAGS += -march=i386 -m32 -DTEXT_BASE=$(TEXT_BASE) \ + -fno-unwind-tables -fno-asynchronous-unwind-tables LDFLAGS += -m elf_i386 ifndef CONFIG_MODULES -- 1.8.1.2 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] x86 minor fixes and questions 2013-11-08 18:30 [PATCH 0/2] x86 minor fixes and questions Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 1/2] scripts/setupmbr: fix documentation Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 2/2] arch/x86: fix link with recent gcc Thomas Petazzoni @ 2013-11-11 7:57 ` Sascha Hauer 2013-11-11 9:50 ` Thomas Petazzoni 2 siblings, 1 reply; 5+ messages in thread From: Sascha Hauer @ 2013-11-11 7:57 UTC (permalink / raw) To: Thomas Petazzoni; +Cc: barebox Hi Thomas, On Fri, Nov 08, 2013 at 07:30:37PM +0100, Thomas Petazzoni wrote: > Hello, > > Here are two minor fixes for the x86 support. The first patch avoids > linking problems on recent gcc versions, and the second one fixes the > documentation. > > Also, I've tested the x86 support under Qemu, it starts fine. Thanks > to the bios disk driver, it detects one hard disk drive. However, > since the driver doesn't set num_blocks, the disk size is zero, and no > partition can be detected. Is this bios disk driver supposed to work > to read the entire hard drive, access a filesystem and load the kernel > image, or is the x86 support generally too limited for this at the > moment? Does your disk contain a valid partition table? There's no way to properly detect the disk size, so barebox guesses the size based on the last partition on the disk. This fails of course on an unpartitioned device. See disk_guess_size(). But indeed, the x86 support is quite limited. > Thomas Petazzoni (2): > scripts/setupmbr: fix documentation > arch/x86: fix link with recent gcc Applied, thanks Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 0/2] x86 minor fixes and questions 2013-11-11 7:57 ` [PATCH 0/2] x86 minor fixes and questions Sascha Hauer @ 2013-11-11 9:50 ` Thomas Petazzoni 0 siblings, 0 replies; 5+ messages in thread From: Thomas Petazzoni @ 2013-11-11 9:50 UTC (permalink / raw) To: Sascha Hauer; +Cc: barebox Dear Sascha Hauer, On Mon, 11 Nov 2013 08:57:38 +0100, Sascha Hauer wrote: > > Also, I've tested the x86 support under Qemu, it starts fine. Thanks > > to the bios disk driver, it detects one hard disk drive. However, > > since the driver doesn't set num_blocks, the disk size is zero, and no > > partition can be detected. Is this bios disk driver supposed to work > > to read the entire hard drive, access a filesystem and load the kernel > > image, or is the x86 support generally too limited for this at the > > moment? > > Does your disk contain a valid partition table? There's no way to > properly detect the disk size, so barebox guesses the size based on the > last partition on the disk. This fails of course on an unpartitioned > device. See disk_guess_size(). Yes, my disk had a partition table. However, I see that disk_guess_size() is only called if you have a DOS partition table, and not a GPT type of partition table, and I don't remember which type I've used during my testing. I'll test again, and with the info that disk_guess_size() is the important part, I'll have a closer look. > But indeed, the x86 support is quite limited. Yeah, no problem. I'm not really planning on making any real use of it, was just curious to see whether it worked, and if yes, how :-) > > Thomas Petazzoni (2): > > scripts/setupmbr: fix documentation > > arch/x86: fix link with recent gcc > > Applied, thanks Thanks! Thomas -- Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-11-11 9:51 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2013-11-08 18:30 [PATCH 0/2] x86 minor fixes and questions Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 1/2] scripts/setupmbr: fix documentation Thomas Petazzoni 2013-11-08 18:30 ` [PATCH 2/2] arch/x86: fix link with recent gcc Thomas Petazzoni 2013-11-11 7:57 ` [PATCH 0/2] x86 minor fixes and questions Sascha Hauer 2013-11-11 9:50 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox