relocate


热门范文 2019-09-06 06:34:47 热门范文
[摘要]relocate篇(1):hould I Relocate? 我该搬家吗?Should I Relocate? 我该搬家吗?Megan: Amber, How are things going overall? Have you decided on your next move after gra

【www.shanpow.com--热门范文】

relocate篇(1):hould I Relocate? 我该搬家吗?


Should I Relocate? 我该搬家吗?Megan: Amber, How are things going overall? Have you decided on your next move after grad school?
Amber: Funny you should mention a move. Actually, I"ve decided to
relocate to Denver. Brad, my boyfriend, got a job in Denver, so I"m
going to move there too.
Megan: Let me be blunt. Are you contemplating marrying this guy?
Amber: I think about it. But we haven"t known each other all that
long. We need to spend more time together. That"s why I want to be in
the same city. I have to find a job anyway, so I"ll just look in Denver.
Megan: You know, your situation could really affect your job
search. Prospective employers usually want to know why you left your
last job or moved to their area. Admitting that you followed a boyfriend
sounds somewhat unstable. Some bosses might worry that if the
relationship didn"t work out, you"d leave your job and move back home.
Amber: I wouldn"t do that. If that happens, I"ll just play it by ear.
Megan: I"m just afraid if you leave everything here, you"ll resent Brad if things don"t work out.
Amber: True. I"ll definitely think more about it before I commit to this move. 梅根∶安柏,一切都还好吗?研究所毕业後下一步要做什麽你决定了吗?
安柏∶你提到下一「步」还真巧啊。其实我已经决定要搬到丹佛了。我男友布莱德在丹佛找到一份工作,所以我也要搬去那里。
梅根∶恕我直言,你是考虑嫁给这个人吗?
安柏∶我有想过,但我们认识还没那麽久,要花更多时间相处才知道,这就是为什麽我想跟他去同一座城市。反正我得找工作,就去丹佛找吧。
梅根∶跟你说,你的情况真的会影响你找工作。潜在雇主通常想知道你为什麽离开上一份工作或是搬到他们那区。 承认你是跟著男友过来的,听起来不太稳定。有些老板可能会担心如果恋情吹了,你会离职搬回家。
安柏∶我才不会那样呢。如果真的发生了,再见机行事棉。
梅根∶我只是担心你要是抛下这里的一切,如果事情没能顺利发展,你就会怨恨布莱德。
安柏∶有道理,我决定搬家之前,一定会再好好思考一番。
Q1: Have all of the employees __________ about the company"s new vacation policy?(A) been notified (B) who notify (C) are notifying (D) that notifies
Q2: Some time ago, Nancy and Paul __________ purchasing a new home in the suburbs.(A) may contemplate (B) contemplated (C) are contemplating (D) contemplate
【见机行事】的英文怎麽说?play it by ear 见机行事;随机应变;根据情况需要来行动。造句∶
We"re thinking about going to the movies this weekend, but we"ll play it by ear.
英语达人解答(1) A (2) B

relocate篇(2):[转载]如何进行svn relocate 操作


1。进入工作复本
#> cd ~/test
2。查看仓库地址(URL)
#> svn info
路径:.
地址(URL):http://192.168.28.1/repos/test
档案库 UUID:a81f9bed-3506-0410-b369-e50476f75162
修订版:44
节点种类:目录
调度:正常
最后修改的作者:yanghong
最后修改的修订版:44
最后修改的时间: 2005-11-24 16:05:30 +0800 (四, 24 11月 2005)
可以看到地址为:"http://192.168.28.1/repos/test"
3。更改仓库地址(URL)
#> svn switch --relocate http://192.168.28.1/repos/test https://192.168.28.1/repos/test
验证“https://192.168.28.1:443”的服务器凭证时发生错误:
- 本凭证并不是由受信任的权威机权所核发。请手动利用指纹以验证
凭证的有效性!
- 本凭证的主机名称不符。
凭证信息:
- 主机名称:(www|svn|ftp|developers).cocreate.com.cn
- 有效期间:自 Dec 22 02:52:50 2005 GMT 至 Jan 21 02:52:50 2006 GMT
- 发行者:Co-Create Open Source Software Co.,Ltd., BeiJing, BeiJing, CN
- 指纹:63:62:b9:9e:61:c2:10:d2:ae:49:81:87:a3:57:a8:e4:76:42:6f:c8
(R)拒绝,(t)暂时接受 或 (p)永远接受?p

