Re: [coreboot] Linux kernel as payload?

2016-01-24 Thread John Lewis
I'm curious as to how you managed to brick the thing when reading - did you 
apply the wrong voltage to the chip, or something?

On 23 Jan 2016 4:19 p.m., Kitestramuort  wrote:
>
> On Sat, 23 Jan, 2016 at 3:27 PM, John Lewis  wrote: 
> > Thank Ron! 
> > 
> > If anyone's interested, you can find the Buildroot/kernel configs and 
> > Jeltka script @ 
> > 
> > https://johnlewis.ie/buildroot-2014.08-config 
> > https://johnlewis.ie/linux-3.16.6-config 
> > https://johnlewis.ie/jeltka.sh 
> > 
> > It's out of date and could use some other improvements, but I'm sure 
> > it 
> > would save someone a lot of time getting a kernel payload working in 
> > under 3.5 megs size. 
>
>
> These would be of great help if I hadn't just bricked the laptop trying 
> to read the bios with flashrom + raspberry pi :-/ 
>
>
> -- 
> coreboot mailing list: coreboot@coreboot.org 
> http://www.coreboot.org/mailman/listinfo/coreboot 
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-24 Thread Kitestramuort
On Sun, 24 Jan, 2016 at 12:41 PM, John Lewis  
wrote:
I'm curious as to how you managed to brick the thing when reading - 
did you apply the wrong voltage to the chip, or something?


I think so. I had the charger and the 3.3V pin connected at the same 
time.
However it's not completely bricked. The battery gets charged, but it 
won't boot, the screen doesn't come up, all I get is the power button 
lighting up a couple of times.
Fortunately this is not my laptop but an older x220 that I was using as 
test machine



--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-23 Thread Kitestramuort

On Sat, 23 Jan, 2016 at 3:27 PM, John Lewis  wrote:

Thank Ron!

If anyone's interested, you can find the Buildroot/kernel configs and
Jeltka script @

https://johnlewis.ie/buildroot-2014.08-config
https://johnlewis.ie/linux-3.16.6-config
https://johnlewis.ie/jeltka.sh

It's out of date and could use some other improvements, but I'm sure 
it

would save someone a lot of time getting a kernel payload working in
under 3.5 megs size.



These would be of great help if I hadn't just bricked the laptop trying 
to read the bios with flashrom + raspberry pi :-/



--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-23 Thread John Lewis

Thank Ron!

If anyone's interested, you can find the Buildroot/kernel configs and 
Jeltka script @


https://johnlewis.ie/buildroot-2014.08-config
https://johnlewis.ie/linux-3.16.6-config
https://johnlewis.ie/jeltka.sh

It's out of date and could use some other improvements, but I'm sure it 
would save someone a lot of time getting a kernel payload working in 
under 3.5 megs size.


John.

On 2016-01-21 18:39, ron minnich wrote:

I think JELTKA is a model of how it can be done. Consider talking to
John Lewis.

Ron, Satisfied JELTKA user.

On Thu, Jan 21, 2016 at 9:58 AM Patrick Georgi via coreboot
 wrote:


2016-01-21 18:49 GMT+01:00 Kitestramuort
:

Can I compile it 64bit?

As long as you keep the 32bit entry point around, yes (which I
think
is the default configuration for x86_64 kernels).
In kconfig/menuconfig/..., select a linux payload, and point to the
bzImage file. That should work (and this part of coreboot is pretty
well testable with our QEmu targets, in case you want to try it out
first).


Is there any further documentation on this?

Sadly documentation is not a strength in this project.


I found something on the wiki
https://www.coreboot.org/Board:tyan/s2891#LAB_payload [1]

The kexec information there is probably still useful, the buildrom
stuff is horribly outdated.

Patrick
--
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der
Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot [2]



Links:
--
[1] https://www.coreboot.org/Board:tyan/s2891#LAB_payload
[2] http://www.coreboot.org/mailman/listinfo/coreboot


--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread Aaron Durbin via coreboot
On Sun, Jan 17, 2016 at 9:23 AM, Kitestramuort
 wrote:
> Hello,
> I am preparing to flash coreboot on a Thinkpad X230. Currently I use UEFI
> and systemd to boot Linux as the only operating system and I wish to change
> my configuration as little as possible. The most natural option for me would
> be to use TianoCore as payload, however Tiano seems to be still unstable and
> is not particularly well documented.
>
> As an alternative I was considering using the kernel itself as payload. But
> what happens when I need to update the kernel? Will I need to hardware
> reflash coreboot with the new kernel? I wouldn't mind recompiling coreboot
> with a different kernel and software flashing, but I'd like to avoid having
> to dismantle the laptop every time I update the kernel. Can anybody clarify
> this for me please?

