Board:tyan/s2892: Difference between revisions
No edit summary |
m (Phcoder moved page Tyan S2892 to Board:tyan/s2892) |
||
(12 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Purpose == | == Purpose == | ||
Customize the system to allow me to play with memory mappings and large | Customize the system to allow me to play with memory mappings and large devices. I wanted to minimize intermediate steps from LinuxBIOS to Linux to minimize the areas of expertise I needed to develop. I also wanted to be able to use the SATA drives as my boot drives. | ||
devices. I wanted to minimize intermediate steps from LinuxBIOS to Linux to | |||
minimize the areas of expertise I needed to develop. I also wanted to be | |||
able to use the SATA drives as my boot drives. | |||
==Disclaimer == | ==Disclaimer == | ||
Line 16: | Line 13: | ||
== The procedure == | == The procedure == | ||
I started by installing LinuxBIOS on the system and using FILO and Etherboot | I started by installing LinuxBIOS on the system and using FILO and Etherboot to boot to a kernel. This allowed me to try the different payloads without flashing every time. | ||
to boot to a kernel. This allowed me to try the different payloads without | |||
flashing every time. | |||
Next I downloaded the OLPC buildrom | Next I downloaded the OLPC buildrom | ||
Line 24: | Line 19: | ||
git clone git://dev.laptop.org/users/jcrouse/buildrom | git clone git://dev.laptop.org/users/jcrouse/buildrom | ||
I | I modified the Config.mk to include pciutils from | ||
:http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/package/ | |||
and took out the graphical boot menu. I also modified | and took out the graphical boot menu. I also modified | ||
''buildrom/skeleton/devices.txt'' to add lines for my hard drives. I just | ''buildrom/skeleton/devices.txt'' to add lines for my hard drives. I just | ||
copied the lines for ''sda'' and ''sda1'' and made ''hda hda1 hda2'' and ''sda2''. The | copied the lines for ''sda'' and ''sda1'' and made ''hda hda1 hda2'' and ''sda2''. The important thing is to make sure that the major and minor numbers are correct. | ||
important thing is to make sure that the major and minor numbers are | |||
correct. | |||
I modified ''buildrom/skeleton/linuxrc'' so that the device files were created | I modified ''buildrom/skeleton/linuxrc'' so that the device files were created earlier, ''/dev/null'' didn't become a text file, and my drives got mounted in read-only mode. | ||
earlier, ''/dev/null'' didn't become a text file, and my drives got mounted. | |||
I then modified buildrom/skeleton/bin/boot.functions so that ''doboot()'' called | I then modified buildrom/skeleton/bin/boot.functions so that ''doboot()'' called my script on the hard drive for the kexec. That's nice to avoid flashing the BIOS for booting different kernels. | ||
my script on the hard drive for the kexec. That's nice to avoid flashing | |||
the BIOS for booting different kernels. | |||
I downloaded Linux 2.6.18.1 (2.6.18-rc4 had some problems with SATA) and | I downloaded Linux 2.6.18.1 (2.6.18-rc4 had some problems with SATA) and | ||
Line 45: | Line 35: | ||
''12-tiny-tiny-crc.patch'' fails, but was easy to apply by hand. | ''12-tiny-tiny-crc.patch'' fails, but was easy to apply by hand. | ||
I configured the kernel to include support for ext2 | I configured the kernel to include support for ext2, SATA, and IDE. | ||
I ran make and copied the payloads from the ''buildrom/deploy'' directory to my | I ran make and copied the payloads from the ''buildrom/deploy'' directory to my s2892 to be used. ''olpc-payload.elf.lzma'' (732K) is used for booting directly from LinuxBIOS, and ''olpc-payload-uncompressed.elf'' (1.7M) was useful for testing it with FILO and Etherboot. | ||
s2892 to be used. ''olpc-payload.elf.lzma'' (732K) is used for booting directly | |||
from LinuxBIOS, and ''olpc-payload-uncompressed.elf'' (1.7M) was useful for | |||
testing it with FILO and Etherboot. | |||
[[Mkelfimage|mkelfImage]] wouldn't work with the vmlinux file, so I changed the Makefile to get it to use the bzImage instead. | |||
Now I have | Now I have | ||
* fallback/linuxbios.strip (88K) | |||
* fallback/linuxbios.strip ( | * normal/payload (860K) | ||
* normal/payload ( | |||
* s2892vBIOS.bin (36K) | * s2892vBIOS.bin (36K) | ||
If | If you want to simplify the build process and don't want to customize it too much: | ||
* Use this [http://www.openbios.org/pipermail/linuxbios/attachments/20061031/18edb8e8/attachment-0001.obj buildrom2_noacpi.tar.bz2] [http://www.linuxbios.org/pipermail/linuxbios/2006-October/016537.html original post] | |||
make | * Or this [http://www.openbios.org/pipermail/linuxbios/attachments/20061031/7e7a6632/attachment-0001.obj buildrom2_amd64_1031.tar.bz2] [http://www.linuxbios.org/pipermail/linuxbios/2006-October/016558.html original post] | ||
# make | |||
# use payloads from deploy directory. | |||
WARNING: I have a bios savior so that when I mess up I can get my machine back. If you don't have one, you might not want to do the fallback only boot. | |||
== Config.lb == | |||
<pre><nowiki> | |||
# Sample config file for | |||
# the Tyan s2892 | |||
# This will make a target directory of ./s2892 | |||
target s2892 | |||
mainboard tyan/s2892 | |||
option ROM_SIZE = 0xf7000 # 8Mbit - 36K for VGA BIOS | |||
option CONFIG_ROM_STREAM=1 | |||
option CONFIG_CONSOLE_SERIAL8250 = 1 | |||
option CONFIG_CONSOLE_VGA = 1 | |||
option FALLBACK_SIZE = ROM_SIZE | |||
option ROM_IMAGE_SIZE = 0x16000 | |||
# Tyan s2892 | |||
romimage "fallback" | |||
option CONFIG_COMPRESSED_ROM_STREAM_LZMA=1 | |||
option CONFIG_PRECOMPRESSED_ROM_STREAM=1 | |||
option USE_FALLBACK_IMAGE=1 | |||
option LINUXBIOS_EXTRA_VERSION="$(shell cat ../../VERSION)_Fallback" | |||
payload ../olpc-payload.elf.lzma | |||
end | |||
buildrom ./linuxbios.rom ROM_SIZE "fallback" | |||
</nowiki></pre> | |||
== Kexec-tools == | |||
Because the kexec tools that are included with OLPC's buildrom are stripped down for 32-bit kernels, I built kexec statically linked (read "large file") and put it on the hard drive with the kernel to be loaded. I use kexec to boot my kernel which has been combined with initrd into an elf with mkelfImage: | |||
mkelfImage --comand--line="ro root=/dev/hda1 console=tty0" --kernel="vmlinux" --initrd="initrd" --output="mylinux.elf" | |||
I have to use | |||
kexec -f mylinux.elf | |||
because otherwise kexec calls shutdown and there is no shutdown in the OLPC initrd. I guess that's a half truth, because when I call kexec without the -f it reboots the machine completely instead of a kexec when shutdown is available. | |||
== Status == | |||
My machine boots LinuxBIOS, then linux-2.6.18.1-tiny, then kexecs into linux-2.6.18.1-normal. It takes a little longer than going through elfboot and FILO, but it is a simpler path. | |||
== Author == | == Author == | ||
This document was written by Myles Watson <myles at pel dot cs dot byu dot edu> | This document was written by Myles Watson <myles at pel dot cs dot byu dot edu> | ||
{{PD-self}} | |||
[[Category:Tutorials]] |
Latest revision as of 23:22, 18 January 2014
Purpose
Customize the system to allow me to play with memory mappings and large devices. I wanted to minimize intermediate steps from LinuxBIOS to Linux to minimize the areas of expertise I needed to develop. I also wanted to be able to use the SATA drives as my boot drives.
Disclaimer
There are several places where my solutions are not as elegant as I wished them to be. Suggestions are welcome.
Current set up
- Tyan s2892
- LinuxBIOS with Linux 2.6.18-tiny as a payload
The procedure
I started by installing LinuxBIOS on the system and using FILO and Etherboot to boot to a kernel. This allowed me to try the different payloads without flashing every time.
Next I downloaded the OLPC buildrom
git clone git://dev.laptop.org/users/jcrouse/buildrom
I modified the Config.mk to include pciutils from
and took out the graphical boot menu. I also modified buildrom/skeleton/devices.txt to add lines for my hard drives. I just copied the lines for sda and sda1 and made hda hda1 hda2 and sda2. The important thing is to make sure that the major and minor numbers are correct.
I modified buildrom/skeleton/linuxrc so that the device files were created earlier, /dev/null didn't become a text file, and my drives got mounted in read-only mode.
I then modified buildrom/skeleton/bin/boot.functions so that doboot() called my script on the hard drive for the kexec. That's nice to avoid flashing the BIOS for booting different kernels.
I downloaded Linux 2.6.18.1 (2.6.18-rc4 had some problems with SATA) and patched it with the tiny patches that came with OLPC. 12-tiny-tiny-crc.patch fails, but was easy to apply by hand.
I configured the kernel to include support for ext2, SATA, and IDE.
I ran make and copied the payloads from the buildrom/deploy directory to my s2892 to be used. olpc-payload.elf.lzma (732K) is used for booting directly from LinuxBIOS, and olpc-payload-uncompressed.elf (1.7M) was useful for testing it with FILO and Etherboot.
mkelfImage wouldn't work with the vmlinux file, so I changed the Makefile to get it to use the bzImage instead.
Now I have
- fallback/linuxbios.strip (88K)
- normal/payload (860K)
- s2892vBIOS.bin (36K)
If you want to simplify the build process and don't want to customize it too much:
- Use this buildrom2_noacpi.tar.bz2 original post
- Or this buildrom2_amd64_1031.tar.bz2 original post
- make
- use payloads from deploy directory.
WARNING: I have a bios savior so that when I mess up I can get my machine back. If you don't have one, you might not want to do the fallback only boot.
Config.lb
# Sample config file for # the Tyan s2892 # This will make a target directory of ./s2892 target s2892 mainboard tyan/s2892 option ROM_SIZE = 0xf7000 # 8Mbit - 36K for VGA BIOS option CONFIG_ROM_STREAM=1 option CONFIG_CONSOLE_SERIAL8250 = 1 option CONFIG_CONSOLE_VGA = 1 option FALLBACK_SIZE = ROM_SIZE option ROM_IMAGE_SIZE = 0x16000 # Tyan s2892 romimage "fallback" option CONFIG_COMPRESSED_ROM_STREAM_LZMA=1 option CONFIG_PRECOMPRESSED_ROM_STREAM=1 option USE_FALLBACK_IMAGE=1 option LINUXBIOS_EXTRA_VERSION="$(shell cat ../../VERSION)_Fallback" payload ../olpc-payload.elf.lzma end buildrom ./linuxbios.rom ROM_SIZE "fallback"
Kexec-tools
Because the kexec tools that are included with OLPC's buildrom are stripped down for 32-bit kernels, I built kexec statically linked (read "large file") and put it on the hard drive with the kernel to be loaded. I use kexec to boot my kernel which has been combined with initrd into an elf with mkelfImage:
mkelfImage --comand--line="ro root=/dev/hda1 console=tty0" --kernel="vmlinux" --initrd="initrd" --output="mylinux.elf"
I have to use
kexec -f mylinux.elf
because otherwise kexec calls shutdown and there is no shutdown in the OLPC initrd. I guess that's a half truth, because when I call kexec without the -f it reboots the machine completely instead of a kexec when shutdown is available.
Status
My machine boots LinuxBIOS, then linux-2.6.18.1-tiny, then kexecs into linux-2.6.18.1-normal. It takes a little longer than going through elfboot and FILO, but it is a simpler path.
Author
This document was written by Myles Watson <myles at pel dot cs dot byu dot edu>
I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.
In case this is not legally possible: |