Q:我的SVN服务器换地址了,我在客户端要做什么变化?
A:
1,将当前的用户在SVN客户端当前路径切换到当初更新SVN的位置上.
2,执行命令:svn switch --relocate (Old Repository Root) (New Repository Root)
Old Repository Root可以通过:svn info来查看.
3,svn update就可以正常的更新你的系统了.
附SVN INFO的内容范例:
$ svn info
Path: .
URL: http://svn.svn.com/ProjectName/Trunk/Project
Repository Root: http://svn.svn.com/ProjectName
Repository UUID: 149e7728-2900-0410-bded-c30b68e36566
Revision: Numbver
Node Kind: directory
Schedule: normal
Last Changed Author: Programmer Nme
Last Changed Rev: Number
Last Changed Date: 2009-02-14 12:39:08 +0800 (Sat, 14 Feb 2009)

relocate篇(3):MIPS u-boot下code Relocate流程

MIPS u-boot下code Relocate流程 u-boot的强大就在于它具有代码relocate功能,运行时代码在ram中跑,最明显的一个好处就是u-boot可以自己替换自己固化在flash中的代码。
        先看一下这套代码中和relocate有关的几个大名鼎鼎的参数:
board/ar7100/ap83/config.mk
# ROM version               
TEXT_BASE = 0xbf000000
# SDRAM version
#TEXT_BASE = 0x8020000
include/configs/ap83.h
#define CFG_MONITOR_BASE    TEXT_BASE
board/ar7100/ap83/u-boot.lds
OUTPUT_FORMAT("elf32-tradbigmips", "elf32-tradbigmips", "elf32-tradbigmips")
OUTPUT_ARCH(mips)
ENTRY(_start)
SECTIONS
{
    . = 0x00000000;
    . = ALIGN(4);
    .text       :
    {
      *(.text)
    }
    . = ALIGN(4);
    .rodata  : { *(.rodata) }
    . = ALIGN(4);
    .data  : { *(.data) }
    . = ALIGN(4);
    .sdata  : { *(.sdata) }
    _gp = ALIGN(16);
    __got_start = .;
    .got  : { *(.got) }
    __got_end = .;
    .sdata  : { *(.sdata) }
    __u_boot_cmd_start = .;
    .u_boot_cmd : { *(.u_boot_cmd) }
    __u_boot_cmd_end = .;
    uboot_end_data = .;
    num_got_entries = (__got_end - __got_start) >> 2;
    . = ALIGN(4);
    .sbss  : { *(.sbss) }
    .bss  : { *(.bss) }
    uboot_end = .;
}
注释:
0xbf000000 是mips 24kc Flash起始的位置,也是reset异常向量的入口。
0x80000000是ar9132平台DDR的起始位置。
链接脚本中的0x00000000会被这个TEXT_BASE替代,可以观察编译时候的输出,你会发现有一个-DTEXT_BASE=0xbf000000的选项。
Relocate的代码在start.S中。
启动的大致顺序如下,假设代码固化于flash起始位置。
       CPU 上电
       Reset异常(初始化cp0寄存器)           
       设置GOT
       lowlevel_init(初始化SDRAM)
       初始化cache
       Relocate代码
下面是代码的入口
       la  t9, board_init_f
          j   t9
          nop
这个board_init_f定义在lib_mips/board.c中。
这个程序为下列元素分配合适的内存空间:
[1] u-boot代码(.text .data .bss)
[2] malloc空间 (相当于heap)
[3] Board Info
[4] Global Data
[5] Stack
这里可以看出malloc的空间位于heap中,即内存的高端,而函数中的局部变量,都在stack中的,在内存低端。
                                          
