[uClinux-dev] about kernal and user program,need your help!

¹Ùá¿Ã÷ guanzhengming at tsinghua.org.cn
Wed Mar 19 02:41:28 EST 2003


hi all!
I am a newbie to uclinux
I have a coldfire5272 platform which can run uclinux,my kernel is uclinux2.0.
I was puzzled by some questions for a long time.please give me some 
advises ,anyway,thanks.
the questions are following:
1.my kernel is compiled to imaged.bin,which is including linux.bin and
romfs.img.The kernel is run from flash,this is my rom.ld
MEMORY {
	/* make room for VECBASE(0x400) and STACK(0x1000) */
	ram    : ORIGIN = 0x0000400, LENGTH = 0x1000000 - 0x0400
	/* rom (flash) actually starts at 0xffe00000, but linux can co-exist
	   with the shipping product as an alternative boot mode. */
	rom : ORIGIN = 0xffc00000, LENGTH = 0x400000 
}

SECTIONS {
	
        .text :AT(_eromtext){
                _stext = . ;
                 _sdata = . ;
                __data_start = . ;
                *(.text)
                _etext = ALIGN(0x4) ;
                *(.rodata)
                *(.data)
                _edata = ALIGN(0x4) ;
        } > ram

	.bss BLOCK(0x4) : {
		_sbss = . ;
		*(.bss)
		*(COMMON)
		_ebss = ALIGN(0x4) ;
		_end = ALIGN(0x4) ;

	} > ram


        .romvec :{
                _romvec = .;
                *(.romvec)
	} > rom

	.romtext 0xffc00400:{
                _eromvec = ALIGN(0x4);
                _romtext = ALIGN(0x4);
                *(.romtext)
                _eromtext = ALIGN(0x4);
                __data_rom_start = ALIGN(0x4) ;
        } > rom

/*        .data : AT(__data_rom_start) {
                _sdata = . ;
                __data_start = . ;
                *(.rodata)
                *(.data)
                _edata = ALIGN(0x4) ;
        } > ram
*/
}
it means copy the .text and .data from flash to sdram and run.
my first question is how the romfs.img work in the memory?
does it controled by kernel ? what is the memory allocation to the romfs?
2.if i have compiled a user program.
then how the executable file is loaded into the ram?how can i guarantee
the user program doesn't crash the kernel and others user program.
the code,data,stack of the kernel and user programs,i want know all of these's
map
but how can i know?
3,i have look my user.ld.
it define MEMORY {
        flatmem : ORIGIN = 0x0, LENGTH = 0x100000
}
.text,.data,.bss,all of these are>flatmem
i am doubt,in rom.ld the{ ram    : ORIGIN = 0x0000400, LENGTH = 0x1000000 -
0x0400}
from 0x0000400,there are kernel's code and data,
and the user's code and data are placed in 0x0 ,too
aren't they crashed?
need you help,thank you very much!
                                     regards
   Jimmy





More information about the uClinux-dev mailing list