* 2.4.27, alpha arch, make bootimage and make bootpfile fails
@ 2004-10-12 17:33 Norbert Preining
2004-10-13 19:32 ` Ivan Kokshaysky
0 siblings, 1 reply; 8+ messages in thread
From: Norbert Preining @ 2004-10-12 17:33 UTC (permalink / raw)
To: linux-kernel; +Cc: debian-alpha
Hello kernel Gurus!
[debian/woody on alpha sx165/lx164, gcc-3.3.4]
We need to netboot our alphas (because booting from the SCSI controllers
is not an option, they are not supported by the SRM console) and I try
to make a bootp image of our kernel.
When doing this on our alpha the
make bootimage
and the
make bootpfile
both bail out with:
make[1]: Entering directory `/usr/src/linux-2.4.27/arch/alpha/boot'
tools/objstrip -v /usr/src/linux-2.4.27/vmlinux vmlinux.nh
tools/objstrip: extracting 0xfffffc0000310000-0xfffffc00005cfef8 (at
2000)
tools/objstrip: copying 2883320 byte from /usr/src/linux-2.4.27/vmlinux
tools/objstrip: zero-filling bss and aligning to 0 with 393432 bytes
echo "#define KERNEL_SIZE `ls -l vmlinux.nh | awk '{print $5}'`" >
ksize.hT
cmp -s ksize.hT ksize.h || mv -f ksize.hT ksize.h
rm -f ksize.hT
ld -static -T bootloader.lds head.o main.o
/usr/src/linux-2.4.27/arch/alpha/lib/lib.a
/usr/src/linux-2.4.27/lib/lib.a
/usr/src/linux-2.4.27/arch/alpha/lib/lib.a -o bootloader
/usr/src/linux-2.4.27/lib/lib.a(vsprintf.o): In function `vsnprintf':
vsprintf.o(.text+0xcd4): undefined reference to `printk'
vsprintf.o(.text+0xcdc): undefined reference to `printk'
/usr/src/linux-2.4.27/lib/lib.a(dump_stack.o): In function `dump_stack':
dump_stack.o(.text+0x10): undefined reference to `printk'
dump_stack.o(.text+0x1c): undefined reference to `printk'
make[1]: *** [bootloader] Error 1
make[1]: Leaving directory `/usr/src/linux-2.4.27/arch/alpha/boot'
make: *** [bootimage] Error 2
and similar with bootpfile
Is there a way around this, we definitely need the bootp image.
Thanks a lot and all the best
Norbert
-------------------------------------------------------------------------------
Norbert Preining <preining AT logic DOT at> Technische Universität Wien
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
SCREEB (n.)
To make the noise of a nylon anorak rubbing against a pair of corduroy
trousers.
--- Douglas Adams, The Meaning of Liff
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-12 17:33 2.4.27, alpha arch, make bootimage and make bootpfile fails Norbert Preining @ 2004-10-13 19:32 ` Ivan Kokshaysky 2004-10-13 21:10 ` Norbert Preining 2004-10-14 13:00 ` Norbert Preining 0 siblings, 2 replies; 8+ messages in thread From: Ivan Kokshaysky @ 2004-10-13 19:32 UTC (permalink / raw) To: Norbert Preining; +Cc: linux-kernel, debian-alpha, linux-alpha On Tue, Oct 12, 2004 at 07:33:44PM +0200, Norbert Preining wrote: > When doing this on our alpha the > make bootimage > and the > make bootpfile > both bail out with: ... > /usr/src/linux-2.4.27/arch/alpha/lib/lib.a -o bootloader > /usr/src/linux-2.4.27/lib/lib.a(vsprintf.o): In function `vsnprintf': > vsprintf.o(.text+0xcd4): undefined reference to `printk' Thanks for the report. The appended patch should fix that. Ivan. --- 2.4/arch/alpha/boot/bootloader.lds Tue Jul 3 01:40:14 2001 +++ linux/arch/alpha/boot/bootloader.lds Wed Oct 13 23:18:50 2004 @@ -1,5 +1,6 @@ OUTPUT_FORMAT("elf64-alpha") ENTRY(__start) +printk = srm_printk; SECTIONS { . = 0x20000000; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-13 19:32 ` Ivan Kokshaysky @ 2004-10-13 21:10 ` Norbert Preining 2004-10-14 13:00 ` Norbert Preining 1 sibling, 0 replies; 8+ messages in thread From: Norbert Preining @ 2004-10-13 21:10 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: linux-kernel, debian-alpha, linux-alpha On Mit, 13 Okt 2004, Ivan Kokshaysky wrote: > > /usr/src/linux-2.4.27/arch/alpha/lib/lib.a -o bootloader > > /usr/src/linux-2.4.27/lib/lib.a(vsprintf.o): In function `vsnprintf': > > vsprintf.o(.text+0xcd4): undefined reference to `printk' > > Thanks for the report. The appended patch should fix that. Thanks a lot. This fixed it. Testing will be done tomorrow. Best wishes Norbert ------------------------------------------------------------------------------- Norbert Preining <preining AT logic DOT at> Technische Universität Wien gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 ------------------------------------------------------------------------------- WHAPLODE DROVE (n.) A homicidal golf stroke. --- Douglas Adams, The Meaning of Liff ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-13 19:32 ` Ivan Kokshaysky 2004-10-13 21:10 ` Norbert Preining @ 2004-10-14 13:00 ` Norbert Preining 2004-10-14 17:23 ` Måns Rullgård 2004-10-19 15:54 ` Ivan Kokshaysky 1 sibling, 2 replies; 8+ messages in thread From: Norbert Preining @ 2004-10-14 13:00 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: linux-kernel, debian-alpha, linux-alpha [-- Attachment #1: Type: text/plain, Size: 1069 bytes --] Dear Ivan, dear kernel kackers! On Mit, 13 Okt 2004, Ivan Kokshaysky wrote: > > make bootpfile Ok, now I have a boot file but the kernel is not started: >>> boot ewa0 -fl ... ... jumping to bootstrap code Linux/AXP bootp loader for linux 2.4.27 Switching to OSF PAL-code .. 0k (rev 1000800020117) Loading the kernel...'root=/dev/sda1' Halted CPU 0 halt code = 2 kernel stack not valid halt PC = 200000000 boot failure >>> (typed in from screen) SRM 5.5, AlphaPC164 normal (from scsi) boot dmesg with aboot is attached. Any hints for this? Best wishes Norbert ------------------------------------------------------------------------------- Norbert Preining <preining AT logic DOT at> Technische Universität Wien gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 ------------------------------------------------------------------------------- HARPENDEN (n.) The coda to a phone conversion, consisting of about eight exchanges, by which people try gracefully to get off the line. --- Douglas Adams, The Meaning of Liff [-- Attachment #2: alpha.dmesg --] [-- Type: text/plain, Size: 3657 bytes --] Linux version 2.4.27alphafullscsi (root@beta) (gcc version 3.3.4) #1 Tue Oct 12 08:04:47 CEST 2004 Booting on EB164 variation PC164 using machine vector PC164 from SRM Major Options: EV56 LEGACY_START MAGIC_SYSRQ Command line: ro root=/dev/sda1 memcluster 0, usage 1, start 0, end 192 memcluster 1, usage 0, start 192, end 32651 memcluster 2, usage 1, start 32651, end 32768 freeing pages 192:384 freeing pages 794:32651 reserving pages 794:795 pci: cia revision 2 On node 0 totalpages: 32651 zone(0): 32651 pages. zone(1): 0 pages. zone(2): 0 pages. Kernel command line: ro root=/dev/sda1 Using epoch = 2000 Console: colour VGA+ 80x25 Calibrating delay loop... 994.44 BogoMIPS Memory: 253544k/261208k available (2070k kernel code, 6128k reserved, 351k data, 328k init) Dentry cache hash table entries: 32768 (order: 6, 524288 bytes) Inode cache hash table entries: 16384 (order: 5, 262144 bytes) Mount cache hash table entries: 512 (order: 0, 8192 bytes) Buffer cache hash table entries: 8192 (order: 3, 65536 bytes) Page-cache hash table entries: 32768 (order: 5, 262144 bytes) POSIX conformance testing by UNIFIX pci: passed tb register update test pci: passed sg loopback i/o read test pci: passed tbia test pci: passed pte write cache snoop test pci: failed valid tag invalid pte reload test (mcheck; workaround available) pci: passed pci machine check test pci: enabling save/restore of SRM state SMC FDC37C93X Ultra I/O Controller found @ 0x370 Linux NET4.0 for Linux 2.4 Based upon Swansea University Computer Society NET3.039 Initializing RT netlink socket srm_env: version 0.0.5 loaded successfully Starting kswapd VFS: Disk quotas vdquot_6.5.1 Journalled Block Device driver loaded Installing knfsd (copyright (C) 1996 okir@monad.swb.de). pty: 256 Unix98 ptys configured Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled ttyS00 at 0x03f8 (irq = 4) is a 16550A ttyS01 at 0x02f8 (irq = 3) is a 16550A rtc: SRM (post-2000) epoch (2000) detected Real Time Clock Driver v1.10f Floppy drive(s): fd0 is 2.88M FDC 0 is a post-1991 82077 eth0: DE434/5 at 0x8400 (PCI bus 0, device 7), h/w address 00:c0:95:ec:b7:60, and requires IRQ17 (provided by PCI BIOS). de4x5.c:V0.546 2001/02/22 davies@maniac.ultranet.com SCSI subsystem driver Revision: 1.00 sym0: <810> rev 0x2 on pci bus 0 device 9 function 0 irq 19 sym0: No NVRAM, ID 7, Fast-10, SE, parity checking sym0: SCSI BUS has been reset. scsi0 : sym-2.1.17a blk: queue fffffc000fe2eca8, no I/O memory limit Vendor: IBM Model: DNES-309170 Rev: SA30 Type: Direct-Access ANSI SCSI revision: 03 blk: queue fffffc000fe2eea8, no I/O memory limit Vendor: HP Model: C1533A Rev: 9503 Type: Sequential-Access ANSI SCSI revision: 02 blk: queue fffffc000fe2f0a8, no I/O memory limit sym0:0:0: tagged command queuing enabled, command queue depth 16. st: Version 20040102, bufsize 32768, max init. bufs 4, s/g segs 16 Attached scsi tape st0 at scsi0, channel 0, id 5, lun 0 Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 sym0:0: FAST-10 SCSI 10.0 MB/s ST (100.0 ns, offset 8) SCSI device sda: 17916240 512-byte hdwr sectors (9173 MB) Partition check: sda: sda1 sda2 sda3 sda4 NET4: Linux TCP/IP 1.0 for NET4.0 IP Protocols: ICMP, UDP, TCP IP: routing cache hash table of 4096 buckets, 32Kbytes TCP: Hash tables configured (established 32768 bind 32768) NET4: Unix domain sockets 1.0/SMP for Linux NET4.0. VFS: Mounted root (ext2 filesystem) readonly. Freeing unused kernel memory: 328k freed Adding Swap: 205592k swap-space (priority -1) eth0: media is TP. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-14 13:00 ` Norbert Preining @ 2004-10-14 17:23 ` Måns Rullgård 2004-10-15 10:39 ` Norbert Preining 2004-10-19 15:54 ` Ivan Kokshaysky 1 sibling, 1 reply; 8+ messages in thread From: Måns Rullgård @ 2004-10-14 17:23 UTC (permalink / raw) To: Norbert Preining; +Cc: Ivan Kokshaysky, linux-kernel, debian-alpha, linux-alpha Norbert Preining <preining@logic.at> writes: > Dear Ivan, dear kernel kackers! > > On Mit, 13 Okt 2004, Ivan Kokshaysky wrote: >> > make bootpfile > > Ok, now I have a boot file but the kernel is not started: > >>>> boot ewa0 -fl ... > ... > jumping to bootstrap code > Linux/AXP bootp loader for linux 2.4.27 > Switching to OSF PAL-code .. 0k (rev 1000800020117) > Loading the kernel...'root=/dev/sda1' > > Halted CPU 0 > > halt code = 2 > kernel stack not valid halt > PC = 200000000 > boot failure Try building more things as modules instead of builtin, if possible. -- Måns Rullgård mru@mru.ath.cx ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-14 17:23 ` Måns Rullgård @ 2004-10-15 10:39 ` Norbert Preining 0 siblings, 0 replies; 8+ messages in thread From: Norbert Preining @ 2004-10-15 10:39 UTC (permalink / raw) To: Måns Rullgård Cc: Ivan Kokshaysky, linux-kernel, debian-alpha, linux-alpha On Don, 14 Okt 2004, Måns Rullgård wrote: > > Loading the kernel...'root=/dev/sda1' > > > > Halted CPU 0 > > > > halt code = 2 > > kernel stack not valid halt > > PC = 200000000 > > boot failure > > Try building more things as modules instead of builtin, if possible. I have reduced the whole kernel zo more or less nothing included, besides the SCSI drivers, and the same still happens. Best wishes Norbert ------------------------------------------------------------------------------- Norbert Preining <preining AT logic DOT at> Technische Universität Wien gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 ------------------------------------------------------------------------------- LOCHRANZA (n.) The long unaccomplished wail in the middle of a Scottish folk song where the pipes nip around the corner for a couple of drinks. --- Douglas Adams, The Meaning of Liff ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-14 13:00 ` Norbert Preining 2004-10-14 17:23 ` Måns Rullgård @ 2004-10-19 15:54 ` Ivan Kokshaysky 2004-10-20 11:19 ` Norbert Preining 1 sibling, 1 reply; 8+ messages in thread From: Ivan Kokshaysky @ 2004-10-19 15:54 UTC (permalink / raw) To: Norbert Preining; +Cc: linux-kernel, debian-alpha, linux-alpha On Thu, Oct 14, 2004 at 03:00:35PM +0200, Norbert Preining wrote: > Ok, now I have a boot file but the kernel is not started: > > >>> boot ewa0 -fl ... > ... > Halted CPU 0 > > halt code = 2 > kernel stack not valid halt I was able to reproduce that on SX164 with both bootpfile and bootpzfile. As it turns out, the final kernel destination overlaps the initial stack region. Please test the appended patch. Ivan. --- 2.4/arch/alpha/boot/bootp.c Fri Oct 5 05:47:08 2001 +++ linux/arch/alpha/boot/bootp.c Tue Oct 19 19:22:21 2004 @@ -26,6 +26,8 @@ extern unsigned long switch_to_osf_pal(u struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa, unsigned long *vptb); +extern void move_stack(unsigned long new_stack); + struct hwrpb_struct *hwrpb = INIT_HWRPB; static struct pcb_struct pcb_va[1]; @@ -118,12 +120,10 @@ static inline void runkernel(void) { __asm__ __volatile__( - "bis %1,%1,$30\n\t" "bis %0,%0,$27\n\t" "jmp ($27)" : /* no outputs: it doesn't even return */ - : "r" (START_ADDR), - "r" (PAGE_SIZE + INIT_STACK)); + : "r" (START_ADDR)); } extern char _end; @@ -147,9 +147,7 @@ start_kernel(void) */ static long nbytes; static char envval[256] __attribute__((aligned(8))); -#ifdef INITRD_IMAGE_SIZE static unsigned long initrd_start; -#endif srm_printk("Linux/AXP bootp loader for Linux " UTS_RELEASE "\n"); if (INIT_HWRPB->pagesize != 8192) { @@ -164,12 +162,19 @@ start_kernel(void) } pal_init(); -#ifdef INITRD_IMAGE_SIZE /* The initrd must be page-aligned. See below for the cause of the magic number 5. */ - initrd_start = ((START_ADDR + 5*KERNEL_SIZE) | (PAGE_SIZE-1)) + 1; + initrd_start = ((START_ADDR + 5*KERNEL_SIZE + PAGE_SIZE) | + (PAGE_SIZE-1)) + 1; +#ifdef INITRD_IMAGE_SIZE srm_printk("Initrd positioned at %#lx\n", initrd_start); #endif + + /* + * Move the stack to a safe place to ensure it won't be + * overwritten by kernel image. + */ + move_stack(initrd_start - PAGE_SIZE); nbytes = callback_getenv(ENV_BOOTED_OSFLAGS, envval, sizeof(envval)); if (nbytes < 0 || nbytes >= sizeof(envval)) { --- 2.4/arch/alpha/boot/bootpz.c Tue Oct 19 19:27:49 2004 +++ linux/arch/alpha/boot/bootpz.c Tue Oct 19 19:12:16 2004 @@ -32,9 +32,6 @@ #undef DEBUG_CHECK_RANGE #define DEBUG_ADDRESSES -#define DEBUG_SP(x) \ - {register long sp asm("30"); srm_printk("%s (sp=%lx)\n", x, sp);} - extern unsigned long switch_to_osf_pal(unsigned long nr, struct pcb_struct * pcb_va, struct pcb_struct * pcb_pa, unsigned long *vptb); @@ -42,6 +39,8 @@ extern unsigned long switch_to_osf_pal(u extern int decompress_kernel(void* destination, void *source, size_t ksize, size_t kzsize); +extern void move_stack(unsigned long new_stack); + struct hwrpb_struct *hwrpb = INIT_HWRPB; static struct pcb_struct pcb_va[1]; @@ -154,12 +153,10 @@ static inline void runkernel(void) { __asm__ __volatile__( - "bis %1,%1,$30\n\t" "bis %0,%0,$27\n\t" "jmp ($27)" : /* no outputs: it doesn't even return */ - : "r" (START_ADDR), - "r" (PAGE_SIZE + INIT_STACK)); + : "r" (START_ADDR)); } /* Must record the SP (it is virtual) on entry, so we can make sure @@ -244,7 +241,9 @@ extern char _end; for "bootmem" anyway. */ #define K_COPY_IMAGE_START NEXT_PAGE(K_KERNEL_IMAGE_END) -#define K_INITRD_START NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE) +/* Reserve one page below INITRD for the new stack. */ +#define K_INITRD_START \ + NEXT_PAGE(K_COPY_IMAGE_START + KERNEL_SIZE + PAGE_SIZE) #define K_COPY_IMAGE_END \ (K_INITRD_START + REAL_INITRD_SIZE + MALLOC_AREA_SIZE) #define K_COPY_IMAGE_SIZE \ @@ -410,8 +409,7 @@ start_kernel(void) initrd_image_start, INITRD_IMAGE_SIZE); #endif - memcpy((void *)initrd_image_start, - (void *)V_INITRD_START, + memcpy((void *)initrd_image_start, (void *)V_INITRD_START, INITRD_IMAGE_SIZE); #endif /* INITRD_IMAGE_SIZE */ @@ -427,9 +425,14 @@ start_kernel(void) K_KERNEL_IMAGE_START, (unsigned)KERNEL_SIZE); #endif + /* + * Move the stack to a safe place to ensure it won't be + * overwritten by kernel image. + */ + move_stack(initrd_image_start - PAGE_SIZE); + memcpy((void *)K_KERNEL_IMAGE_START, - (void *)uncompressed_image_start, - KERNEL_SIZE); + (void *)uncompressed_image_start, KERNEL_SIZE); } /* Clear the zero page, then move the argument list in. */ --- 2.4/arch/alpha/boot/bootloader.lds Tue Jul 3 01:40:14 2001 +++ linux/arch/alpha/boot/bootloader.lds Tue Oct 19 15:56:21 2004 @@ -1,5 +1,6 @@ OUTPUT_FORMAT("elf64-alpha") ENTRY(__start) +printk = srm_printk; SECTIONS { . = 0x20000000; --- 2.4/arch/alpha/boot/head.S Mon Oct 12 22:40:12 1998 +++ linux/arch/alpha/boot/head.S Tue Oct 19 18:51:47 2004 @@ -100,3 +100,24 @@ halt: .prologue 0 call_pal PAL_halt .end halt + +/* $16 - new stack page */ + .align 3 + .globl move_stack + .ent move_stack +move_stack: + .prologue 0 + lda $0, 0x1fff($31) + and $0, $30, $1 /* Stack offset */ + or $1, $16, $16 /* New stack pointer */ + mov $30, $1 + mov $16, $2 +1: ldq $3, 0($1) /* Move the stack */ + addq $1, 8, $1 + stq $3, 0($2) + and $0, $1, $4 + addq $2, 8, $2 + bne $4, 1b + mov $16, $30 + ret ($26) + .end move_stack ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: 2.4.27, alpha arch, make bootimage and make bootpfile fails 2004-10-19 15:54 ` Ivan Kokshaysky @ 2004-10-20 11:19 ` Norbert Preining 0 siblings, 0 replies; 8+ messages in thread From: Norbert Preining @ 2004-10-20 11:19 UTC (permalink / raw) To: Ivan Kokshaysky; +Cc: linux-kernel, debian-alpha, linux-alpha On Die, 19 Okt 2004, Ivan Kokshaysky wrote: > I was able to reproduce that on SX164 with both bootpfile and bootpzfile. > As it turns out, the final kernel destination overlaps the initial stack > region. Please test the appended patch. Bingo. Thanks a lot. I tested bootpfile and this worked without any problems. Very nice. Best wishes Norbert ------------------------------------------------------------------------------- Norbert Preining <preining AT logic DOT at> Technische Universität Wien gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094 ------------------------------------------------------------------------------- TUMBY (n.) The involuntary abdominal gurgling which fills the silence following someone else's intimate personal revelation. --- Douglas Adams, The Meaning of Liff ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-10-20 11:27 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2004-10-12 17:33 2.4.27, alpha arch, make bootimage and make bootpfile fails Norbert Preining 2004-10-13 19:32 ` Ivan Kokshaysky 2004-10-13 21:10 ` Norbert Preining 2004-10-14 13:00 ` Norbert Preining 2004-10-14 17:23 ` Måns Rullgård 2004-10-15 10:39 ` Norbert Preining 2004-10-19 15:54 ` Ivan Kokshaysky 2004-10-20 11:19 ` Norbert Preining
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox