embedded-linux

Can ARM qemu system emulator boot from card image without kernel param?

感情迁移 提交于 2019-12-01 04:18:04
问题 I've seen a lot of examples how to run a QEMU ARM board emulator. In every case, besides SD card image param, QEMU was also always supplied with kernel param, i.e.: qemu-system-arm -M versatilepb \ -kernel vmlinuz-2.6.18-6-versatile \ #KERNEL PARAM HERE -initrd initrd.gz \ -hda hda.img -append "root=/dev/ram" I am palying with bootloaders and want to create my own bootable SD card, but don't have a real board yet and want to learn with an emulated one. However, if run as described above, QEMU

How is the init process started in the Linux kernel?

偶尔善良 提交于 2019-12-01 04:02:29
I am trying to understand the init process in the linux kernel which is the first process and is statically initialized with the INIT_TASK macro. 161 #define INIT_TASK(tsk) \ 162 { \ 163 .state = 0, \ 164 .stack = &init_thread_info, \ 165 .usage = ATOMIC_INIT(2), \ 166 .flags = PF_KTHREAD, \ 167 .prio = MAX_PRIO-20, \ 168 .static_prio = MAX_PRIO-20, \ 169 .normal_prio = MAX_PRIO-20, \ 170 .policy = SCHED_NORMAL, \ 171 .cpus_allowed = CPU_MASK_ALL, \ 172 .nr_cpus_allowed= NR_CPUS, \ 173 .mm = NULL, \ 174 .active_mm = &init_mm, \ 175 .se = { \ 176 .group_node = LIST_HEAD_INIT(tsk.se.group_node),

How is the init process started in the Linux kernel?

只谈情不闲聊 提交于 2019-12-01 02:20:53
问题 I am trying to understand the init process in the linux kernel which is the first process and is statically initialized with the INIT_TASK macro. 161 #define INIT_TASK(tsk) \ 162 { \ 163 .state = 0, \ 164 .stack = &init_thread_info, \ 165 .usage = ATOMIC_INIT(2), \ 166 .flags = PF_KTHREAD, \ 167 .prio = MAX_PRIO-20, \ 168 .static_prio = MAX_PRIO-20, \ 169 .normal_prio = MAX_PRIO-20, \ 170 .policy = SCHED_NORMAL, \ 171 .cpus_allowed = CPU_MASK_ALL, \ 172 .nr_cpus_allowed= NR_CPUS, \ 173 .mm =

What is the use of GFP_USER flag in kmalloc?

最后都变了- 提交于 2019-12-01 00:40:25
As far as I understand, the use in the GFP_USER flag (in the call to kmalloc ) is used to allocate memory for user space. Does it means that the allocated page are in kernel space, which are accessible to user? Does these pages required to be mmapp 'ed in user space or the address is directly accessible to user. If they need to mmapp then what is difference between GFP_USER and GFP_KERNEL ? Brief explanation can be found in kernel sources : GFP_KERNEL is typical for kernel-internal allocations. The caller requires ZONE_NORMAL or a lower zone for direct access but can direct reclaim. GFP_USER

How can I generate kernel headers for an “unknown” embedded ARM system?

拜拜、爱过 提交于 2019-11-30 23:44:43
I have an (old) embedded system for which I want to compile programs. I don't have the toolchain, so I want to create one. The embedded system has an "ARM926EJ-S rev 5 (v5l)" CPU and "cat /proc/version" says that it runs "Linux version 2.6.20.7" with GCC 4.0.2. I have heard that I have to include the kernel headers in the build process. I download the Linux kernel version 2.6.20 from kernel.org, extract all files and run "make headers_install ARCH=arm INSTALL_HDR_PATH=~/headers". Is this the correct way or do I need the header files of the specific kernel? untar the kernel. make mrproper make

Shutdown (embedded) linux from kernel-space

别说谁变了你拦得住时间么 提交于 2019-11-30 20:06:22
I'm working on a modified version of the 2.6.35 kernel for Olinuxino, an ARM9 based platform. I'm trying to modify the power management driver (the architecture specific part). The processor is a Freescale i.MX23. This processor has a "special" pin, called PSWITCH, that triggers an interrupt that is handled by the power management driver. If the switch is pressed,the system goes to standby. This is done in the driver by calling pm_suspend(PM_SUSPEND_STANDBY) . Given my hardware setup, I'd like to, instead, shutdown the system. So my question is: What is the preferred way for a kernel-space

how to rebuild rootfs in buildroot

醉酒当歌 提交于 2019-11-30 20:01:18
I am going to setup build environment to make my own linux embedded system for AT91SAM9X25 Board. I am using buildroot to do this. The make command build all targets, the first it build toolchain then packages and then rootfs and images of rootfs (tar, cpio ...). To rebuild rootfs I usually use make clean and then make. The make clean command removes all and including toolchain. So the first my question is: Is there some way to remake rootfs without building toolchain? It takes a lot of time. Also I am building linux kernel within buildroot. I have turned on BR2_LINUX_KERNEL [=y] in buildroot.

Execute a program in kernel space in Linux

纵饮孤独 提交于 2019-11-30 15:37:06
问题 If I want to execute a user program (not a kernel module) in Linux kernel space, what options do I have? I have looked at KML(kernel mode linux) but that is specific to IA-32 architecture. I want a solution which is cross platform and can work on embedded linux systems. 回答1: User programs don't execute in kernel space - that's what makes them user programs. If you want to execute code in kernel space you have two options: build it in to the kernel, or load it with a kernel module. 回答2: You

Valgrind cross compilation for ARMv5tel

孤人 提交于 2019-11-30 15:08:08
问题 I ran configure with the following option: ./configure --target=armv5tel CC=arm-linux-gnueabi-gcc --host=i686-linux then ran make I encountered the following error: m_cpuid.S: Assembler messages: m_cpuid.S:40: Error: bad instruction `pushl %ebp' m_cpuid.S:41: Error: bad instruction `movl %esp,%ebp' m_cpuid.S:42: Error: bad instruction `pushl %ecx' m_cpuid.S:43: Error: bad instruction `pushfl' m_cpuid.S:44: Error: bad instruction `pushfl' m_cpuid.S:45: Error: bad instruction `popl %eax' m

Execute a program in kernel space in Linux

浪尽此生 提交于 2019-11-30 14:32:30
If I want to execute a user program (not a kernel module) in Linux kernel space, what options do I have? I have looked at KML(kernel mode linux) but that is specific to IA-32 architecture. I want a solution which is cross platform and can work on embedded linux systems. User programs don't execute in kernel space - that's what makes them user programs. If you want to execute code in kernel space you have two options: build it in to the kernel, or load it with a kernel module. You wrote in another question that you are a newcomer to kernel programming. Using KML is highly unconventional, and