Hello All,
Prologue:
i have been trying to make HelenOS (Revision 1517) working with AT91SAM9260EK
from Atmel (CPU: arm926ej-s). U-Boot had been installed
on the board and the HelenOS image can be downloaded into SDRAM and executed on
proper address. Some devices have been initialized
by this time, thus the whole low-level crap with SDRAM, debug uart and over
devices can be skipped.
There are some things with which i was or am struggling against:
1) OPTIMIZATION flag set by several Makefiles in boot and kernel makes the
toolchain generating not executable code?..
My actual solution besides of analyzing machine code is to move
$(OPTIMIZATION) from Makefiles away.
(I tried to compile Atmel's own bootstrap program with HelenOS-toolchain.
Having executable program was only possible with -O[s|0|1|2|3) omitted.)
2) The CPU hangs just after activating the MMU in boot module.
My actual solution is to exclude the highest 256MB (from 0xf0000000 to
0xffffffff) from mapping down to 0x70000000 to 0x7fffffff.
Why is it necessary to mirror user-address-space (lower 2GB) to
kernel-address-space (upper 2GB) __entirely__? At this point I do not really
understand how the CPU with enabled MMU should interact
with peripherals - on accessing any peripheral address (from 0xf0000000
upwards) this will be translated into 0x700...something?
3) image.bin (and uImage.bin too) produced by Makefile from image.boot can't be
executed?..
My actual solution is hand-made: arm-..-objcopy -O binary image.raw image.bin.
4) At last the kernel can be booted. I have implemented an assembler function
named early_printchar() which is really must have to trace
the kernel boot process, before having console input/output initialized. The
kernel code has been peppered now with
printf("%s, %d\n", __FUNCTION__, __LINE__) in order to see where the next bug
is haunting. And there is one - the CPU hangs up on
tlb_invalidate_all()! Here the boot log:
=====================================================================
HelenOS bootloader, release 0.4.3 (Sashimi)
Built on 2012-06-12 00:22:02 for arm32
Copyright (c) 2001-2012 HelenOS project
Memory statistics
0x2000d000|0x2000d000: bootstrap stack
0x20008000|0x20008000: bootstrap page table
0x2000d6f0|0x2000d6f0: boot info structure
0xa0a00000|0x20a00000: kernel entry point
0x2000dbfc|0x2000dbfc: kernel image (417240/93571 bytes)
0x2002497f|0x2002497f: ns image (101572/44960 bytes)
0x2002f91f|0x2002f91f: loader image (108400/44643 bytes)
0x2003a782|0x2003a782: init image (101428/44955 bytes)
0x2004571d|0x2004571d: locsrv image (107004/48056 bytes)
0x200512d5|0x200512d5: rd image (98860/43806 bytes)
0x2005bdf3|0x2005bdf3: vfs image (113024/51104 bytes)
0x20068593|0x20068593: tmpfs image (115548/51866 bytes)
0x2007502d|0x2007502d: initrd image (8499207/3697672 bytes)
Inflating 9 components ... initrd(at 0xa0b20000) tmpfs(at 0xa0b03000) vfs(at
0xa0ae7000) rd(at 0xa0ace000) locsrv(at 0xa0ab3000) init(at 0xa0a9a000)
loader(at 0xa0a7f000) ns(at 0xa0a66000) kernel(at 0xa0a00000) .
Booting the kernel at 0xa0a00000...
SPARTAN kernel, release 0.4.3 (Sashimi)
Built on 2012-06-12 00:22:02 for arm32
Copyright (c) 2001-2012 HelenOS project
arch_pre_mm_init
km_identity_init
frame_init
slab_cache_init
ra_init
sysinfo_init
btree_init
as_init
as_install_arch, 55
=====================================================================
void as_install_arch(as_t *as)
{
printf("%s, %d\n", __FUNCTION__, __LINE__); // as_install_arch,
55 from boot log
tlb_invalidate_all();
printf("%s, %d\n", __FUNCTION__, __LINE__);
}
void tlb_invalidate_all(void)
{
asm volatile (
"eor r1, r1\n"
"mcr p15, 0, r1, c8, c7, 0\n"
::: "r1"
);
}
=====================================================================
So, i ran out of steam. Is here something wrong with MMU
initialization/activation sequence or similar?
My code modifications can be posted when required -(approx. 10,000 lines).
--
Best regards,
Alexander
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel