歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> uclinux-2008R1-RC8(bf561)到VDSP5的移植(16):start_kernel

uclinux-2008R1-RC8(bf561)到VDSP5的移植(16):start_kernel

日期:2017/3/3 16:43:42   编辑:關於Linux

在head.s初始化完成後,它將跳轉到start_kernel函數繼續運行,如下所示:

jump.l _start_kernel;

start_kernel的實現在init/main.c中

asmlinkage void __init start_kernel(void)

這標志著啟動第一階段的結束,第二階段的開始。但是在vdsp中,啟動調試後默認將停在main函數的第一條語句上,因此,為了滿足VDSP的自以為是,我們將這個跳轉改為main函數,並在main函數中調用start_kernel:

jump.l _main;

而main函數則變為:

#include <config.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/string.h>
#include <linux/ctype.h>
/*****************************************************************************
* Core A
* coreA.c
*****************************************************************************/

asmlinkage void __init main( void )
{
/* The default startup code does not include any functionality to allow core
A to enable core B. A convenient way to enable core B is to use the
'adi_core_b_enable()' function. */
//adi_core_b_enable();

/* Begin adding your custom code here */
start_kernel();
}

由於start_kernel在這裡變成了函數調用,因此需要將其聲明(include/linux/start_kernel.h)改為:

extern void __init start_kernel(void);

同時將init/main.c中的實現改為:

void __init start_kernel(void)

Copyright © Linux教程網 All Rights Reserved