You can always kexec() into your new kernel. The one sitting in flash
can be smart enough to interrogate your boot media and determine what
to load. Then just kexec().

>
> best regards
>
>
> --
> coreboot mailing list: coreboot@coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread Kitestramuort
On Thu, 21 Jan, 2016 at 4:08 PM, Aaron Durbin via coreboot 
 wrote:



You can always kexec() into your new kernel. The one sitting in flash
can be smart enough to interrogate your boot media and determine what
to load. Then just kexec().



This is very interesting. So basically I should build a minimal kernel 
with kexec support to launch the "normal" kernel living in /boot. But 
what exactly needs to be compiled in the payload kernel? I guess some 
hardware has to be initialised at this stage... Can I compile it 64bit? 
Is there any further documentation on this?


I found something on the wiki  
https://www.coreboot.org/Board:tyan/s2891#LAB_payload



Thanks


--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread Aaron Durbin via coreboot
On Thu, Jan 21, 2016 at 11:49 AM, Kitestramuort
 wrote:
> On Thu, 21 Jan, 2016 at 4:08 PM, Aaron Durbin via coreboot
>  wrote:
>>
>>
>>
>> You can always kexec() into your new kernel. The one sitting in flash
>> can be smart enough to interrogate your boot media and determine what
>> to load. Then just kexec().
>>
>
> This is very interesting. So basically I should build a minimal kernel with
> kexec support to launch the "normal" kernel living in /boot. But what
> exactly needs to be compiled in the payload kernel? I guess some hardware
> has to be initialised at this stage... Can I compile it 64bit? Is there any
> further documentation on this?

You'd need an initramfs along w/ your storage drivers for finding the
boot device. You'd want to make your userspace smart enough such that
you could potentially recover if you ever landed a bad kernel. In
short, you'd need to duplicate what lilo or grub do depending how you
want to convey all that boot information (and allow a chance at
recovery).

>
> I found something on the wiki
> https://www.coreboot.org/Board:tyan/s2891#LAB_payload
>
>
> Thanks
>
>
>
> --
> coreboot mailing list: coreboot@coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread ron minnich
I think JELTKA is a model of how it can be done. Consider talking to John
Lewis.

Ron, Satisfied JELTKA user.

On Thu, Jan 21, 2016 at 9:58 AM Patrick Georgi via coreboot <
coreboot@coreboot.org> wrote:

> 2016-01-21 18:49 GMT+01:00 Kitestramuort :
> > Can I compile it 64bit?
> As long as you keep the 32bit entry point around, yes (which I think
> is the default configuration for x86_64 kernels).
> In kconfig/menuconfig/..., select a linux payload, and point to the
> bzImage file. That should work (and this part of coreboot is pretty
> well testable with our QEmu targets, in case you want to try it out
> first).
>
> > Is there any further documentation on this?
> Sadly documentation is not a strength in this project.
>
> > I found something on the wiki
> > https://www.coreboot.org/Board:tyan/s2891#LAB_payload
> The kexec information there is probably still useful, the buildrom
> stuff is horribly outdated.
>
>
> Patrick
> --
> Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
> Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft:
> Hamburg
> Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
>
> --
> coreboot mailing list: coreboot@coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread Patrick Georgi via coreboot
2016-01-21 18:49 GMT+01:00 Kitestramuort :
> Can I compile it 64bit?
As long as you keep the 32bit entry point around, yes (which I think
is the default configuration for x86_64 kernels).
In kconfig/menuconfig/..., select a linux payload, and point to the
bzImage file. That should work (and this part of coreboot is pretty
well testable with our QEmu targets, in case you want to try it out
first).

> Is there any further documentation on this?
Sadly documentation is not a strength in this project.

> I found something on the wiki
> https://www.coreboot.org/Board:tyan/s2891#LAB_payload
The kexec information there is probably still useful, the buildrom
stuff is horribly outdated.


Patrick
-- 
Google Germany GmbH, ABC-Str. 19, 20354 Hamburg
Registergericht und -nummer: Hamburg, HRB 86891, Sitz der Gesellschaft: Hamburg
Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux kernel as payload?

2016-01-21 Thread Timothy Pearson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 01/21/2016 11:49 AM, Kitestramuort wrote:
> On Thu, 21 Jan, 2016 at 4:08 PM, Aaron Durbin via coreboot
>  wrote:
>>
>>
>> You can always kexec() into your new kernel. The one sitting in flash
>> can be smart enough to interrogate your boot media and determine what
>> to load. Then just kexec().
>>
> 
> This is very interesting. So basically I should build a minimal kernel
> with kexec support to launch the "normal" kernel living in /boot. But
> what exactly needs to be compiled in the payload kernel? I guess some
> hardware has to be initialised at this stage... Can I compile it 64bit?
> Is there any further documentation on this?
> 
> I found something on the wiki 
> https://www.coreboot.org/Board:tyan/s2891#LAB_payload
> 
> 
> Thanks

