I'm trying to get the STPC Elite development board to use linuxbios with Filo, but after elfboot announces itself the board reboots:
---------------------- ..... Welcome to elfboot, the open sourced starter. January 2002, Eric Biederman. Version 1.2
LinuxBIOS-1.0.0 Thu Nov 6 16:13:37 GMT 2003 starting... Copying LinuxBIOS to ram. .... ------------------------ My config file looks like this:
target /home/fox/build/freebios1/stpc mainboard stpc/elite biosbase 0xffff0000
option CONFIG_COMPRESS=0
option SERIAL_CONSOLE=1 option TTYS0_BAUD=38400 option DEFAULT_CONSOLE_LOGLEVEL=9 option DEBUG=1
# option ROM_IMAGE_SIZE=131072 option ROM_SIZE=131072 option USE_ELF_BOOT=1
option PAYLOAD_SIZE=65536 payload /home/fox/build/filo-0.4/filo.elf
Any ideas as to what I've missed ?
On Thu, Nov 06, 2003 at 04:28:44PM -0000, Peter Fox wrote:
I'm trying to get the STPC Elite development board to use linuxbios with Filo, but after elfboot announces itself the board reboots:
Maybe this item in filo/FAQ applies?
Q. LinuxBIOS (v1 tree) crashes or fails to verify checksum when booting FILO. A. Make sure you are using the latest source of LinuxBIOS. It had a bug that interferes with checksum calculation, until recently.
I don't think it's that as I was using the cvs snapshot of 28-Oct-2003.
I was expecting elfboot to print something to say where it was looking for the payload, at least, but it didn't... I think that linuxbios can't find the payload, and was wondering how it knew where to find it. I shall no doubt work it out eventually, but was hoping for a quick pointer.
On Fri, Nov 07, 2003 at 11:30:02AM -0000, Peter Fox wrote:
I don't think it's that as I was using the cvs snapshot of 28-Oct-2003.
Ok, the fix was committed at 2003/10/20.
I was expecting elfboot to print something to say where it was looking for the payload, at least, but it didn't...
option DEFAULT_CONSOLE_LOGLEVEL=10 option MAXIMUM_CONSOLE_LOGLEVEL=10
I think that linuxbios can't find the payload, and was wondering how it knew where to find it. I shall no doubt work it out eventually, but was hoping for a quick pointer.
option ZKERNEL_START=0xfffc0000
Thanks, but that didn't help. I've added some debug code, and it looks like the payload stream is not set up - the stream->init() call in elfboot.c blows up (reboots before seeing any printks after the call to stream->init()).
The sources seem to imply the stream should be set up by the linker script, but there is nothing in my linker script that looks like it will do it.
Indeed looking at the linuxbios_c.map I see:
... 00008db8 T pc_keyboard_init 00008ec0 R epci_drivers 00008ec0 R estreams 00008ec0 R pci_drivers 00008ec0 R _rodata 00008ec0 R streams 00008ec0 T _etext 00009420 R intel_irq_routing_table ...
Which kind of implies there is no stream.
Any idea how the streams are supposed to be set up ?
I should have pointed out that my elite target is simply a clone of the stpc consumer2 stuff, with all the VGA related bits removed, at the moment.
On Mon, Nov 10, 2003 at 09:22:58AM -0000, Peter Fox wrote:
The sources seem to imply the stream should be set up by the linker script, but there is nothing in my linker script that looks like it will do it.
Indeed looking at the linuxbios_c.map I see:
... 00008db8 T pc_keyboard_init 00008ec0 R epci_drivers 00008ec0 R estreams 00008ec0 R pci_drivers 00008ec0 R _rodata 00008ec0 R streams 00008ec0 T _etext 00009420 R intel_irq_routing_table ...
Which kind of implies there is no stream.
Any idea how the streams are supposed to be set up ?
option USE_GENERIC_ROM=1 This will enable the rom_fill_inbuf.c and the rom_stream driver will automagically show up in between the streams and estreams.
Thanks ! That's the one. I now get the FILO startup banner, but then it reboots.
----------------- ... Welcome to elfboot, the open sourced starter. January 2002, Eric Biederman. Version 1.2
Stream pointer is 0x00009020 34:init_bytes() - zkernel_start:0xfffe0000 zker nel_mask:0x0000ffff Stream initialised ok Stream header read ok Found ELF candiate at offset 0 header_offset is 0 Try to load at offset 0x0 malloc Enter, size 32, free_mem_ptr 00011768 malloc 0x00011768 New segment addr 0x100000 size 0x218b0 offset 0xa0 filesize 0x7920 (cleaned up) New segment addr 0x100000 size 0x218b0 offset 0xa0 filesize 0x7920 lb: [0x0000000000004000, 0x000000000005136c) malloc Enter, size 32, free_mem_ptr 00011788 malloc 0x00011788 New segment addr 0x1218c0 size 0x60 offset 0x79c0 filesize 0x60 (cleaned up) New segment addr 0x1218c0 size 0x60 offset 0x79c0 filesize 0x60 lb: [0x0000000000004000, 0x000000000005136c) Dropping non PT_LOAD segment Loading Segment: addr: 0x0000000000100000 memsz: 0x00000000000218b0 filesz: 0x00 00000000007920 [ 0x0000000000100000, 0000000000107920, 0x00000000001218b0) <- 00000000000000a0 Clearing Segment: addr: 0x0000000000107920 memsz: 0x0000000000019f90 Loading Segment: addr: 0x00000000001218c0 memsz: 0x0000000000000060 filesz: 0x00 00000000000060 [ 0x00000000001218c0, 0000000000121920, 0x0000000000121920) <- 00000000000079c0 Loaded segments verified segments closed down stream Jumping to boot code at 0x1053d0 entry = 0x001053d0 lb_start = 0x00004000 lb_size = 0x0004d36c adjust = 0x01faec94 buffer = 0x01f65928 elf_boot_notes = 0x0000b100 adjusted_boot_notes = 0x01fb9d94 FILO version 0.4 (fox@stpc.ifr.co.uk) Thu Nov 6 14:25:29 GMT 2003
LinuxBIOS-1.0.0 Mon Nov 10 09:52:46 GMT 2003 starting... Copying LinuxBIOS to ram. ... --------------------- I'm turning on debugging in Filo to see why. Here's the result.. --------------------- ... FILO version 0.4 (fox@stpc.ifr.co.uk) Mon Nov 10 12:04:52 GMT 2003 collect_sys_info: boot eax = 0xe1fb007 collect_sys_info: boot ebx = 0x1fb9d94 collect_sys_info: boot arg = 0x1fb9d94 malloc_diag: alloc: 0 bytes (0 blocks), free: 16376 bytes (1 blocks) malloc_diag: alloc: 24 bytes (1 blocks), free: 16352 bytes (1 blocks) collect_elfboot_info: Bootloader: elfboot collect_elfboot_info: Version: 1.2 malloc_diag: alloc: 40 bytes (2 blocks), free: 16336 bytes (1 blocks) collect_linuxbios_info: Searching for LinuxBIOS tables... find_lb_table: Found canidate at: 00000500 find_lb_table: header checksum o.k. find_lb_table: table checksum o.k. find_lb_table: record count o.k. collect_linuxbios_info: Found LinuxBIOS table at: 00000500 malloc_diag: alloc: 96 bytes (3 blocks), free: 16280 bytes (1 blocks) convert_memmap: 0x00000000000000 0x000000000006d0 16 convert_memmap: 0x000000000006d0 0x0000000009f930 1 convert_memmap: 0x00000000100000 0x00000001f00000 1 collect_sys_info: 00000000000006d0-00000000000a0000 collect_sys_info: 0000000000100000-0000000002000000 collect_sys_info: RAM 32 MB relocate: Current location: 0x100000-0x123fdf relocate: Relocating to 0x1fdc020-0x1ffffff... ok
LinuxBIOS-1.0.0 Mon Nov 10 12:08:12 GMT 2003 starting... Copying LinuxBIOS to ram. ...
-- Peter Fox peter.fox@aeroflex.com Aeroflex Test Solutions Principal Design Engineer Stevenage Any opinions expressed above are http://www.aeroflex.com/ not necessarily those of Aeroflex. Tel: + 44 (0) 1438 742200
-----Original Message----- From: Takeshi Sone [mailto:ts1@tsn.or.jp] Sent: 10 November 2003 09:38 To: Peter Fox Cc: Linuxbios Subject: Re: How to use Filo as a payload ?
On Mon, Nov 10, 2003 at 09:22:58AM -0000, Peter Fox wrote:
The sources seem to imply the stream should be set up by the linker script, but there is nothing in my linker script that looks like it will do it.
Indeed looking at the linuxbios_c.map I see:
... 00008db8 T pc_keyboard_init 00008ec0 R epci_drivers 00008ec0 R estreams 00008ec0 R pci_drivers 00008ec0 R _rodata 00008ec0 R streams 00008ec0 T _etext 00009420 R intel_irq_routing_table ...
Which kind of implies there is no stream.
Any idea how the streams are supposed to be set up ?
option USE_GENERIC_ROM=1 This will enable the rom_fill_inbuf.c and the rom_stream driver will automagically show up in between the streams and estreams.
-- Takeshi
On Mon, Nov 10, 2003 at 12:16:11PM -0000, Peter Fox wrote:
relocate: Current location: 0x100000-0x123fdf relocate: Relocating to 0x1fdc020-0x1ffffff... ok
LinuxBIOS-1.0.0 Mon Nov 10 12:08:12 GMT 2003 starting... Copying LinuxBIOS to ram.
Does your CPU have RDTSC instruction? FILO uses it for timing.
I don't think so. It is the 486 core in an stpc elite. It just claims Industry standard 486 compatibility.
In their published instruction set summary, which appears to be in alphabetical order, there is RCR, then REP INS.
On Mon, Nov 10, 2003 at 12:45:27PM -0000, Peter Fox wrote:
I don't think so. It is the 486 core in an stpc elite. It just claims Industry standard 486 compatibility.
In their published instruction set summary, which appears to be in alphabetical order, there is RCR, then REP INS.
Maybe RDTSC causes invalid opcode exception, and since there is no exception handler, the CPU resets.
filo/i386/timer.c must be re-written to support pre-Pentium CPUs.
That's it.
I hacked together a new timer.c based on freebios/src/pc80/udelay_timer2.c
You may want to offer it as an alternative, but then again, maybe not.
I can now boot linux using filo !
Thanks for all your help.
On Mon, Nov 10, 2003 at 03:30:20PM -0000, Peter Fox wrote:
I hacked together a new timer.c based on freebios/src/pc80/udelay_timer2.c
You may want to offer it as an alternative, but then again, maybe not.
Thanks a lot. I will incorporate this code in the future release of FILO.
Peter Fox wrote:
I hacked together a new timer.c based on freebios/src/pc80/udelay_timer2.c You may want to offer it as an alternative, but then again, maybe not. I can now boot linux using filo !
I was following this thread, and I meant to mention this earlier, but figured that it was not the issue. None of the stpc versions AFAIK have the TSC, as you quickly discovered, and it resets if you reference any of these instructions.
-Steve
There was a bug where the timer gate wasn't turned on if only currticks was called.