A bug was found in freebios2/src/northbridge/via/vt8601/raminit.c
scheng at msica.com
scheng at msica.com
Tue Jul 6 10:57:00 CEST 2004
> On Mon, 5 Jul 2004 scheng at msica.com wrote:
>
>> I am trying to use LinuxBIOS V2 + Filo to boot local Linux on hard disk
>> (EPIA 800 board).
>>
>> I found that LinuxBIOS executes an infinite loop in dumpnorth() function
>> of freebios2/src/northbridge/via/vt8601/raminit.c .
>>
>> The function is:
>> void
>> dumpnorth(device_t north)
>> {
>> uint8_t r, c;
>> for(r = 0; r < 256; r += 16) {
>> print_debug_hex8(r);
>> print_debug(":");
>> for(c = 0; c < 16; c++) {
>> print_debug_hex8(pci_read_config8(north, r+c));
>> print_debug(" ");
>> }
>> print_debug("\r\n");
>> }
>> }
>>
>> Since r is an unsigned char, it will never reach 256. To fix the
>> problem,
>> I simply added a line at the end of the loop: if( r >= 240 ) break;
>
> thanks for the fix, did you do something like this:
>
> void
> dumpnorth(device_t north)
> {
> uint8_t r, c;
> for(r = 0; ; r += 16) {
> print_debug_hex8(r);
> print_debug(":");
> for(c = 0; c < 16; c++) {
> print_debug_hex8(pci_read_config8(north, r+c));
> print_debug(" ");
> }
> print_debug("\r\n");
> if (r >= 240)
> break;
> }
> }
>
> (r and c are u8 because we're trying to use bytes whereever possible; this
> is rommcc-compiled)
>
> Let me know if this works and I'll commit it.
Yes, it works.
>
>
>>
>> *******************************************************************
>> By the way, I am still working on filo. In my machine, after elfboot
>> passing control to filo, LinuxBIOS Fallback restarts again. Following
>> is
>> a piece of screenshot:
>> ......
>> Loading Segment: addr: 0x0000000000100000 memsz: 0x00000000000240e0
>> filesz: 0x000000000000a048
>> Clearing Segment: addr: 0x000000000010a048 memsz: 0x000000000001a098
>> Loading Segment: addr: 0x00000000001240e0 memsz: 0x0000000000000048
>> filesz: 0x0000000000000048
>> Jumping to boot code at 0x107d28
>> .8(=±sioÿ.
>
> This looks like baud rate troubles in part.
>
> also, what does readelf -a of the filo show? your start address seems odd.
Here is the readelf -a filo.elf:
****************************************************************
epia1:/usr/src# readelf -a filo.elf
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x107d28
Start of program headers: 52 (bytes into file)
Start of section headers: 41400 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 4
Size of section headers: 40 (bytes)
Number of section headers: 10
Section header string table index: 9
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk
Inf Al
[ 0] NULL 00000000 000000 000000 00 0
0 0
[ 1] .note NOTE 00100000 0000c0 000078 00 A 0
0 32
[ 2] .text PROGBITS 00100080 000140 008d28 00 WAX 0
0 16
[ 3] .rodata PROGBITS 00108dc0 008e80 000f29 00 A 0
0 32
[ 4] .eh_frame PROGBITS 00109cec 009dac 000058 00 A 0
0 4
[ 5] .data PROGBITS 00109d60 009e20 0002e8 00 WA 0
0 32
[ 6] .bss NOBITS 0010a060 00a120 01a080 00 WA 0
0 32
[ 7] .initctx PROGBITS 001240e0 00a120 000048 00 WA 0
0 32
[ 8] .note.GNU-stack NOTE 00000000 00a168 000000 00 X 0
0 1
[ 9] .shstrtab STRTAB 00000000 00a168 00004d 00 0
0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x0000c0 0x00100000 0x00100000 0x0a048 0x240e0 RWE 0x20
LOAD 0x00a120 0x001240e0 0x001240e0 0x00048 0x00048 RW 0x20
NOTE 0x0000c0 0x00100000 0x00100000 0x00078 0x00078 R 0x20
STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
Section to Segment mapping:
Segment Sections...
00 .note .text .rodata .eh_frame .data .bss
01 .initctx
02 .note
03
There is no dynamic segment in this file.
There are no relocations in this file.
There are no unwind sections in this file.
No version information found in this file.
*******************************************************************
Ron,
I am a newbie to LinuxBIOS and booting area. There are too many things to
learn. Thank you for your help.
Simon
> David, what do you think?
>
> ron
>
>
More information about the coreboot
mailing list