If you're going to go the route of a bootstrap kernel, what about baking
petitboot into the ROM?

https://www.kernel.org/pub/linux/kernel/people/geoff/petitboot/petitboot.html

If your system is 64-bit capable, you can use a 64-bit kernel, no problem.

- -- 
Timothy Pearson
Raptor Engineering
+1 (415) 727-8645 (direct line)
+1 (512) 690-0200 (switchboard)
http://www.raptorengineeringinc.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJWoRuiAAoJEK+E3vEXDOFbti4IAJw9mltD1d2FRzACzx8jWWVc
H8LJShBzd+E4Vs+nWQ9yZaD0Oy3wj25xQ1uMgBG0exW1w2dEMUc9XQzJyZIxkmwt
lMeN4tgFC2w8jNrXUr7gv7B+MSQlycGohfdA6LCjAgkCXq/EcL32jM515Gin+pJQ
XHdualopCUbDah8lsH/pRrZuasF07i+RVAEyCoUAhB3SDoWqRHrrfoYceP8g9wJc
iF5Z0bMeyaBSVlLWcCJmIIXKjg8mfFGnpEc9qX7eVqRmhloqXiKFj2mRjn/zcKPR
mqxEJptcKR1p3qDDoZrdtPuV6iq6I8VqgE9AcR08cfR6ihPt0ujFjtybtgqclRA=
=jTmV
-END PGP SIGNATURE-

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


[coreboot] Linux kernel as payload?

2016-01-20 Thread Kitestramuort

Hello,
I am preparing to flash coreboot on a Thinkpad X230. Currently I use 
UEFI and systemd to boot Linux as the only operating system and I wish 
to change my configuration as little as possible. The most natural 
option for me would be to use TianoCore as payload, however Tiano seems 
to be still unstable and is not particularly well documented.


As an alternative I was considering using the kernel itself as payload. 
But what happens when I need to update the kernel? Will I need to 
hardware reflash coreboot with the new kernel? I wouldn't mind 
recompiling coreboot with a different kernel and software flashing, but 
I'd like to avoid having to dismantle the laptop every time I update 
the kernel. Can anybody clarify this for me please?


best regards


--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux-kernel as payload

2014-09-09 Thread Werner Zeh


Hi Ron.
 
Thank you for the command line suggestion.
My kernel was booting in qemu but I was not able to see output due to the 
missing command line.
Especially the eralyprintk-thing helped me!
Now every thing seems to work just fine. There is no need to use mkelfImage.
Great, I love it!

Thanks guys
Werner
 

Gesendet: Montag, 08. September 2014 um 17:54 Uhr
Von: ron minnich rminn...@gmail.com
An: John Lewis jle...@johnlewis.ie
Cc: coreboot coreboot@coreboot.org
Betreff: Re: [coreboot] Linux-kernel as payload
As of last week, I am booting a bzimage+initramfs combination just
fine. bzimage will be fine.

It's a good idea to set the command line args, and I recomment, for testing
console=ttyS0,115200 earlyprintk=ttyS0,115200,keep

Your best bet is to do the standard trivial initramfs with a simple program:
main(){printf(hi\n); while (1);}

Let's pretend it's called mymain.c
cc -o mymain -static mymain.c

put that in your prototype root file system with the name init. make
sure you create /dev/console. Then bundle it all up with cpio and
you've got an initramfs


I can start some notes on the wiki if you're still stuck.

ron

--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

[coreboot] Linux-kernel as payload

2014-09-08 Thread Werner Zeh
Hi.



I try to use the linux kernel as payload in coreboot. I use a bzImage of the kernel.

When I compile, I get the following message:




OBJCOPY cpu/x86/smm/smm_wrap.ramstage.o
 CC generated/ramstage.o
 CC cbfs/fallback/ramstage.debug
 OBJCOPY cbfs/fallback/ramstage.elf
 CBFS coreboot.rom
 PAYLOAD ../bzImage (compression: none)
E: The stage file is not in ELF format!
 CONFIG .config
 CBFSPRINT coreboot.rom

coreboot.rom: 4096 kB, bootblocksize 848, romsize 4194304, offset 0x0
alignment: 64 bytes

Name Offset Type Size
fallback/romstage 0x0 stage 20906
fallback/ramstage 0x5200 stage 62994
fallback/payload 0x14880 payload 1392465
config 0x168840 raw 3366
(empty) 0x1695c0 null 2713240