void board_init_f(ulong bootflag)
{
       gd_t gd_data, *id;
       bd_t *bd;
       init_fnc_t **init_fnc_ptr;
       ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
       ulong *s;
       /* Pointer is writable since we allocated a register for it.
        */
       gd = &gd_data;
       /* compiler optimization barrier needed for GCC >= 3.4 */
       __asm__ __volatile__("": : :"memory");
       memset ((void *)gd, 0, sizeof (gd_t));
       for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
              if ((*init_fnc_ptr)() != 0) {
                     hang ();
              }
       }
       /*
        * Now that we have DRAM mapped and working, we can
        * relocate the code and continue running from DRAM.
        */
       addr = CFG_SDRAM_BASE + gd->ram_size;
       /* We can reserve some RAM "on top" here.
             */                          
       /* round down to next 4 kB limit.
        */
       addr &= ~(4096 - 1);
       debug ("Top of RAM usable for U-Boot at: %08lx\n", addr);
       /* Reserve memory for U-Boot code, data & bss
        * round down to next 16 kB limit
        */
       addr -= len;
       addr &= ~(16 * 1024 - 1);
       debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
        /* Reserve memory for malloc() arena.
        */
       addr_sp = addr - TOTAL_MALLOC_LEN;
       debug ("Reserving %dk for malloc() at: %08lx\n",
                     TOTAL_MALLOC_LEN >> 10, addr_sp);
       /*
        * (permanently) allocate a Board Info struct
        * and a permanent copy of the "global" data
        */
       addr_sp -= sizeof(bd_t);
       bd = (bd_t *)addr_sp;
       gd->bd = bd;
       debug ("Reserving %d Bytes for Board Info at: %08lx\n",
                     sizeof(bd_t), addr_sp);
       addr_sp -= sizeof(gd_t);
       id = (gd_t *)addr_sp;
       debug ("Reserving %d Bytes for Global Data at: %08lx\n",
                     sizeof (gd_t), addr_sp);
      /* Reserve memory for boot params.
        */
       addr_sp -= CFG_BOOTPARAMS_LEN;
       bd->bi_boot_params = addr_sp;
       debug ("Reserving %dk for boot params() at: %08lx\n",
                     CFG_BOOTPARAMS_LEN >> 10, addr_sp);
       /*
        * Finally, we set up a new (bigger) stack.
        *
        * Leave some safety gap for SP, force alignment on 16 byte boundary
        * Clear initial stack frame
        */
       addr_sp -= 16;
       addr_sp &= ~0xF;
       s = (ulong *)addr_sp;
       *s-- = 0;
       *s-- = 0;
       addr_sp = (ulong)s;
       debug ("Stack Pointer at: %08lx\n", addr_sp);
      
       memcpy (id, (void *)gd, sizeof (gd_t));
       /* On the purple board we copy the code in a special way
        * in order to solve flash problems
        */
#ifdef CONFIG_PURPLE
       copy_code(addr);
#endif
       relocate_code (addr_sp, id, addr);
       /* NOTREACHED - relocate_code() does not return */
}
从代码中可以看出,U-boot被relocate到内存的最高端。Relocate的实际部分在start.S中,通过relocate_code
(addr_sp, id, addr)进入汇编,mips体系中函数参数被保存在a0,a1,a2中,所以看start.S中的注释有:
/*
* void relocate_code (addr_sp, gd, addr_moni)
*                                       
* This "function" does not return, instead it continues in RAM
* after relocating the monitor code.
*
* a0 = addr_sp
* a1 = gd
* a2 = destination address
*/
Relocate的核心代码如下,分析一下能体会到mips汇编的delay branch
relocate_code:
    move    sp, a0      /* Set new stack pointer        */
    li  t0, CFG_MONITOR_BASE
    la  t3, in_ram        
    lw  t2, -12(t3) /* t2     */
move    t1, a2        
/*
     * t0 = source address
     * t1 = target address
     * t2 = source end address
     */
    /* On the purple board we copy the code earlier in a special way
     * in order to solve flash problems
     */
1:
    lw  t3, 0(t0)
    sw  t3, 0(t1)
    addu    t0, 4
    ble t0, t2, 1b
    addu    t1, 4           /* delay slot           */
    /* If caches were enabled, we would have to flush them here.
     */
    /* Jump to where we"ve relocated ourselves.
     */
    addi    t0, a2, in_ram - _start
    j   t0
    nop
上面计算u-boot end地址lw  t2, -12(t3)是因为有下面的定义,
    .word   uboot_end_data
    .word   uboot_end
    .word   num_got_entries
