rpt
Posts: 51
Joined: Tue Jan 31, 2012 3:09 pm

Re: Making a unique OS

Fri Feb 03, 2012 10:54 am

summers said:


Am confused - how does the arm know how to find the kernel on the SD? It must have a bootloader somewhere. I'd be very surprised if the arm on power up has configured the hardware in a way that it can just execute instructions from the SD?


It doesn't. The GPU (which is a separate processor) copies it from the SD card to the RAM before the ARM runs.


I guess you are saying that there is a ROM somewhere (which we can't modify), and that it will boot kernels from the SD? If so whats the spec on what the ROM code expects?


The GPU must have a ROM (internal to the SoC) for its initial code. Having looked in the wiki it appears to first load GPU firmware from the card and then the kernel for the ARM.

So in the FAT32 partition you store the GPU firmware (just a binary blob that you cannot alter) and the Linux kernel.

summers
Posts: 63
Joined: Mon Jan 30, 2012 4:27 pm

Re: Making a unique OS

Fri Feb 03, 2012 11:17 am

This seems the best info on how the beast comes to life (e.g. boots). Sounds like the videcore startup is not public, or as far as i can see well supported in the open development arena. So yes, all you can do is have the fat partition, with the GPU blob on it, and a kernel image, that I guess needs the right name and format. Doesn't sound to me like this should slow Hiro down - as this boot process is just totally prescriptive, so just grab the relevant bits from a working pi distribution. Guess a bit of a hassle, is the default way of calling the kernel, won't pass kernel options - e.g. you'll need to make sure your kernel boots without any options passed.

rpt
Posts: 51
Joined: Tue Jan 31, 2012 3:09 pm

Re: Making a unique OS

Fri Feb 03, 2012 11:27 am

summers said:


Guess a bit of a hassle, is the default way of calling the kernel, won't pass kernel options - e.g. you'll need to make sure your kernel boots without any options passed.


Since this is all about making a unique OS for the Pi then compiling the required boot line into the kernel shouldn't be a problem. The Pi is more like an embedded system than a PC in this respect.

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: Making a unique OS

Sun Feb 05, 2012 6:50 pm

I tried the cross compiler (ELDK), managed to get it installed and started the process but i have to say it does get rather complicated very quickly and i'm currently stuck with it. When i get a bit more time i will search for a solution as it looks interesting but am in no rush as i think i will need to know more about the Pi before i can really build anything meaningful.

Also been persevering with Arch and am really getting to like it, the fact that it is a rolling release does trouble me a bit but i've had no problems so far.  Next weekend i hope to try Gentoo, does anyone have any comments on the differences between Arch and Gentoo?

garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Re: Making a unique OS

Tue Mar 05, 2013 1:58 pm

Don't think it's been mentioned on this thread yet but there's a wonderful site that goes through creating LFS on the Pi - http://www.intestinate.com/pilfs/

It says you need to know a bit about LFS on x86 first but it all seems o.k. to me so far.

There are two bash scripts that will basically do everything for you (once you've created your partitioned SD card, created your LFS user and installed the pre-requisites http://www.linuxfromscratch.org/lfs/vie ... treqs.html)

I'm going through it all at the moment but, rather than just running the bash scripts I'm running each bit manually to see exactly what's going on. It's very time consuming but, as an educational exercise, very interesting! Plus, once I'm done, I can just image the card so I don't need to do it all again!

EDIT

Doing things manually resulted in a typo that meant the compilation failed after hours of running...do'h! I think I'll just run the scripts but read through what they're doing!

Gareth

garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Re: Making a unique OS

Thu Mar 07, 2013 9:13 am

Quick follow up.

My first run of the chapter 5 bash script failed when compiling Check-0.9.9.

According to this post http://www.mail-archive.com/lfs-dev@lin ... 18067.html this is caused by a misconfiguration when compiling Binutils-2.23.1 - Pass 2.

By applying the fix mentioned in this thread (adding --with-sysroot=$LFS to the binutils-2.23.1 configuration), deleting tools and re-starting it's got past the Check-0.9.9 compilation and is still going.

Gareth

Mogwai
Posts: 21
Joined: Thu Jul 26, 2012 4:08 pm
Location: Montreal
Contact: Website

Re: Making a unique OS

Thu Mar 07, 2013 1:58 pm

garetha wrote:My first run of the chapter 5 bash script failed when compiling Check-0.9.9
Thanks for trying the scripts and finding this issue!
You can expect a re-write/update of the guide and new material sometime this month, I'll have to take a closer look at this bug.
What distro are you building on? Raspbian?

garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Re: Making a unique OS

Thu Mar 07, 2013 3:22 pm

Yeah - it's the latest Raspian but it's not exactly vanilla, I've installed and uninstalled a lot of stuff.

In terms of the LFS scripts I followed the advice on setting up the disk with partitions, setting up the lfs user and setting up the lfs environment variables. I then used the scripts here: http://www.linuxfromscratch.org/lfs/vie ... treqs.html to make sure I had all the stuff installed (I didn't so a vanilla Raspbian wouldn't either) and sudo apt-get installed the ones I didn't.

The other issue I noticed with the scripts on the pilfs site (thanks for creating it by the way - I wouldn't have been able to do this without it!) was the URLs for the patches referred to in the wget file are all out of date. I found the bash patch (the only one needed for the tools build) at http://www.linuxfromscratch.org/patches/downloads/bash/ so I'm hoping the others would be in a similar directory?

My tools build has finished now, took ~24 hours with the Pi overclocked to high.

Once I've updated the wget script with the new patch locations I'll give Ch6 a go (I've imaged my SD card in case there's any problems...).

Gareth

garetha
Posts: 38
Joined: Sat Jan 05, 2013 12:07 am

Re: Making a unique OS

Fri Mar 08, 2013 9:18 am

:( Power failure meant that, after 18 hours of the chapter 6 script, all I've got is a corrupt SD card.

Sorry Mogwai, I can't go through all that again - I think my conclusion would be that setting up LFS on the Pi itself is possible but not recommended.

I think I'll see if I can get Arch Linux on there...if the card isn't completely dead!

Gareth

Return to “Other projects”