how to compile the linux kernel




当你下载linux源码以后,有补丁的打补丁,how to use the patch。

cd 源码ing patch -P1 < ../linux_.patch the patch fila is linux_.patch
when you are using the p1, that means you will miss the current folder

the next step will be important for us.
the sequence of compiling the kernel of linux.

the first method
 the linux must provide default config file for compiling. you can find it for example
 make s3c2410_menuconfig.  
 
 the process will generate .config file, which be written into .config file.
 
 configuration written to .config
 
 then make menuconfig

the second method.
 if the vendor must provide itself config file. the next step change the name of vender config to
 .config file.
 then make menuconfig

When you has configured the config file. the next step you perform the make or make uImage, which will
generate the uImage file, that is kernel file of linux. you could use the u-boot file to download the file.

now, the new Iamge has been got.

how to download the uImage using the dnw of linux and com port of windows, which means combine both
the first step:
connect the com port and press the key of downloading uImage

the second step:
connect the dnw line


2. 用linux下的dnw
2.1 把linux下的dnw应用程序放到/bin目录
sudo chmod +x /bin/dnw
sudo chmod +x /bin/dnw

2.2 如果使用VMWAER,让VMWARE位于前台,然后再用USB线连接PC和开发板USB DEVICE接口
用lsusb命令确认VMWARE LINUX已经识别出UBOOT的USB设备
Bus 002 Device 002: ID 5345:1234 Owon PDS6062T Oscilloscope


2.3 在UBOOT界面输入k
    然后在LINUX下执行 dnw uImage
   
2.4 在UBOOT界面输入y
    然后在LINUX下执行 dnw fs_qtopia.yaffs2
 
in practice copy the uImage file to /bin/
 
 











  

### Linux Kernel Stack Data Structure Implementation and Usage In the context of the Linux kernel, a stack is implemented as an array with pointers or indices that track the current position within this array. The architecture-specific code defines the exact layout and size of each thread's stack area. The typical implementation involves defining structures like `thread_info` which holds information about the execution environment including the pointer to the start of the stack space allocated for threads: ```c struct thread_info { struct task_struct *task; struct exec_domain *exec_domain; unsigned long flags; mm_segment_t addr_limit; struct restart_block restart_block; }; ``` Each process has its own stack managed by the scheduler through various fields such as those mentioned in the provided snippet[^1]. For instance, scheduling-related parameters are stored alongside other control variables necessary during context switches between processes. For managing function calls efficiently while ensuring minimal overhead, compilers generate assembly instructions that manipulate these stacks according to calling conventions specific to architectures supported by Linux. This includes saving registers before making subroutine invocations so they can be restored upon return. When it comes to using the stack within kernel modules or drivers, developers must adhere strictly to guidelines regarding memory allocation limits since excessive use could lead to overflow conditions causing system instability. Therefore, dynamic allocations should generally occur via heap-based mechanisms instead when dealing with variable-sized objects larger than what fits comfortably inside fixed-size per-thread storage areas reserved at compile time. --related questions-- 1. How does the Linux kernel manage stack overflows? 2. What role do inline functions play in reducing stack consumption? 3. Can you explain how exceptions handling works concerning the call stack in the Linux kernel? 4. In what scenarios would one prefer allocating data on the heap rather than utilizing automatic (stack) variables in driver development?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值