in_ram:                  
一个word四个字节,所以是in_ram的位置-12个字节。拷贝代码的时候,增加target指针位置的代码放在跳转代码之后,就是由于mips的流
水线。等拷贝完代码之后,就跳转到ram中执行了。也就是in_ram的地方(此时的in_ram在relocate后的内存高端)。
注意到在u-boot的连接脚本里面专门有一个.u_boot_cmd段,专门设置这样一个段有什么好处呢?可以看一下find_cmd这个函数,就可以
理解了,通过把所有cmd结构指针放在一个统一的段里面在查找起来非常方便,要添加新的命令,也不用改变原来的结构。看看它是怎么定义的吧:
原理:
每个命令都有一个命令结构体
struct cmd_tbl_s {
char*name;  /* Command Name*/
intmaxargs; /* maximum number of arguments*/
intrepeatable; /* autorepeat allowed?*/
int       (*cmd)(struct cmd_tbl_s *, int, int, char *[]);   /* Implementation function*/
char*usage;/* Usage message(short)*/
char*help;/* Help  message(long)*/
};
去定义它。Cmd为要调用的命令函数!name为该命令名字符串。
在u-boot里面有这样的宏
#define Struct_Section  __attribute__ ((unused,section (".u_boot_cmd")))
#define U_BOOT_CMD(name,maxargs,rep,cmd,usage,help) \
cmd_tbl_t __u_boot_cmd_##name Struct_Section = {#name, maxargs, rep, cmd, usage, help}
宏U_BOOT_CMD(name,maxargs,rep,cmd,usage,help)就是将
cmd_tbl_s{
name,
maxargs,
rep,
cmd,
usage,
help
}这样的一个命令结构体放入内存.u_boot_cmd这个区域,.u_boot_cmd这个域在board/smdk2410/u-boot.lds中
定义!在U-boot中的shell中,根据用户输入的命令,就会在.u_boot_cmd这个内存区域中查找,当.u_boot_cmd中某一个
cmd_tbl_s命令结构体的cmd_tbl_s.name和输入的命令字符串相符时,就调用该命令
结构体的cmd_tbl_s.cmd( ….)函数!
这里有一个要注意的是,cmd是一个函数指针,由于u-boot代码是要relocate的,所以在代码relocate之后,每个这样的指针也要加上相应的偏移才能正常动作,代码在board_init_r函数中。
  
最后是板子上电启动时的输出信息,看了很有帮助。
U-Boot 1.1.4-RAM VSC7395@MAC1 (Mar 21 2008 - 15:57:42)
AP83 (ar9100 with SPI flash)
DRAM:  16 MB
Top of RAM usable for U-Boot at: 81000000
Reserving 263k for U-Boot at: 80fbc000
Reserving 192k for malloc() at: 80f8c000
Reserving 56 Bytes for Board Info at: 80f8bfc8
Reserving 36 Bytes for Global Data at: 80f8bfa4
Reserving 128k for boot params() at: 80f6bfa4
Stack Pointer at: 80f6bf88
Now running in RAM - U-Boot at: 80fbc000
        Found MXIC Flash. ID c22018
Flash: 16 MB
Relocate代码中还包含PIC GOT的东西,学懂了也要分析一下。
从代码调试中的一个小地方可以看出GOT的作用,你只要把代码relocate前后的&__u_boot_cmd_start的值打印出来,你会发现它们是不一样的,这就是我们在start.S中修改GOT指针的作用。

本文来源:https://www.shanpow.com/news/442124/

《relocate.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式

相关阅读
  • 《中国九年义务教育歌》 《中国九年义务教育歌》
  • 员工作业效率算法说明 员工作业效率算法说明
  • 补入党介绍人证明 补入党介绍人证明
  • 严字当头确保全面从严治党主体责任落地落实 严字当头确保全面从严治党主体责任落地落实
  • 被巡察单位党组工作汇报材料 被巡察单位党组工作汇报材料
  • 疫情防控党课讲稿大全 疫情防控党课讲稿大全
  • 疫情防控事迹材料 疫情防控先进个人事迹材料 疫情防控事迹材料 疫情防控先进个人事迹材料
  • 大学生读书笔记1000字 大学生读书笔记1000字
为您推荐