Am I wrong assumimg that the image may be a real (compressed) bzImage?

Should I use a vmlinuz better? Or is my bzImage is not suitable (maybe parts of it are compressed or so)?



Thanks.


-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread John Lewis

Hi,

You have to use mkelfImage to convert the bzImage to elf format. It's in 
the utils folder of coreboot.


John.

On 08/09/14 09:25, Werner Zeh wrote:

Hi.
I try to use the linux kernel as payload in coreboot. I use a bzImage of
the kernel.
When I compile, I get the following message:
OBJCOPYcpu/x86/smm/smm_wrap.ramstage.o
 CC generated/ramstage.o
 CC cbfs/fallback/ramstage.debug
 OBJCOPYcbfs/fallback/ramstage.elf
 CBFS   coreboot.rom
 PAYLOAD../bzImage (compression: none)
E: The stage file is not in ELF format!
 CONFIG .config
 CBFSPRINT  coreboot.rom
coreboot.rom: 4096 kB, bootblocksize 848, romsize 4194304, offset 0x0
alignment: 64 bytes
Name   Offset Type Size
fallback/romstage  0x0stage20906
fallback/ramstage  0x5200 stage62994
fallback/payload   0x14880payload  1392465
config 0x168840   raw  3366
(empty)0x1695c0   null 2713240
Am I wrong assumimg that the image may be a real (compressed) bzImage?
Should I use a vmlinuz better? Or is my bzImage is not suitable (maybe
parts of it are compressed or so)?
Thanks.




--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread Patrick Georgi
Am 08.09.2014 um 12:09 schrieb John Lewis:
 You have to use mkelfImage to convert the bzImage to elf format. It's in
 the utils folder of coreboot.
No, you don't.


Patrick



signature.asc
Description: OpenPGP digital signature
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread Patrick Georgi
Am 08.09.2014 um 10:25 schrieb Werner Zeh:
 PAYLOAD../bzImage (compression: none)
 E: The stage file is not in ELF format!
Well, that's certainly true, isn't it? :-)

(technical details: we have three payload parsers - ELF, bzImage and
special-Tianocore, of which the ELF parser is the first. If it fails, it
whines a bit on the console, then the others get a chance).


 Am I wrong assumimg that the image may be a real (compressed) bzImage?
 Should I use a vmlinuz better? Or is my bzImage is not suitable (maybe
 parts of it are compressed or so)?
Using a bzImage is the most recently tested approach to making a payload
out of a linux kernel, so this is the way to go.


Patrick



signature.asc
Description: OpenPGP digital signature
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread John Lewis



On 08/09/14 12:37, Patrick Georgi wrote:

Am 08.09.2014 um 12:09 schrieb John Lewis:

You have to use mkelfImage to convert the bzImage to elf format. It's in
the utils folder of coreboot.

No, you don't.


I meant You can use, okay?

John.

--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread John Lewis

On 08/09/14 12:40, John Lewis wrote:



On 08/09/14 12:37, Patrick Georgi wrote:

Am 08.09.2014 um 12:09 schrieb John Lewis:

You have to use mkelfImage to convert the bzImage to elf format. It's in
the utils folder of coreboot.

No, you don't.


I meant You can use, okay?

John.

And I was also thinking using it from within SeaBIOS, and didn't make 
the distinction.


--
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread ron minnich
As of last week, I am booting a bzimage+initramfs combination just
fine. bzimage will be fine.

It's a good idea to set the command line args, and I recomment, for testing
console=ttyS0,115200 earlyprintk=ttyS0,115200,keep

Your best bet is to do the standard trivial initramfs with a simple program:
main(){printf(hi\n); while (1);}

Let's pretend it's called mymain.c
cc -o mymain -static mymain.c

put that in your prototype root file system with the name init. make
sure you create /dev/console. Then bundle it all up with cpio and
you've got an initramfs


I can start some notes on the wiki if you're still stuck.

ron

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot


Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread Patrick Georgi
Am 08.09.2014 um 13:44 schrieb John Lewis:
 No, you don't.
 I meant You can use, okay?
Sorry, my reply came across harsher than I intended..

 And I was also thinking using it from within SeaBIOS, and didn't make
 the distinction.
Ah, okay. Please note that 3c12cb03847d2db41809ae434530782a7dbef48b
fixes the issues that prevented the native linux payload feature from
working with SeaBIOS.

Maybe we should retire mkelfImage. I'm actually amazed that it still works!


Patrick



signature.asc
Description: OpenPGP digital signature
-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

Re: [coreboot] Linux-kernel as payload

2014-09-08 Thread ron minnich
I think it's time to retire mkelfImage and I can submit that patch now
if we agree.

ron

-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot